From 8477015b38d995a126e54150c31d0312593798bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 01:05:06 +0000 Subject: [PATCH 01/10] Bump github.com/spf13/cobra from 1.8.1 to 1.9.1 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Bump eslint from 9.20.0 to 9.20.1 in /assets/webpack Bumps [eslint](https://github.com/eslint/eslint) from 9.20.0 to 9.20.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.20.0...v9.20.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Bump postcss from 8.5.1 to 8.5.2 in /assets/webpack Bumps [postcss](https://github.com/postcss/postcss) from 8.5.1 to 8.5.2. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.5.1...8.5.2) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Bump sass from 1.84.0 to 1.85.0 in /assets/webpack Bumps [sass](https://github.com/sass/dart-sass) from 1.84.0 to 1.85.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.84.0...1.85.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Bump sass-loader from 16.0.4 to 16.0.5 in /assets/webpack Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 16.0.4 to 16.0.5. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v16.0.4...v16.0.5) --- updated-dependencies: - dependency-name: sass-loader dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Updated CHANGELOG.md Closes #8, #9, #10, #11, #12 --- CHANGELOG.md | 10 ++++++++++ assets/webpack/package-lock.json | 24 ++++++++++++------------ go.mod | 2 +- go.sum | 6 ++---- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69e7910..75bb1f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +- ? + + Updated dependencies. + * Go + - cobra 1.8.1 ➙ 1.9.1 + * Node.js + - eslint 9.20.0 ➙ 9.20.1 + - postcss 8.5.1 ➙ 8.5.2 + - sass 1.84.0 ➙ 1.85.0 + - sass-loader 16.0.4 ➙ 16.0.5 + - 0.5.3-1 (2025-02-13): + Fixed step calculation when scraper is disabled (i.e., no scraping period available). diff --git a/assets/webpack/package-lock.json b/assets/webpack/package-lock.json index bc7b8a1..7f9ae64 100644 --- a/assets/webpack/package-lock.json +++ b/assets/webpack/package-lock.json @@ -2542,9 +2542,9 @@ } }, "node_modules/eslint": { - "version": "9.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.0.tgz", - "integrity": "sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA==", + "version": "9.20.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz", + "integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==", "dev": true, "license": "MIT", "dependencies": { @@ -4199,9 +4199,9 @@ "license": "MIT" }, "node_modules/postcss": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", - "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.2.tgz", + "integrity": "sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==", "dev": true, "funding": [ { @@ -5050,9 +5050,9 @@ "license": "MIT" }, "node_modules/sass": { - "version": "1.84.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.84.0.tgz", - "integrity": "sha512-XDAbhEPJRxi7H0SxrnOpiXFQoUJHwkR2u3Zc4el+fK/Tt5Hpzw5kkQ59qVDfvdaUq6gCrEZIbySFBM2T9DNKHg==", + "version": "1.85.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.85.0.tgz", + "integrity": "sha512-3ToiC1xZ1Y8aU7+CkgCI/tqyuPXEmYGJXO7H4uqp0xkLXUqp88rQQ4j1HmP37xSJLbCJPaIiv+cT1y+grssrww==", "dev": true, "license": "MIT", "dependencies": { @@ -5071,9 +5071,9 @@ } }, "node_modules/sass-loader": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.4.tgz", - "integrity": "sha512-LavLbgbBGUt3wCiYzhuLLu65+fWXaXLmq7YxivLhEqmiupCFZ5sKUAipK3do6V80YSU0jvSxNhEdT13IXNr3rg==", + "version": "16.0.5", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.5.tgz", + "integrity": "sha512-oL+CMBXrj6BZ/zOq4os+UECPL+bWqt6OAC6DWS8Ln8GZRcMDjlJ4JC3FBDuHJdYaFWIdKNIBYmtZtK2MaMkNIw==", "dev": true, "license": "MIT", "dependencies": { diff --git a/go.mod b/go.mod index c02bf56..bce0045 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/marcboeker/go-duckdb v1.8.4 github.com/prometheus/client_golang v1.20.5 github.com/rs/zerolog v1.33.0 - github.com/spf13/cobra v1.8.1 + github.com/spf13/cobra v1.9.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 github.com/valyala/fasthttp v1.58.0 diff --git a/go.sum b/go.sum index c4b819b..7f22f78 100644 --- a/go.sum +++ b/go.sum @@ -11,7 +11,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A= github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -115,9 +114,8 @@ github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -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/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= From 1eadb882a83720106fba80958e7dc72e3c6834b2 Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Mon, 17 Feb 2025 11:02:08 +0100 Subject: [PATCH 02/10] Updated dev env DuckDB, uv & Node.js --- CHANGELOG.md | 4 +++- extras/docker/Dockerfile | 16 +++++++++++----- extras/github/docker/Dockerfile-bookworm | 4 +++- extras/github/docker/Dockerfile-jammy | 4 +++- extras/github/docker/Dockerfile-noble | 4 +++- extras/github/docker/Dockerfile-rhel9 | 4 +++- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75bb1f0..796828c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ - ? + Updated dependencies. + * DuckDB 1.1.3 ➙ 1.2.0 + * uv 0.5.27 ➙ 0.6.0 * Go - cobra 1.8.1 ➙ 1.9.1 - * Node.js + * Node.js 22.13.1 ➙ 22.14.0 - eslint 9.20.0 ➙ 9.20.1 - postcss 8.5.1 ➙ 8.5.2 - sass 1.84.0 ➙ 1.85.0 diff --git a/extras/docker/Dockerfile b/extras/docker/Dockerfile index 0f9848a..26147e3 100644 --- a/extras/docker/Dockerfile +++ b/extras/docker/Dockerfile @@ -1,5 +1,11 @@ FROM docker.io/ubuntu:noble-20240423 +ENV DUCKDB_VERSION 1.2.0 +ENV FPM_VERSION 1.15.1 +ENV GO_VERSION 1.24.0 +ENV NODE_VERSION 22.14.0 +ENV UV_VERSION 0.6.0 + ENV DEBIAN_FRONTEND noninteractive RUN groupadd -g 5000 dev \ @@ -32,7 +38,7 @@ RUN apt update \ && apt clean \ && rm -rf /var/lib/apt/lists/* -RUN curl -L -s https://go.dev/dl/go1.24.0.linux-$(dpkg --print-architecture).tar.gz | tar xvfz - -C /usr/local \ +RUN curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz | tar xvfz - -C /usr/local \ && echo 'export PATH=$PATH:/usr/local/go/bin' >> /home/dev/.bashrc RUN ARCHITECTURE=$(uname -m) \ @@ -42,12 +48,12 @@ RUN ARCHITECTURE=$(uname -m) \ *) echo "unknown architecture: $ARCHITECTURE" && exit 1 ;; \ esac \ && mkdir -p /usr/local/node \ - && curl -L -s https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-${ARCHITECTURE}.tar.xz | tar xvfJ - -C /usr/local/node --strip-components 1 \ + && curl -L -s https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${ARCHITECTURE}.tar.xz | tar xvfJ - -C /usr/local/node --strip-components 1 \ && echo 'export PATH=$PATH:/usr/local/node/bin' >> /home/dev/.bashrc -RUN curl -L -s https://github.com/astral-sh/uv/releases/download/0.5.27/uv-$(uname -m)-unknown-linux-gnu.tar.gz | tar xvfz - -C /usr/local/bin --strip-components 1 +RUN curl -L -s https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-$(uname -m)-unknown-linux-gnu.tar.gz | tar xvfz - -C /usr/local/bin --strip-components 1 -RUN gem install fpm -v 1.15.1 \ +RUN gem install fpm -v ${FPM_VERSION} \ && gem cleanup RUN curl -fsSL https://packagecloud.io/varnishcache/varnish60lts/gpgkey | \ @@ -63,7 +69,7 @@ RUN curl -fsSL https://packagecloud.io/varnishcache/varnish60lts/gpgkey | \ && rm -rf /var/lib/apt/lists/* \ && usermod -a -G varnish dev -RUN curl -L -s https://github.com/duckdb/duckdb/releases/download/v1.1.3/duckdb_cli-linux-$(dpkg --print-architecture).zip -o /tmp/duckdb_cli-linux.zip \ +RUN curl -L -s https://github.com/duckdb/duckdb/releases/download/v${DUCKDB_VERSION}/duckdb_cli-linux-$(dpkg --print-architecture).zip -o /tmp/duckdb_cli-linux.zip \ && unzip /tmp/duckdb_cli-linux.zip -d /usr/local/bin \ && rm /tmp/duckdb_cli-linux.zip diff --git a/extras/github/docker/Dockerfile-bookworm b/extras/github/docker/Dockerfile-bookworm index f7fc9d9..18bc396 100644 --- a/extras/github/docker/Dockerfile-bookworm +++ b/extras/github/docker/Dockerfile-bookworm @@ -2,6 +2,8 @@ FROM docker.io/debian:bookworm-20230814 ARG GO_VERSION +ENV FPM_VERSION 1.15.1 + ENV DEBIAN_FRONTEND noninteractive RUN apt update \ @@ -18,5 +20,5 @@ RUN apt update \ RUN curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz | tar xvfz - -C /usr/local -RUN gem install fpm -v 1.15.1 \ +RUN gem install fpm -v ${FPM_VERSION} \ && gem cleanup diff --git a/extras/github/docker/Dockerfile-jammy b/extras/github/docker/Dockerfile-jammy index 18fcff9..31d0a34 100644 --- a/extras/github/docker/Dockerfile-jammy +++ b/extras/github/docker/Dockerfile-jammy @@ -2,6 +2,8 @@ FROM docker.io/ubuntu:jammy-20220428 ARG GO_VERSION +ENV FPM_VERSION 1.15.1 + ENV DEBIAN_FRONTEND noninteractive RUN apt update \ @@ -18,5 +20,5 @@ RUN apt update \ RUN curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz | tar xvfz - -C /usr/local -RUN gem install fpm -v 1.15.1 \ +RUN gem install fpm -v ${FPM_VERSION} \ && gem cleanup diff --git a/extras/github/docker/Dockerfile-noble b/extras/github/docker/Dockerfile-noble index 962af9b..9e677e1 100644 --- a/extras/github/docker/Dockerfile-noble +++ b/extras/github/docker/Dockerfile-noble @@ -2,6 +2,8 @@ FROM docker.io/ubuntu:noble-20240423 ARG GO_VERSION +ENV FPM_VERSION 1.15.1 + ENV DEBIAN_FRONTEND noninteractive RUN apt update \ @@ -18,5 +20,5 @@ RUN apt update \ RUN curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz | tar xvfz - -C /usr/local -RUN gem install fpm -v 1.15.1 \ +RUN gem install fpm -v ${FPM_VERSION} \ && gem cleanup diff --git a/extras/github/docker/Dockerfile-rhel9 b/extras/github/docker/Dockerfile-rhel9 index 5f8b7dd..f288d0d 100644 --- a/extras/github/docker/Dockerfile-rhel9 +++ b/extras/github/docker/Dockerfile-rhel9 @@ -2,6 +2,8 @@ FROM docker.io/rockylinux/rockylinux:9.4.20240523-ubi ARG GO_VERSION +ENV FPM_VERSION 1.15.1 + RUN yum install -y \ curl-minimal \ gcc-c++ \ @@ -21,5 +23,5 @@ RUN ARCHITECTURE=$(uname -m) \ esac \ && curl -L -s curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-${ARCHITECTURE}.tar.gz | tar xvfz - -C /usr/local -RUN gem install fpm -v 1.15.1 \ +RUN gem install fpm -v ${FPM_VERSION} \ && gem cleanup From 2c31d114ac18073893abf18264140cf94e146866 Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Tue, 18 Feb 2025 13:11:12 +0100 Subject: [PATCH 03/10] Added support for 'rhel8' packaging in AMD64 architecture --- .github/workflows/main.yml | 1 + CHANGELOG.md | 1 + Makefile | 35 +++++++++++++++++++++--- extras/github/docker/Dockerfile-rhel8 | 38 +++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 extras/github/docker/Dockerfile-rhel8 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04e68d9..d761d5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,7 @@ jobs: - jammy - bookworm - rhel9 + - rhel8 architecture: - amd64 diff --git a/CHANGELOG.md b/CHANGELOG.md index 796828c..8e738cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - postcss 8.5.1 ➙ 8.5.2 - sass 1.84.0 ➙ 1.85.0 - sass-loader 16.0.4 ➙ 16.0.5 + + Added support for `rhel8` packaging in AMD64 architecture. - 0.5.3-1 (2025-02-13): + Fixed step calculation when scraper is disabled (i.e., no scraping period available). diff --git a/Makefile b/Makefile index 4147e4c..15bc0b2 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ FPM = \ --license 'BSD 2-Clause License' \ --config-files /etc/varnish/varnishmon.yml +# Precompiled DuckDB static bundles work fine for all platforms except RHEL 8 +# due to an old glibc version. In this case, the bundle is built on demand using +# some dirty and suboptimal logic. .PHONY: build build: mrproper @( \ @@ -37,10 +40,33 @@ build: mrproper -s -w"; \ export CGO_ENABLED=1; \ \ + unset CGO_LDFLAGS; \ + unset TAGS; \ + if [ '$(PLATFORM)' = 'rhel8' ]; then \ + if [ ! -f '/tmp/duckdb/build/release/libduckdb_bundle.a' ]; then \ + echo '> Building DuckDB static bundle (https://github.com/marcboeker/go-duckdb/blob/main/.github/workflows/deps.yaml)...'; \ + rm -rf /tmp/duckdb; \ + git clone -b v1.1.3 --depth 1 https://github.com/duckdb/duckdb.git /tmp/duckdb; \ + pushd /tmp/duckdb; \ + CFLAGS='-O3' \ + CXXFLAGS='-O3' \ + BUILD_SHELL=0 \ + BUILD_UNITTESTS=0 \ + DUCKDB_PLATFORM=any \ + ENABLE_EXTENSION_AUTOLOADING=1 \ + ENABLE_EXTENSION_AUTOINSTALL=1 \ + BUILD_EXTENSIONS='json' \ + make bundle-library -j 2; \ + popd; \ + fi; \ + export CGO_LDFLAGS='-lstdc++ -lm -ldl -lduckdb_bundle -L/tmp/duckdb/build/release/'; \ + export TAGS=duckdb_use_static_lib; \ + fi; \ + \ echo '> Building...'; \ for CMD in '$(ROOT)/cmd/'*; do \ echo "- $$CMD (linux $(ARCHITECTURE))"; \ - GOOS=linux GOARCH=$(ARCHITECTURE) go build -trimpath -ldflags "$$LD_FLAGS" -o build/bin/$${CMD##*/} ./cmd/$${CMD##*/}; \ + GOOS=linux GOARCH=$(ARCHITECTURE) go build -tags=$$TAGS -trimpath -ldflags "$$LD_FLAGS" -o build/bin/$${CMD##*/} ./cmd/$${CMD##*/}; \ done; \ ) @@ -134,7 +160,8 @@ dist: build umask $(UMASK); \ \ [ '$(PLATFORM)' = 'noble' -o '$(PLATFORM)' = 'jammy' -o \ - '$(PLATFORM)' = 'bookworm' -o '$(PLATFORM)' = 'rhel9' ] || \ + '$(PLATFORM)' = 'bookworm' -o '$(PLATFORM)' = 'rhel9' -o \ + '$(PLATFORM)' = 'rhel8' ] || \ { echo >&2 'Invalid platform ($(PLATFORM))'; exit 1; }; \ \ [ '$(ENVIRONMENT)' = 'production' ] || \ @@ -179,7 +206,7 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),noble jammy bookworm)) cp '$(ROOT)/extras/packaging/debian/varnishmon.logrotate' '$(ROOT)/build/dist/etc/logrotate.d/varnishmon'; \ cp '$(ROOT)/extras/packaging/debian/varnishmon.service' '$(ROOT)/build/dist/lib/systemd/system/'; \ ) -else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9)) +else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9 rhel8)) @( \ set -e; \ umask $(UMASK); \ @@ -226,7 +253,7 @@ ifeq ($(PLATFORM),$(filter $(PLATFORM),noble jammy bookworm)) --config-files /etc/logrotate.d/varnishmon \ -C '$(ROOT)/build/dist' .; \ ) -else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9)) +else ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel9 rhel8)) @( \ set -e; \ umask $(UMASK); \ diff --git a/extras/github/docker/Dockerfile-rhel8 b/extras/github/docker/Dockerfile-rhel8 new file mode 100644 index 0000000..615d6e4 --- /dev/null +++ b/extras/github/docker/Dockerfile-rhel8 @@ -0,0 +1,38 @@ +FROM docker.io/rockylinux/rockylinux:8.10.20240528-ubi + +ARG GO_VERSION + +ENV FPM_VERSION 1.11.0 + +RUN yum install -y \ + cmake3 \ + curl \ + gcc-c++ \ + git \ + make \ + rpm-build \ + ruby \ + ruby-devel \ + tar \ + && yum clean all + +RUN ARCHITECTURE=$(uname -m) \ + && case $ARCHITECTURE in \ + x86_64) ARCHITECTURE='amd64' ;; \ + aarch64) ARCHITECTURE='arm64' ;; \ + *) echo "unknown architecture: $ARCHITECTURE" && exit 1 ;; \ + esac \ + && curl -L -s curl -L -s https://go.dev/dl/go${GO_VERSION}.linux-${ARCHITECTURE}.tar.gz | tar xvfz - -C /usr/local + +# For RHEL 8 pre-installing 'dotenv' 2.8.1 (required by 'pleaserun') is not +# enough: 'gem' will still try to install a newer version of 'dotenv' when +# installing 'fpm' / 'pleaserun'. That will fail because of the Ruby version. +# This is a -hopefully temporary- dirty workaround. The same happens with 'ffi' +# 1.16.3, required by 'fpm'. +# See: https://github.com/jordansissel/fpm/issues/2048#issuecomment-1972196104. +RUN gem install dotenv -v 2.8.1 \ + && gem install ffi -v 1.16.3 \ + && gem install fpm -v ${FPM_VERSION} --minimal-deps --conservative --force \ + && gem uninstall dotenv -v '>2.8.1' \ + && gem uninstall ffi -v '>1.16.3' \ + && gem cleanup From 0c83120a9382bae81109760ed08bb92ff903d322 Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Tue, 18 Feb 2025 13:30:32 +0100 Subject: [PATCH 04/10] Fixed 2c31d114ac18073893abf18264140cf94e146866: use custom DuckDB static bundle also when running tests --- Makefile | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 15bc0b2..f082169 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,18 @@ ARCHITECTURE := $(shell go env GOARCH) export GO111MODULE +# Precompiled DuckDB static bundles work fine for all platforms except RHEL 8 +# due to an old glibc version. In this case, the bundle is built on demand using +# some dirty and suboptimal logic. +ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel8)) + CGO_LDFLAGS=-lstdc++ -lm -ldl -lduckdb_bundle -L/tmp/duckdb/build/release/ + GO_BUILD_TAGS=duckdb_use_static_lib +else + CGO_LDFLAGS= + GO_BUILD_TAGS= +endif +export CGO_LDFLAGS + FPM = \ fpm -s dir \ --name varnishmon \ @@ -25,11 +37,8 @@ FPM = \ --license 'BSD 2-Clause License' \ --config-files /etc/varnish/varnishmon.yml -# Precompiled DuckDB static bundles work fine for all platforms except RHEL 8 -# due to an old glibc version. In this case, the bundle is built on demand using -# some dirty and suboptimal logic. .PHONY: build -build: mrproper +build: mrproper duckdb-bundle @( \ set -e; \ \ @@ -40,8 +49,18 @@ build: mrproper -s -w"; \ export CGO_ENABLED=1; \ \ - unset CGO_LDFLAGS; \ - unset TAGS; \ + echo '> Building...'; \ + for CMD in '$(ROOT)/cmd/'*; do \ + echo "- $$CMD (linux $(ARCHITECTURE))"; \ + GOOS=linux GOARCH=$(ARCHITECTURE) go build -tags=$(GO_BUILD_TAGS) -trimpath -ldflags "$$LD_FLAGS" -o build/bin/$${CMD##*/} ./cmd/$${CMD##*/}; \ + done; \ + ) + +.PHONY: duckdb-bundle +duckdb-bundle: + @( \ + set -e; \ + \ if [ '$(PLATFORM)' = 'rhel8' ]; then \ if [ ! -f '/tmp/duckdb/build/release/libduckdb_bundle.a' ]; then \ echo '> Building DuckDB static bundle (https://github.com/marcboeker/go-duckdb/blob/main/.github/workflows/deps.yaml)...'; \ @@ -59,15 +78,7 @@ build: mrproper make bundle-library -j 2; \ popd; \ fi; \ - export CGO_LDFLAGS='-lstdc++ -lm -ldl -lduckdb_bundle -L/tmp/duckdb/build/release/'; \ - export TAGS=duckdb_use_static_lib; \ fi; \ - \ - echo '> Building...'; \ - for CMD in '$(ROOT)/cmd/'*; do \ - echo "- $$CMD (linux $(ARCHITECTURE))"; \ - GOOS=linux GOARCH=$(ARCHITECTURE) go build -tags=$$TAGS -trimpath -ldflags "$$LD_FLAGS" -o build/bin/$${CMD##*/} ./cmd/$${CMD##*/}; \ - done; \ ) .PHONY: fmt @@ -111,7 +122,7 @@ TEST_PACKAGES ?= '$(ROOT)/...' TEST_PATTERN ?= . .PHONY: test -test: +test: duckdb-bundle @( \ set -e; \ \ From 8df31131f72f6ce84a0990b8299f51f3e171d70f Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Tue, 18 Feb 2025 13:38:36 +0100 Subject: [PATCH 05/10] Fixed platform check in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f082169..c4e9d5a 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ export GO111MODULE # Precompiled DuckDB static bundles work fine for all platforms except RHEL 8 # due to an old glibc version. In this case, the bundle is built on demand using # some dirty and suboptimal logic. -ifeq ($(PLATFORM),$(filter $(PLATFORM),rhel8)) +ifeq ($(PLATFORM),rhel8) CGO_LDFLAGS=-lstdc++ -lm -ldl -lduckdb_bundle -L/tmp/duckdb/build/release/ GO_BUILD_TAGS=duckdb_use_static_lib else From 3a1da45ce3ad3373e8d6e43f1c979011e119a9ea Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Tue, 18 Feb 2025 16:23:06 +0100 Subject: [PATCH 06/10] Use GitHub Actions cache to cache DuckDB static bundles --- .gitignore | 1 + Makefile | 77 ++++++++++++++++----------- extras/github/build-action/action.yml | 27 ++++++++++ 3 files changed, 73 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index ef556a3..c1968b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.env /coverage.txt /build/ +/duckdb-static-bundle/ /assets/webpack/node_modules/ diff --git a/Makefile b/Makefile index c4e9d5a..6c85c3a 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,13 @@ ARCHITECTURE := $(shell go env GOARCH) export GO111MODULE # Precompiled DuckDB static bundles work fine for all platforms except RHEL 8 -# due to an old glibc version. In this case, the bundle is built on demand using -# some dirty and suboptimal logic. +# due to an outdated glibc version. In this case, the bundle is built on demand +# (see the 'duckdb-static-bundle' target). This is a costly operation, so GitHub +# Actions caching is used to populate 'duckdb-static-bundle/libduckdb_bundle.a' +# and avoid rebuilding the bundle on every run (see +# 'extras/github/build-action/action.yml'). ifeq ($(PLATFORM),rhel8) - CGO_LDFLAGS=-lstdc++ -lm -ldl -lduckdb_bundle -L/tmp/duckdb/build/release/ + CGO_LDFLAGS=-lstdc++ -lm -ldl -lduckdb_bundle -L$(ROOT)/duckdb-static-bundle/ GO_BUILD_TAGS=duckdb_use_static_lib else CGO_LDFLAGS= @@ -38,7 +41,7 @@ FPM = \ --config-files /etc/varnish/varnishmon.yml .PHONY: build -build: mrproper duckdb-bundle +build: mrproper duckdb-static-bundle @( \ set -e; \ \ @@ -52,35 +55,15 @@ build: mrproper duckdb-bundle echo '> Building...'; \ for CMD in '$(ROOT)/cmd/'*; do \ echo "- $$CMD (linux $(ARCHITECTURE))"; \ - GOOS=linux GOARCH=$(ARCHITECTURE) go build -tags=$(GO_BUILD_TAGS) -trimpath -ldflags "$$LD_FLAGS" -o build/bin/$${CMD##*/} ./cmd/$${CMD##*/}; \ + GOOS=linux GOARCH=$(ARCHITECTURE) go build \ + -tags=$(GO_BUILD_TAGS) \ + -trimpath \ + -ldflags "$$LD_FLAGS" \ + -o build/bin/$${CMD##*/} \ + ./cmd/$${CMD##*/}; \ done; \ ) -.PHONY: duckdb-bundle -duckdb-bundle: - @( \ - set -e; \ - \ - if [ '$(PLATFORM)' = 'rhel8' ]; then \ - if [ ! -f '/tmp/duckdb/build/release/libduckdb_bundle.a' ]; then \ - echo '> Building DuckDB static bundle (https://github.com/marcboeker/go-duckdb/blob/main/.github/workflows/deps.yaml)...'; \ - rm -rf /tmp/duckdb; \ - git clone -b v1.1.3 --depth 1 https://github.com/duckdb/duckdb.git /tmp/duckdb; \ - pushd /tmp/duckdb; \ - CFLAGS='-O3' \ - CXXFLAGS='-O3' \ - BUILD_SHELL=0 \ - BUILD_UNITTESTS=0 \ - DUCKDB_PLATFORM=any \ - ENABLE_EXTENSION_AUTOLOADING=1 \ - ENABLE_EXTENSION_AUTOINSTALL=1 \ - BUILD_EXTENSIONS='json' \ - make bundle-library -j 2; \ - popd; \ - fi; \ - fi; \ - ) - .PHONY: fmt fmt: @( \ @@ -122,7 +105,7 @@ TEST_PACKAGES ?= '$(ROOT)/...' TEST_PATTERN ?= . .PHONY: test -test: duckdb-bundle +test: duckdb-static-bundle @( \ set -e; \ \ @@ -134,6 +117,7 @@ test: duckdb-bundle -coverprofile=$(ROOT)/coverage.txt \ -covermode=atomic \ -run '$(TEST_PATTERN)' \ + -tags=$(GO_BUILD_TAGS) \ -timeout=2m; \ ) @@ -303,10 +287,39 @@ webpack-build: npm run build; \ ) +# Beware of the hardcoded DuckDB version in the 'git clone' command. See: +# https://github.com/marcboeker/go-duckdb/blob/main/.github/workflows/deps.yaml. +.PHONY: duckdb-static-bundle +duckdb-static-bundle: + @( \ + set -e; \ + \ + if [ ! -f '$(ROOT)/duckdb-static-bundle/libduckdb_bundle.a' ]; then \ + if [ '$(PLATFORM)' = 'rhel8' ]; then \ + echo '> Building DuckDB static bundle for RHEL8...'; \ + rm -rf /tmp/duckdb; \ + git clone -b v1.1.3 --depth 1 https://github.com/duckdb/duckdb.git /tmp/duckdb; \ + cd /tmp/duckdb; \ + CFLAGS='-O3' \ + CXXFLAGS='-O3' \ + BUILD_SHELL=0 \ + BUILD_UNITTESTS=0 \ + DUCKDB_PLATFORM=any \ + ENABLE_EXTENSION_AUTOLOADING=1 \ + ENABLE_EXTENSION_AUTOINSTALL=1 \ + BUILD_EXTENSIONS='json' \ + make bundle-library -j 2; \ + \ + mkdir -p '$(ROOT)/duckdb-static-bundle'; \ + cp /tmp/duckdb/build/release/libduckdb_bundle.a '$(ROOT)/duckdb-static-bundle'; \ + fi; \ + fi; \ + ) + .PHONY: mrproper mrproper: @( \ echo '> Cleaning up...'; \ rm -rf '$(ROOT)/build'; \ - git clean -f -x -d -e .env -e assets/webpack/node_modules -e varnishmon.db $(ROOT); \ + git clean -f -x -d -e .env -e assets/webpack/node_modules -e duckdb-static-bundle -e varnishmon.db $(ROOT); \ ) diff --git a/extras/github/build-action/action.yml b/extras/github/build-action/action.yml index 4b2bfa9..d797df0 100644 --- a/extras/github/build-action/action.yml +++ b/extras/github/build-action/action.yml @@ -19,7 +19,17 @@ runs: - uses: docker/setup-buildx-action@v3 + # Try to populate 'duckdb-static-bundle/libduckdb_bundle.a' from cache. This + # will only succeed for platforms + architectures building their own DuckDB + # static bundle (currently, only RHEL 8 + AMD64). + - uses: actions/cache/restore@v4 + id: duckdb-static-bundle-restore + with: + path: duckdb-static-bundle/libduckdb_bundle.a + key: ${{ inputs.platform }}-${{ inputs.architecture }}-${{ hashFiles('Makefile') }}-duckdb-static-bundle + - shell: bash + id: build run: | IMAGE=$( \ docker build \ @@ -41,6 +51,23 @@ runs: export PLATFORM=${{ inputs.platform }}; \ make lint vet test package' + if [ -f duckdb-static-bundle/libduckdb_bundle.a ]; then + echo 'duckdb-static-bundle-exists=true' >> $GITHUB_OUTPUT + else + echo 'duckdb-static-bundle-exists=false' >> $GITHUB_OUTPUT + fi + + # Save 'duckdb-static-bundle/libduckdb_bundle.a' to cache if it was not + # restored from cache. The file won't exist for platforms + architectures + # that don't build their own DuckDB static bundle. + - uses: actions/cache/save@v4 + if: | + steps.duckdb-static-bundle-restore.cache-hit != 'true' && + steps.build.outputs.duckdb-static-bundle-exists == 'true' + with: + path: duckdb-static-bundle/libduckdb_bundle.a + key: ${{ steps.duckdb-static-bundle-restore.outputs.cache-primary-key }} + - uses: actions/upload-artifact@v4 with: name: ${{ inputs.platform }}-${{ inputs.architecture }}-artifacts From e55fa204403890886c2a418f65e145c5a3fd3ef5 Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Tue, 18 Feb 2025 17:04:57 +0100 Subject: [PATCH 07/10] Fixed typo in extras/github/build-action/action.yml --- extras/github/build-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/github/build-action/action.yml b/extras/github/build-action/action.yml index d797df0..7e60fa1 100644 --- a/extras/github/build-action/action.yml +++ b/extras/github/build-action/action.yml @@ -62,7 +62,7 @@ runs: # that don't build their own DuckDB static bundle. - uses: actions/cache/save@v4 if: | - steps.duckdb-static-bundle-restore.cache-hit != 'true' && + steps.duckdb-static-bundle-restore.outputs.cache-hit != 'true' && steps.build.outputs.duckdb-static-bundle-exists == 'true' with: path: duckdb-static-bundle/libduckdb_bundle.a From ef9d8cd8ce15cb01c76b86ee5ec188a4a9193f6d Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Tue, 18 Feb 2025 17:15:15 +0100 Subject: [PATCH 08/10] Revert "Added new dirty hack to mitigate issues with ARM64 builds with GitHub Actions" This reverts commit 9337c0781236b3c2a0c5397e1068d3bfd02b65bf. --- .github/workflows/main.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d761d5c..0bb18de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,36 +58,6 @@ jobs: - uses: actions/checkout@v4 - uses: ./extras/github/build-action - id: attempt1 - continue-on-error: true - with: - platform: ${{ matrix.platform }} - architecture: ${{ matrix.architecture }} - go-version: ${{ env.GO_VERSION }} - - # XXX: for ARM64 builds, jobs occasionally fail with an error suggesting - # that Docker is not ready. This is a workaround to retry the build once. - # >Run ./extras/github/build-action - # >Run docker/setup-buildx-action@v3 - # >Docker info - # >Buildx version - # >Inspecting default docker context - # >Creating a new builder instance - # Error: ERROR: failed to initialize builder builder-7cfe3cdd-acf8-4116-a011-40173ca3d469 - # (builder-7cfe3cdd-acf8-4116-a011-40173ca3d4690): Cannot connect to the Docker daemon at - # unix:///var/run/docker.sock. Is the docker daemon running? - - uses: ./extras/github/build-action - if: steps.attempt1.outcome == 'failure' - id: attempt2 - continue-on-error: true - with: - platform: ${{ matrix.platform }} - architecture: ${{ matrix.architecture }} - go-version: ${{ env.GO_VERSION }} - - # XXX: same as above, but for the second retry. - - uses: ./extras/github/build-action - if: steps.attempt2.outcome == 'failure' with: platform: ${{ matrix.platform }} architecture: ${{ matrix.architecture }} From 8113f21e9115785c7abac1ab3f221aeb1c76b6df Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Wed, 19 Feb 2025 15:15:11 +0100 Subject: [PATCH 09/10] Updated dependencies: client_golang, fasthttp, plotly.js-dist & webpack --- CHANGELOG.md | 4 + assets/webpack/package-lock.json | 172 ++++++++++++------------------- assets/webpack/package.json | 12 +-- go.mod | 14 +-- go.sum | 14 +++ 5 files changed, 96 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e738cb..e6e01cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,16 @@ * DuckDB 1.1.3 ➙ 1.2.0 * uv 0.5.27 ➙ 0.6.0 * Go + - client_golang 1.20.5 ➙ 1.21.0 - cobra 1.8.1 ➙ 1.9.1 + - fasthttp 1.58.0 ➙ 1.59.0 * Node.js 22.13.1 ➙ 22.14.0 - eslint 9.20.0 ➙ 9.20.1 + - plotly.js-dist 3.0.0 ➙ 3.0.1 - postcss 8.5.1 ➙ 8.5.2 - sass 1.84.0 ➙ 1.85.0 - sass-loader 16.0.4 ➙ 16.0.5 + - webpack 5.97.1 ➙ 5.98.0 + Added support for `rhel8` packaging in AMD64 architecture. - 0.5.3-1 (2025-02-13): diff --git a/assets/webpack/package-lock.json b/assets/webpack/package-lock.json index 7f9ae64..f576c43 100644 --- a/assets/webpack/package-lock.json +++ b/assets/webpack/package-lock.json @@ -17,20 +17,20 @@ "d3": "^7.9.0", "d3-collection": "^1.0.7", "elementary-circuits-directed-graph": "^1.3.1", - "eslint": "^9.19.0", + "eslint": "^9.20.1", "eslint-webpack-plugin": "^4.2.0", "file-loader": "^6.2.0", "flatpickr": "^4.6.13", "html-loader": "^5.1.0", "html-webpack-plugin": "^5.6.3", "mini-css-extract-plugin": "^2.9.2", - "plotly.js-dist": "^3.0.0", - "postcss": "^8.5.1", + "plotly.js-dist": "^3.0.1", + "postcss": "^8.5.3", "postcss-loader": "^8.1.1", - "sass": "^1.83.4", - "sass-loader": "^16.0.4", + "sass": "^1.85.0", + "sass-loader": "^16.0.5", "terser-webpack-plugin": "^5.3.11", - "webpack": "^5.97.1", + "webpack": "^5.98.0", "webpack-cli": "^6.0.1" } }, @@ -127,9 +127,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", - "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", + "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -184,13 +184,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", - "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.6.tgz", + "integrity": "sha512-+0TjwR1eAUdZtvv/ir1mGX+v0tUoR3VEPB8Up0LLJC+whRW0GgBBtpbOkg/a/U4Dxa6l5a3l9AJ1aWIQVyoWJA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.10.0", + "@eslint/core": "^0.11.0", "levn": "^0.4.1" }, "engines": { @@ -796,9 +796,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.0.tgz", - "integrity": "sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==", + "version": "22.13.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.4.tgz", + "integrity": "sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg==", "dev": true, "license": "MIT", "dependencies": { @@ -1335,9 +1335,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001696", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", - "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", + "version": "1.0.30001700", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001700.tgz", + "integrity": "sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ==", "dev": true, "funding": [ { @@ -1493,13 +1493,13 @@ "license": "MIT" }, "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, "license": "MIT", "engines": { - "node": ">=14" + "node": ">= 10" } }, "node_modules/concat-map": { @@ -2005,16 +2005,6 @@ "node": ">=12" } }, - "node_modules/d3-dsv/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, "node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -2425,9 +2415,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.90", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", - "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", + "version": "1.5.102", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.102.tgz", + "integrity": "sha512-eHhqaja8tE/FNpIiBrvBjFV/SSKpyWHLvxuR9dPTdo+3V9ppdLmFB7ZZQ98qNovcngPLYIz0oOBF9P0FfZef5Q==", "dev": true, "license": "ISC" }, @@ -2452,9 +2442,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", - "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", "dev": true, "license": "MIT", "dependencies": { @@ -2656,19 +2646,6 @@ "webpack": "^5.0.0" } }, - "node_modules/eslint/node_modules/@eslint/core": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", - "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "node_modules/espree": { "version": "10.3.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", @@ -2906,9 +2883,9 @@ "license": "MIT" }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, @@ -3094,6 +3071,16 @@ "node": "^14.13.1 || >=16.0.0" } }, + "node_modules/html-minifier-terser/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/html-webpack-plugin": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.3.tgz", @@ -4192,16 +4179,16 @@ } }, "node_modules/plotly.js-dist": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/plotly.js-dist/-/plotly.js-dist-3.0.0.tgz", - "integrity": "sha512-CNr8bcGVOOjCqMD1t4KWy+7ikJOuxCK1nR0TRAmlKwz6tu+1oM0JlWgmRlRYlSgpqLJyEIvqNaO/Ajr268fmPw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/plotly.js-dist/-/plotly.js-dist-3.0.1.tgz", + "integrity": "sha512-/LvKEGxWime7KPzO6nlnfNyTt/pHn4Ctlgj98RUJyjUIu3IHowOqSu+tRq3B/xQ6GZWj5uDz2hS+eEBsgg/xHw==", "dev": true, "license": "MIT" }, "node_modules/postcss": { - "version": "8.5.2", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.2.tgz", - "integrity": "sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "dev": true, "funding": [ { @@ -4770,9 +4757,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.0.0.tgz", - "integrity": "sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", + "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "dev": true, "license": "MIT", "dependencies": { @@ -4879,9 +4866,9 @@ } }, "node_modules/readdirp": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.1.tgz", - "integrity": "sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", "engines": { @@ -5169,9 +5156,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "dev": true, "license": "ISC", "bin": { @@ -5374,16 +5361,6 @@ "url": "https://opencollective.com/svgo" } }, - "node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, "node_modules/svgo/node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -5458,9 +5435,9 @@ } }, "node_modules/terser": { - "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", + "version": "5.39.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz", + "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -5659,9 +5636,9 @@ } }, "node_modules/webpack": { - "version": "5.97.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", - "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", + "version": "5.98.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz", + "integrity": "sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==", "dev": true, "license": "MIT", "dependencies": { @@ -5683,9 +5660,9 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", + "schema-utils": "^4.3.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", + "terser-webpack-plugin": "^5.3.11", "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, @@ -5807,25 +5784,6 @@ "node": ">=4.0" } }, - "node_modules/webpack/node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/assets/webpack/package.json b/assets/webpack/package.json index e191e94..40d3b2d 100644 --- a/assets/webpack/package.json +++ b/assets/webpack/package.json @@ -19,20 +19,20 @@ "d3": "^7.9.0", "d3-collection": "^1.0.7", "elementary-circuits-directed-graph": "^1.3.1", - "eslint": "^9.19.0", + "eslint": "^9.20.1", "eslint-webpack-plugin": "^4.2.0", "file-loader": "^6.2.0", "flatpickr": "^4.6.13", "html-loader": "^5.1.0", "html-webpack-plugin": "^5.6.3", "mini-css-extract-plugin": "^2.9.2", - "plotly.js-dist": "^3.0.0", - "postcss": "^8.5.1", + "plotly.js-dist": "^3.0.1", + "postcss": "^8.5.3", "postcss-loader": "^8.1.1", - "sass": "^1.83.4", - "sass-loader": "^16.0.4", + "sass": "^1.85.0", + "sass-loader": "^16.0.5", "terser-webpack-plugin": "^5.3.11", - "webpack": "^5.97.1", + "webpack": "^5.98.0", "webpack-cli": "^6.0.1" } } diff --git a/go.mod b/go.mod index bce0045..8693daf 100644 --- a/go.mod +++ b/go.mod @@ -8,12 +8,12 @@ require ( github.com/fasthttp/router v1.5.4 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/marcboeker/go-duckdb v1.8.4 - github.com/prometheus/client_golang v1.20.5 + github.com/prometheus/client_golang v1.21.0 github.com/rs/zerolog v1.33.0 github.com/spf13/cobra v1.9.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 - github.com/valyala/fasthttp v1.58.0 + github.com/valyala/fasthttp v1.59.0 github.com/valyala/tcplisten v1.0.0 gitlab.com/stone.code/assert v1.1.4 ) @@ -29,14 +29,14 @@ require ( github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/goccy/go-json v0.10.5 // indirect - github.com/google/flatbuffers v25.1.24+incompatible // indirect + github.com/google/flatbuffers v25.2.10+incompatible // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jinzhu/copier v0.4.0 // indirect - github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-colorable v0.1.14 // indirect @@ -64,15 +64,15 @@ require ( github.com/vektra/mockery/v2 v2.52.1 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect + golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect golang.org/x/mod v0.23.0 // indirect golang.org/x/sync v0.11.0 // indirect golang.org/x/sys v0.30.0 // indirect golang.org/x/term v0.29.0 // indirect golang.org/x/text v0.22.0 // indirect - golang.org/x/tools v0.29.0 // indirect + golang.org/x/tools v0.30.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - google.golang.org/protobuf v1.36.4 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7f22f78..56c8d5a 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,8 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/flatbuffers v25.1.24+incompatible h1:4wPqL3K7GzBd1CwyhSd3usxLKOaJN/AC6puCca6Jm7o= github.com/google/flatbuffers v25.1.24+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= +github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -51,6 +53,8 @@ github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -89,6 +93,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA= +github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= @@ -130,6 +136,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.58.0 h1:GGB2dWxSbEprU9j0iMJHgdKYJVDyjrOwF9RE59PbRuE= github.com/valyala/fasthttp v1.58.0/go.mod h1:SYXvHHaFp7QZHGKSHmoMipInhrI5StHrhDTYVEjK/Kw= +github.com/valyala/fasthttp v1.59.0 h1:Qu0qYHfXvPk1mSLNqcFtEk6DpxgA26hy6bmydotDpRI= +github.com/valyala/fasthttp v1.59.0/go.mod h1:GTxNb9Bc6r2a9D0TWNSPwDz78UxnTGBViY3xZNEqyYU= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vektra/mockery/v2 v2.52.1 h1:ejpWJSsInVNsFUvaAX4szecrpYxErN+Ny5X+0RXBP+s= @@ -146,6 +154,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa h1:t2QcU6V556bFjYgu4L6C+6VrCPyJZ+eyRsABUPs1mz4= +golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk= golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= @@ -161,12 +171,16 @@ golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 22e0fc9666f8e0de7b2699132ca773c7ce88c0b6 Mon Sep 17 00:00:00 2001 From: Carlos Abalde Date: Wed, 19 Feb 2025 15:17:40 +0100 Subject: [PATCH 10/10] Release version 0.5.4-1 --- CHANGELOG.md | 2 +- Makefile | 2 +- assets/static/app.js | 82 ++++++++++++++++++++++---------------------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6e01cf..8af2169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -- ? +- 0.5.4-1 (2025-02-19): + Updated dependencies. * DuckDB 1.1.3 ➙ 1.2.0 * uv 0.5.27 ➙ 0.6.0 diff --git a/Makefile b/Makefile index 6c85c3a..08bab0d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL := /bin/bash ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) UMASK := 022 -VERSION := 0.5.3 +VERSION := 0.5.4 ITERATION := 1 REVISION := $(shell cd '$(ROOT)' && git rev-parse --short HEAD) ENVIRONMENT ?= production diff --git a/assets/static/app.js b/assets/static/app.js index 4cbbde6..b23d724 100644 --- a/assets/static/app.js +++ b/assets/static/app.js @@ -1,88 +1,70 @@ -(()=>{var t={170:(t,e,r)=>{"use strict";r.r(e),r.d(e,{afterMain:()=>w,afterRead:()=>x,afterWrite:()=>A,applyStyles:()=>P,arrow:()=>J,auto:()=>s,basePlacements:()=>l,beforeMain:()=>_,beforeRead:()=>y,beforeWrite:()=>T,bottom:()=>i,clippingParents:()=>h,computeStyles:()=>rt,createPopper:()=>Pt,createPopperBase:()=>Lt,createPopperLite:()=>zt,detectOverflow:()=>vt,end:()=>u,eventListeners:()=>it,flip:()=>xt,hide:()=>wt,left:()=>o,main:()=>b,modifierPhases:()=>M,offset:()=>Tt,placements:()=>g,popper:()=>p,popperGenerator:()=>It,popperOffsets:()=>kt,preventOverflow:()=>At,read:()=>v,reference:()=>d,right:()=>a,start:()=>c,top:()=>n,variationPlacements:()=>m,viewport:()=>f,write:()=>k});var n="top",i="bottom",a="right",o="left",s="auto",l=[n,i,a,o],c="start",u="end",h="clippingParents",f="viewport",p="popper",d="reference",m=l.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),g=[].concat(l,[s]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",v="read",x="afterRead",_="beforeMain",b="main",w="afterMain",T="beforeWrite",k="write",A="afterWrite",M=[y,v,x,_,b,w,T,k,A];function S(t){return t?(t.nodeName||"").toLowerCase():null}function E(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return t instanceof E(t).Element||t instanceof Element}function I(t){return t instanceof E(t).HTMLElement||t instanceof HTMLElement}function L(t){return"undefined"!=typeof ShadowRoot&&(t instanceof E(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},i=e.elements[t];I(i)&&S(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(t){var e=n[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],i=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:r[t]).reduce((function(t,e){return t[e]="",t}),{});I(n)&&S(n)&&(Object.assign(n.style,a),Object.keys(i).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function z(t){return t.split("-")[0]}var D=Math.max,O=Math.min,R=Math.round;function F(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function j(){return!/^((?!chrome|android).)*safari/i.test(F())}function B(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&I(t)&&(i=t.offsetWidth>0&&R(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&R(n.height)/t.offsetHeight||1);var o=(C(t)?E(t):window).visualViewport,s=!j()&&r,l=(n.left+(s&&o?o.offsetLeft:0))/i,c=(n.top+(s&&o?o.offsetTop:0))/a,u=n.width/i,h=n.height/a;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function N(t){var e=B(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function U(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&L(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function V(t){return E(t).getComputedStyle(t)}function q(t){return["table","td","th"].indexOf(S(t))>=0}function H(t){return((C(t)?t.ownerDocument:t.document)||window.document).documentElement}function G(t){return"html"===S(t)?t:t.assignedSlot||t.parentNode||(L(t)?t.host:null)||H(t)}function Z(t){return I(t)&&"fixed"!==V(t).position?t.offsetParent:null}function W(t){for(var e=E(t),r=Z(t);r&&q(r)&&"static"===V(r).position;)r=Z(r);return r&&("html"===S(r)||"body"===S(r)&&"static"===V(r).position)?e:r||function(t){var e=/firefox/i.test(F());if(/Trident/i.test(F())&&I(t)&&"fixed"===V(t).position)return null;var r=G(t);for(L(r)&&(r=r.host);I(r)&&["html","body"].indexOf(S(r))<0;){var n=V(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(t)||e}function Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,e,r){return D(t,O(e,r))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function K(t,e){return e.reduce((function(e,r){return e[r]=t,e}),{})}const J={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,s=t.name,c=t.options,u=r.elements.arrow,h=r.modifiersData.popperOffsets,f=z(r.placement),p=Y(f),d=[o,a].indexOf(f)>=0?"height":"width";if(u&&h){var m=function(t,e){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:K(t,l))}(c.padding,r),g=N(u),y="y"===p?n:o,v="y"===p?i:a,x=r.rects.reference[d]+r.rects.reference[p]-h[p]-r.rects.popper[d],_=h[p]-r.rects.reference[p],b=W(u),w=b?"y"===p?b.clientHeight||0:b.clientWidth||0:0,T=x/2-_/2,k=m[y],A=w-g[d]-m[v],M=w/2-g[d]/2+T,S=X(k,M,A),E=p;r.modifiersData[s]=((e={})[E]=S,e.centerOffset=S-M,e)}},effect:function(t){var e=t.state,r=t.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&U(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,r=t.popper,s=t.popperRect,l=t.placement,c=t.variation,h=t.offsets,f=t.position,p=t.gpuAcceleration,d=t.adaptive,m=t.roundOffsets,g=t.isFixed,y=h.x,v=void 0===y?0:y,x=h.y,_=void 0===x?0:x,b="function"==typeof m?m({x:v,y:_}):{x:v,y:_};v=b.x,_=b.y;var w=h.hasOwnProperty("x"),T=h.hasOwnProperty("y"),k=o,A=n,M=window;if(d){var S=W(r),C="clientHeight",I="clientWidth";if(S===E(r)&&"static"!==V(S=H(r)).position&&"absolute"===f&&(C="scrollHeight",I="scrollWidth"),l===n||(l===o||l===a)&&c===u)A=i,_-=(g&&S===M&&M.visualViewport?M.visualViewport.height:S[C])-s.height,_*=p?1:-1;if(l===o||(l===n||l===i)&&c===u)k=a,v-=(g&&S===M&&M.visualViewport?M.visualViewport.width:S[I])-s.width,v*=p?1:-1}var L,P=Object.assign({position:f},d&&tt),z=!0===m?function(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:R(r*i)/i||0,y:R(n*i)/i||0}}({x:v,y:_},E(r)):{x:v,y:_};return v=z.x,_=z.y,p?Object.assign({},P,((L={})[A]=T?"0":"",L[k]=w?"0":"",L.transform=(M.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",L)):Object.assign({},P,((e={})[A]=T?_+"px":"",e[k]=w?v+"px":"",e.transform="",e))}const rt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=void 0===n||n,a=r.adaptive,o=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:z(e.placement),variation:Q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var nt={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=void 0===i||i,o=n.resize,s=void 0===o||o,l=E(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&c.forEach((function(t){t.addEventListener("scroll",r.update,nt)})),s&&l.addEventListener("resize",r.update,nt),function(){a&&c.forEach((function(t){t.removeEventListener("scroll",r.update,nt)})),s&&l.removeEventListener("resize",r.update,nt)}},data:{}};var at={left:"right",right:"left",bottom:"top",top:"bottom"};function ot(t){return t.replace(/left|right|bottom|top/g,(function(t){return at[t]}))}var st={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,(function(t){return st[t]}))}function ct(t){var e=E(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return B(H(t)).left+ct(t).scrollLeft}function ht(t){var e=V(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function ft(t){return["html","body","#document"].indexOf(S(t))>=0?t.ownerDocument.body:I(t)&&ht(t)?t:ft(G(t))}function pt(t,e){var r;void 0===e&&(e=[]);var n=ft(t),i=n===(null==(r=t.ownerDocument)?void 0:r.body),a=E(n),o=i?[a].concat(a.visualViewport||[],ht(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(pt(G(o)))}function dt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,r){return e===f?dt(function(t,e){var r=E(t),n=H(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var c=j();(c||!c&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+ut(t),y:l}}(t,r)):C(e)?function(t,e){var r=B(t,!1,"fixed"===e);return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}(e,r):dt(function(t){var e,r=H(t),n=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,a=D(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=D(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+ut(t),l=-n.scrollTop;return"rtl"===V(i||r).direction&&(s+=D(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(H(t)))}function gt(t,e,r,n){var i="clippingParents"===e?function(t){var e=pt(G(t)),r=["absolute","fixed"].indexOf(V(t).position)>=0&&I(t)?W(t):t;return C(r)?e.filter((function(t){return C(t)&&U(t,r)&&"body"!==S(t)})):[]}(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce((function(e,r){var i=mt(t,r,n);return e.top=D(i.top,e.top),e.right=O(i.right,e.right),e.bottom=O(i.bottom,e.bottom),e.left=D(i.left,e.left),e}),mt(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function yt(t){var e,r=t.reference,s=t.element,l=t.placement,h=l?z(l):null,f=l?Q(l):null,p=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2;switch(h){case n:e={x:p,y:r.y-s.height};break;case i:e={x:p,y:r.y+r.height};break;case a:e={x:r.x+r.width,y:d};break;case o:e={x:r.x-s.width,y:d};break;default:e={x:r.x,y:r.y}}var m=h?Y(h):null;if(null!=m){var g="y"===m?"height":"width";switch(f){case c:e[m]=e[m]-(r[g]/2-s[g]/2);break;case u:e[m]=e[m]+(r[g]/2-s[g]/2)}}return e}function vt(t,e){void 0===e&&(e={});var r=e,o=r.placement,s=void 0===o?t.placement:o,c=r.strategy,u=void 0===c?t.strategy:c,m=r.boundary,g=void 0===m?h:m,y=r.rootBoundary,v=void 0===y?f:y,x=r.elementContext,_=void 0===x?p:x,b=r.altBoundary,w=void 0!==b&&b,T=r.padding,k=void 0===T?0:T,A=$("number"!=typeof k?k:K(k,l)),M=_===p?d:p,S=t.rects.popper,E=t.elements[w?M:_],I=gt(C(E)?E:E.contextElement||H(t.elements.popper),g,v,u),L=B(t.elements.reference),P=yt({reference:L,element:S,strategy:"absolute",placement:s}),z=dt(Object.assign({},S,P)),D=_===p?z:L,O={top:I.top-D.top+A.top,bottom:D.bottom-I.bottom+A.bottom,left:I.left-D.left+A.left,right:D.right-I.right+A.right},R=t.modifiersData.offset;if(_===p&&R){var F=R[s];Object.keys(O).forEach((function(t){var e=[a,i].indexOf(t)>=0?1:-1,r=[n,i].indexOf(t)>=0?"y":"x";O[t]+=F[r]*e}))}return O}const xt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var h=r.mainAxis,f=void 0===h||h,p=r.altAxis,d=void 0===p||p,y=r.fallbackPlacements,v=r.padding,x=r.boundary,_=r.rootBoundary,b=r.altBoundary,w=r.flipVariations,T=void 0===w||w,k=r.allowedAutoPlacements,A=e.options.placement,M=z(A),S=y||(M===A||!T?[ot(A)]:function(t){if(z(t)===s)return[];var e=ot(t);return[lt(t),e,lt(e)]}(A)),E=[A].concat(S).reduce((function(t,r){return t.concat(z(r)===s?function(t,e){void 0===e&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=void 0===c?g:c,h=Q(n),f=h?s?m:m.filter((function(t){return Q(t)===h})):l,p=f.filter((function(t){return u.indexOf(t)>=0}));0===p.length&&(p=f);var d=p.reduce((function(e,r){return e[r]=vt(t,{placement:r,boundary:i,rootBoundary:a,padding:o})[z(r)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}(e,{placement:r,boundary:x,rootBoundary:_,padding:v,flipVariations:T,allowedAutoPlacements:k}):r)}),[]),C=e.rects.reference,I=e.rects.popper,L=new Map,P=!0,D=E[0],O=0;O=0,N=B?"width":"height",U=vt(e,{placement:R,boundary:x,rootBoundary:_,altBoundary:b,padding:v}),V=B?j?a:o:j?i:n;C[N]>I[N]&&(V=ot(V));var q=ot(V),H=[];if(f&&H.push(U[F]<=0),d&&H.push(U[V]<=0,U[q]<=0),H.every((function(t){return t}))){D=R,P=!1;break}L.set(R,H)}if(P)for(var G=function(t){var e=E.find((function(e){var r=L.get(e);if(r)return r.slice(0,t).every((function(t){return t}))}));if(e)return D=e,"break"},Z=T?3:1;Z>0;Z--){if("break"===G(Z))break}e.placement!==D&&(e.modifiersData[u]._skip=!0,e.placement=D,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _t(t,e,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function bt(t){return[n,a,i,o].some((function(e){return t[e]>=0}))}const wt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=vt(e,{elementContext:"reference"}),s=vt(e,{altBoundary:!0}),l=_t(o,n),c=_t(s,i,a),u=bt(l),h=bt(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}};const Tt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,r=t.options,i=t.name,s=r.offset,l=void 0===s?[0,0]:s,c=g.reduce((function(t,r){return t[r]=function(t,e,r){var i=z(t),s=[o,n].indexOf(i)>=0?-1:1,l="function"==typeof r?r(Object.assign({},e,{placement:t})):r,c=l[0],u=l[1];return c=c||0,u=(u||0)*s,[o,a].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(r,e.rects,l),t}),{}),u=c[e.placement],h=u.x,f=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=h,e.modifiersData.popperOffsets.y+=f),e.modifiersData[i]=c}};const kt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,r=t.name;e.modifiersData[r]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const At={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,s=t.name,l=r.mainAxis,u=void 0===l||l,h=r.altAxis,f=void 0!==h&&h,p=r.boundary,d=r.rootBoundary,m=r.altBoundary,g=r.padding,y=r.tether,v=void 0===y||y,x=r.tetherOffset,_=void 0===x?0:x,b=vt(e,{boundary:p,rootBoundary:d,padding:g,altBoundary:m}),w=z(e.placement),T=Q(e.placement),k=!T,A=Y(w),M="x"===A?"y":"x",S=e.modifiersData.popperOffsets,E=e.rects.reference,C=e.rects.popper,I="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,L="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(S){if(u){var F,j="y"===A?n:o,B="y"===A?i:a,U="y"===A?"height":"width",V=S[A],q=V+b[j],H=V-b[B],G=v?-C[U]/2:0,Z=T===c?E[U]:C[U],$=T===c?-C[U]:-E[U],K=e.elements.arrow,J=v&&K?N(K):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[j],rt=tt[B],nt=X(0,E[U],J[U]),it=k?E[U]/2-G-nt-et-L.mainAxis:Z-nt-et-L.mainAxis,at=k?-E[U]/2+G+nt+rt+L.mainAxis:$+nt+rt+L.mainAxis,ot=e.elements.arrow&&W(e.elements.arrow),st=ot?"y"===A?ot.clientTop||0:ot.clientLeft||0:0,lt=null!=(F=null==P?void 0:P[A])?F:0,ct=V+at-lt,ut=X(v?O(q,V+it-lt-st):q,V,v?D(H,ct):H);S[A]=ut,R[A]=ut-V}if(f){var ht,ft="x"===A?n:o,pt="x"===A?i:a,dt=S[M],mt="y"===M?"height":"width",gt=dt+b[ft],yt=dt-b[pt],xt=-1!==[n,o].indexOf(w),_t=null!=(ht=null==P?void 0:P[M])?ht:0,bt=xt?gt:dt-E[mt]-C[mt]-_t+L.altAxis,wt=xt?dt+E[mt]+C[mt]-_t-L.altAxis:yt,Tt=v&&xt?function(t,e,r){var n=X(t,e,r);return n>r?r:n}(bt,dt,wt):X(v?bt:gt,dt,v?wt:yt);S[M]=Tt,R[M]=Tt-dt}e.modifiersData[s]=R}},requiresIfExists:["offset"]};function Mt(t,e,r){void 0===r&&(r=!1);var n,i,a=I(e),o=I(e)&&function(t){var e=t.getBoundingClientRect(),r=R(e.width)/t.offsetWidth||1,n=R(e.height)/t.offsetHeight||1;return 1!==r||1!==n}(e),s=H(e),l=B(t,o,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==S(e)||ht(s))&&(c=(n=e)!==E(n)&&I(n)?{scrollLeft:(i=n).scrollLeft,scrollTop:i.scrollTop}:ct(n)),I(e)?((u=B(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=ut(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function St(t){var e=new Map,r=new Set,n=[];function i(t){r.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!r.has(t)){var n=e.get(t);n&&i(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){r.has(t.name)||i(t)})),n}var Et={placement:"bottom",modifiers:[],strategy:"absolute"};function Ct(){for(var t=arguments.length,e=new Array(t),r=0;r{var t={11:function(t,e,r){ /*! * Bootstrap base-component.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(t,e,r,n){"use strict";const i="5.3.3";class a extends r{constructor(e,r){super(),(e=n.getElement(e))&&(this._element=e,this._config=this._getConfig(r),t.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t.remove(this._element,this.constructor.DATA_KEY),e.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,r=!0){n.executeAfterTransition(t,e,r)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(e){return t.get(n.getElement(e),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return i}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}return a}(r(269),r(956),r(105),r(35))},647:function(t,e,r){ +t.exports=function(t,e,r,n){"use strict";const i="5.3.3";class a extends r{constructor(e,r){super(),(e=n.getElement(e))&&(this._element=e,this._config=this._getConfig(r),t.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t.remove(this._element,this.constructor.DATA_KEY),e.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,r=!0){n.executeAfterTransition(t,e,r)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(e){return t.get(n.getElement(e),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return i}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}return a}(r(269),r(956),r(105),r(35))},29:function(t,e,r){ /*! - * Bootstrap collapse.js v5.3.3 (https://getbootstrap.com/) - * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ -t.exports=function(t,e,r,n){"use strict";const i="collapse",a=".bs.collapse",o=`show${a}`,s=`shown${a}`,l=`hide${a}`,c=`hidden${a}`,u=`click${a}.data-api`,h="show",f="collapse",p="collapsing",d="collapsed",m=`:scope .${f} .${f}`,g="collapse-horizontal",y="width",v="height",x=".collapse.show, .collapse.collapsing",_='[data-bs-toggle="collapse"]',b={parent:null,toggle:!0},w={parent:"(null|element)",toggle:"boolean"};class T extends t{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const n=r.find(_);for(const t of n){const e=r.getSelectorFromElement(t),n=r.find(e).filter((t=>t===this._element));null!==e&&n.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return b}static get DefaultType(){return w}static get NAME(){return i}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(x).filter((t=>t!==this._element)).map((t=>T.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(e.trigger(this._element,o).defaultPrevented)return;for(const e of t)e.hide();const r=this._getDimension();this._element.classList.remove(f),this._element.classList.add(p),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=()=>{this._isTransitioning=!1,this._element.classList.remove(p),this._element.classList.add(f,h),this._element.style[r]="",e.trigger(this._element,s)},i=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(n,this._element,!0),this._element.style[r]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(e.trigger(this._element,l).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,n.reflow(this._element),this._element.classList.add(p),this._element.classList.remove(f,h);for(const t of this._triggerArray){const e=r.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(p),this._element.classList.add(f),e.trigger(this._element,c)};this._element.style[t]="",this._queueCallback(i,this._element,!0)}_isShown(t=this._element){return t.classList.contains(h)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=n.getElement(t.parent),t}_getDimension(){return this._element.classList.contains(g)?y:v}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(_);for(const e of t){const t=r.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=r.find(m,this._config.parent);return r.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const r of t)r.classList.toggle(d,!e),r.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const r=T.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===r[t])throw new TypeError(`No method named "${t}"`);r[t]()}}))}}return e.on(document,u,_,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of r.getMultipleElementsFromSelector(this))T.getOrCreateInstance(t,{toggle:!1}).toggle()})),n.defineJQueryPlugin(T),T}(r(11),r(956),r(411),r(35))},269:function(t){ -/*! - * Bootstrap data.js v5.3.3 (https://getbootstrap.com/) - * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ -t.exports=function(){"use strict";const t=new Map;return{set(e,r,n){t.has(e)||t.set(e,new Map);const i=t.get(e);i.has(r)||0===i.size?i.set(r,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(e,r)=>t.has(e)&&t.get(e).get(r)||null,remove(e,r){if(!t.has(e))return;const n=t.get(e);n.delete(r),0===n.size&&t.delete(e)}}}()},956:function(t,e,r){ -/*! - * Bootstrap event-handler.js v5.3.3 (https://getbootstrap.com/) - * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ -t.exports=function(t){"use strict";const e=/[^.]*(?=\..*)\.|.*/,r=/\..*/,n=/::\d+$/,i={};let a=1;const o={mouseenter:"mouseover",mouseleave:"mouseout"},s=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function l(t,e){return e&&`${e}::${a++}`||t.uidEvent||a++}function c(t){const e=l(t);return t.uidEvent=e,i[e]=i[e]||{},i[e]}function u(t,e){return function r(n){return x(n,{delegateTarget:t}),r.oneOff&&v.off(t,n.type,e),e.apply(t,[n])}}function h(t,e,r){return function n(i){const a=t.querySelectorAll(e);for(let{target:o}=i;o&&o!==this;o=o.parentNode)for(const s of a)if(s===o)return x(i,{delegateTarget:o}),n.oneOff&&v.off(t,i.type,e,r),r.apply(o,[i])}}function f(t,e,r=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===r))}function p(t,e,r){const n="string"==typeof e,i=n?r:e||r;let a=y(t);return s.has(a)||(a=t),[n,i,a]}function d(t,r,n,i,a){if("string"!=typeof r||!t)return;let[s,d,m]=p(r,n,i);if(r in o){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};d=t(d)}const g=c(t),y=g[m]||(g[m]={}),v=f(y,d,s?n:null);if(v)return void(v.oneOff=v.oneOff&&a);const x=l(d,r.replace(e,"")),_=s?h(t,n,d):u(t,d);_.delegationSelector=s?n:null,_.callable=d,_.oneOff=a,_.uidEvent=x,y[x]=_,t.addEventListener(m,_,s)}function m(t,e,r,n,i){const a=f(e[r],n,i);a&&(t.removeEventListener(r,a,Boolean(i)),delete e[r][a.uidEvent])}function g(t,e,r,n){const i=e[r]||{};for(const[a,o]of Object.entries(i))a.includes(n)&&m(t,e,r,o.callable,o.delegationSelector)}function y(t){return t=t.replace(r,""),o[t]||t}const v={on(t,e,r,n){d(t,e,r,n,!1)},one(t,e,r,n){d(t,e,r,n,!0)},off(t,e,r,i){if("string"!=typeof e||!t)return;const[a,o,s]=p(e,r,i),l=s!==e,u=c(t),h=u[s]||{},f=e.startsWith(".");if(void 0===o){if(f)for(const r of Object.keys(u))g(t,u,r,e.slice(1));for(const[r,i]of Object.entries(h)){const a=r.replace(n,"");l&&!e.includes(a)||m(t,u,s,i.callable,i.delegationSelector)}}else{if(!Object.keys(h).length)return;m(t,u,s,o,a?r:null)}},trigger(e,r,n){if("string"!=typeof r||!e)return null;const i=t.getjQuery();let a=null,o=!0,s=!0,l=!1;r!==y(r)&&i&&(a=i.Event(r,n),i(e).trigger(a),o=!a.isPropagationStopped(),s=!a.isImmediatePropagationStopped(),l=a.isDefaultPrevented());const c=x(new Event(r,{bubbles:o,cancelable:!0}),n);return l&&c.preventDefault(),s&&e.dispatchEvent(c),c.defaultPrevented&&a&&a.preventDefault(),c}};function x(t,e={}){for(const[r,n]of Object.entries(e))try{t[r]=n}catch(e){Object.defineProperty(t,r,{configurable:!0,get:()=>n})}return t}return v}(r(35))},333:function(t){ -/*! - * Bootstrap manipulator.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap tooltip.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(){"use strict";function t(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function e(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}return{setDataAttribute(t,r,n){t.setAttribute(`data-bs-${e(r)}`,n)},removeDataAttribute(t,r){t.removeAttribute(`data-bs-${e(r)}`)},getDataAttributes(e){if(!e)return{};const r={},n=Object.keys(e.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),r[n]=t(e.dataset[i])}return r},getDataAttribute:(r,n)=>t(r.getAttribute(`data-bs-${e(n)}`))}}()},411:function(t,e,r){ +t.exports=function(t,e,r,n,i,a,o){"use strict";function s(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const l=s(t),c="tooltip",u=new Set(["sanitize","allowList","sanitizeFn"]),h="fade",f="show",p=".tooltip-inner",d=".modal",m="hide.bs.modal",g="hover",y="focus",v="click",x="manual",_="hide",b="hidden",w="show",T="shown",k="inserted",A="click",M="focusin",S="focusout",E="mouseenter",C="mouseleave",I={AUTO:"auto",TOP:"top",RIGHT:i.isRTL()?"left":"right",BOTTOM:"bottom",LEFT:i.isRTL()?"right":"left"},L={allowList:a.DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},P={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class z extends e{constructor(t,e){if(void 0===l)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return L}static get DefaultType(){return P}static get NAME(){return c}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),r.off(this._element.closest(d),m,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=r.trigger(this._element,this.constructor.eventName(w)),e=(i.findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:a}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(a.append(n),r.trigger(this._element,this.constructor.eventName(k))),this._popper=this._createPopper(n),n.classList.add(f),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))r.on(t,"mouseover",i.noop);const o=()=>{r.trigger(this._element,this.constructor.eventName(T)),!1===this._isHovered&&this._leave(),this._isHovered=!1};this._queueCallback(o,this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(r.trigger(this._element,this.constructor.eventName(_)).defaultPrevented)return;if(this._getTipElement().classList.remove(f),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))r.off(t,"mouseover",i.noop);this._activeTrigger[v]=!1,this._activeTrigger[y]=!1,this._activeTrigger[g]=!1,this._isHovered=null;const t=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),r.trigger(this._element,this.constructor.eventName(b)))};this._queueCallback(t,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(h,f),e.classList.add(`bs-${this.constructor.NAME}-auto`);const r=i.getUID(this.constructor.NAME).toString();return e.setAttribute("id",r),this._isAnimated()&&e.classList.add(h),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new o({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[p]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(h)}_isShown(){return this.tip&&this.tip.classList.contains(f)}_createPopper(t){const e=i.execute(this._config.placement,[this,t,this._element]),r=I[e.toUpperCase()];return l.createPopper(this._element,t,this._getPopperConfig(r))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return i.execute(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...i.execute(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)r.on(this._element,this.constructor.eventName(A),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if(e!==x){const t=e===g?this.constructor.eventName(E):this.constructor.eventName(M),n=e===g?this.constructor.eventName(C):this.constructor.eventName(S);r.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?y:g]=!0,e._enter()})),r.on(this._element,n,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?y:g]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},r.on(this._element.closest(d),m,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=n.getDataAttributes(this._element);for(const t of Object.keys(e))u.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:i.getElement(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,r]of Object.entries(this._config))this.constructor.Default[e]!==r&&(t[e]=r);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=z.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}return i.defineJQueryPlugin(z),z}(r(170),r(11),r(956),r(333),r(35),r(812),r(982))},35:function(t,e){ /*! - * Bootstrap selector-engine.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap index.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(t){"use strict";const e=e=>{let r=e.getAttribute("data-bs-target");if(!r||"#"===r){let t=e.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),r=t&&"#"!==t?t.trim():null}return r?r.split(",").map((e=>t.parseSelector(e))).join(","):null},r={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const r=[];let n=t.parentNode.closest(e);for(;n;)r.push(n),n=n.parentNode.closest(e);return r},prev(t,e){let r=t.previousElementSibling;for(;r;){if(r.matches(e))return[r];r=r.previousElementSibling}return[]},next(t,e){let r=t.nextElementSibling;for(;r;){if(r.matches(e))return[r];r=r.nextElementSibling}return[]},focusableChildren(e){const r=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(r,e).filter((e=>!t.isDisabled(e)&&t.isVisible(e)))},getSelectorFromElement(t){const n=e(t);return n&&r.findOne(n)?n:null},getElementFromSelector(t){const n=e(t);return n?r.findOne(n):null},getMultipleElementsFromSelector(t){const n=e(t);return n?r.find(n):[]}};return r}(r(35))},453:function(t,e,r){ +!function(t){"use strict";const e=1e6,r=1e3,n="transitionend",i=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),a=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),o=t=>{do{t+=Math.floor(Math.random()*e)}while(document.getElementById(t));return t},s=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:n}=window.getComputedStyle(t);const i=Number.parseFloat(e),a=Number.parseFloat(n);return i||a?(e=e.split(",")[0],n=n.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(n))*r):0},l=t=>{t.dispatchEvent(new Event(n))},c=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),u=t=>c(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(i(t)):null,h=t=>{if(!c(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),r=t.closest("details:not([open])");if(!r)return e;if(r!==t){const e=t.closest("summary");if(e&&e.parentNode!==r)return!1;if(null===e)return!1}return e},f=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),p=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?p(t.parentNode):null},d=()=>{},m=t=>{t.offsetHeight},g=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,y=[],v=t=>{"loading"===document.readyState?(y.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of y)t()})),y.push(t)):t()},x=()=>"rtl"===document.documentElement.dir,_=t=>{v((()=>{const e=g();if(e){const r=t.NAME,n=e.fn[r];e.fn[r]=t.jQueryInterface,e.fn[r].Constructor=t,e.fn[r].noConflict=()=>(e.fn[r]=n,t.jQueryInterface)}}))},b=(t,e=[],r=t)=>"function"==typeof t?t(...e):r,w=(t,e,r=!0)=>{if(!r)return void b(t);const i=5,a=s(e)+i;let o=!1;const c=({target:r})=>{r===e&&(o=!0,e.removeEventListener(n,c),b(t))};e.addEventListener(n,c),setTimeout((()=>{o||l(e)}),a)},T=(t,e,r,n)=>{const i=t.length;let a=t.indexOf(e);return-1===a?!r&&n?t[i-1]:t[0]:(a+=r?1:-1,n&&(a=(a+i)%i),t[Math.max(0,Math.min(a,i-1))])};t.defineJQueryPlugin=_,t.execute=b,t.executeAfterTransition=w,t.findShadowRoot=p,t.getElement=u,t.getNextActiveElement=T,t.getTransitionDurationFromElement=s,t.getUID=o,t.getjQuery=g,t.isDisabled=f,t.isElement=c,t.isRTL=x,t.isVisible=h,t.noop=d,t.onDOMContentLoaded=v,t.parseSelector=i,t.reflow=m,t.toType=a,t.triggerTransitionEnd=l,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(e)},105:function(t,e,r){ /*! - * Bootstrap dropdown.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap config.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(t,e,r,n,i,a){"use strict";function o(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const s=o(t),l="dropdown",c=".bs.dropdown",u=".data-api",h="Escape",f="Tab",p="ArrowUp",d="ArrowDown",m=2,g=`hide${c}`,y=`hidden${c}`,v=`show${c}`,x=`shown${c}`,_=`click${c}${u}`,b=`keydown${c}${u}`,w=`keyup${c}${u}`,T="show",k="dropup",A="dropend",M="dropstart",S="dropup-center",E="dropdown-center",C='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',I=`${C}.${T}`,L=".dropdown-menu",P=".navbar",z=".navbar-nav",D=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",O=a.isRTL()?"top-end":"top-start",R=a.isRTL()?"top-start":"top-end",F=a.isRTL()?"bottom-end":"bottom-start",j=a.isRTL()?"bottom-start":"bottom-end",B=a.isRTL()?"left-start":"right-start",N=a.isRTL()?"right-start":"left-start",U="top",V="bottom",q={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},H={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class G extends e{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=i.next(this._element,L)[0]||i.prev(this._element,L)[0]||i.findOne(L,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return q}static get DefaultType(){return H}static get NAME(){return l}toggle(){return this._isShown()?this.hide():this.show()}show(){if(a.isDisabled(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!r.trigger(this._element,v,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(z))for(const t of[].concat(...document.body.children))r.on(t,"mouseover",a.noop);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(T),this._element.classList.add(T),r.trigger(this._element,x,t)}}hide(){if(a.isDisabled(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!r.trigger(this._element,g,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))r.off(t,"mouseover",a.noop);this._popper&&this._popper.destroy(),this._menu.classList.remove(T),this._element.classList.remove(T),this._element.setAttribute("aria-expanded","false"),n.removeDataAttribute(this._menu,"popper"),r.trigger(this._element,y,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!a.isElement(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${l.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===s)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:a.isElement(this._config.reference)?t=a.getElement(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=s.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(T)}_getPlacement(){const t=this._parent;if(t.classList.contains(A))return B;if(t.classList.contains(M))return N;if(t.classList.contains(S))return U;if(t.classList.contains(E))return V;const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains(k)?e?R:O:e?j:F}_detectNavbar(){return null!==this._element.closest(P)}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(n.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...a.execute(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const r=i.find(D,this._menu).filter((t=>a.isVisible(t)));r.length&&a.getNextActiveElement(r,e,t===d,!r.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=G.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(t.button===m||"keyup"===t.type&&t.key!==f)return;const e=i.find(I);for(const r of e){const e=G.getInstance(r);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),i=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!i||"outside"===e._config.autoClose&&i)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&t.key===f||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const a={relatedTarget:e._element};"click"===t.type&&(a.clickEvent=t),e._completeHide(a)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),r=t.key===h,n=[p,d].includes(t.key);if(!n&&!r)return;if(e&&!r)return;t.preventDefault();const a=this.matches(C)?this:i.prev(this,C)[0]||i.next(this,C)[0]||i.findOne(C,t.delegateTarget.parentNode),o=G.getOrCreateInstance(a);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),a.focus())}}return r.on(document,b,C,G.dataApiKeydownHandler),r.on(document,b,L,G.dataApiKeydownHandler),r.on(document,_,G.clearMenus),r.on(document,w,G.clearMenus),r.on(document,_,C,(function(t){t.preventDefault(),G.getOrCreateInstance(this).toggle()})),a.defineJQueryPlugin(G),G}(r(170),r(11),r(956),r(333),r(411),r(35))},653:function(t,e,r){ +t.exports=function(t,e){"use strict";class r{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(r,n){const i=e.isElement(n)?t.getDataAttribute(n,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...e.isElement(n)?t.getDataAttributes(n):{},..."object"==typeof r?r:{}}}_typeCheckConfig(t,r=this.constructor.DefaultType){for(const[n,i]of Object.entries(r)){const r=t[n],a=e.isElement(r)?"element":e.toType(r);if(!new RegExp(i).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${i}".`)}}}return r}(r(333),r(35))},170:(t,e,r)=>{"use strict";r.r(e),r.d(e,{afterMain:()=>w,afterRead:()=>x,afterWrite:()=>A,applyStyles:()=>P,arrow:()=>K,auto:()=>s,basePlacements:()=>l,beforeMain:()=>_,beforeRead:()=>y,beforeWrite:()=>T,bottom:()=>i,clippingParents:()=>h,computeStyles:()=>rt,createPopper:()=>Pt,createPopperBase:()=>Lt,createPopperLite:()=>zt,detectOverflow:()=>vt,end:()=>u,eventListeners:()=>it,flip:()=>xt,hide:()=>wt,left:()=>o,main:()=>b,modifierPhases:()=>M,offset:()=>Tt,placements:()=>g,popper:()=>p,popperGenerator:()=>It,popperOffsets:()=>kt,preventOverflow:()=>At,read:()=>v,reference:()=>d,right:()=>a,start:()=>c,top:()=>n,variationPlacements:()=>m,viewport:()=>f,write:()=>k});var n="top",i="bottom",a="right",o="left",s="auto",l=[n,i,a,o],c="start",u="end",h="clippingParents",f="viewport",p="popper",d="reference",m=l.reduce((function(t,e){return t.concat([e+"-"+c,e+"-"+u])}),[]),g=[].concat(l,[s]).reduce((function(t,e){return t.concat([e,e+"-"+c,e+"-"+u])}),[]),y="beforeRead",v="read",x="afterRead",_="beforeMain",b="main",w="afterMain",T="beforeWrite",k="write",A="afterWrite",M=[y,v,x,_,b,w,T,k,A];function S(t){return t?(t.nodeName||"").toLowerCase():null}function E(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return t instanceof E(t).Element||t instanceof Element}function I(t){return t instanceof E(t).HTMLElement||t instanceof HTMLElement}function L(t){return"undefined"!=typeof ShadowRoot&&(t instanceof E(t).ShadowRoot||t instanceof ShadowRoot)}const P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},i=e.elements[t];I(i)&&S(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(t){var e=n[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],i=e.attributes[t]||{},a=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:r[t]).reduce((function(t,e){return t[e]="",t}),{});I(n)&&S(n)&&(Object.assign(n.style,a),Object.keys(i).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function z(t){return t.split("-")[0]}var D=Math.max,O=Math.min,R=Math.round;function F(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function j(){return!/^((?!chrome|android).)*safari/i.test(F())}function B(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&I(t)&&(i=t.offsetWidth>0&&R(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&R(n.height)/t.offsetHeight||1);var o=(C(t)?E(t):window).visualViewport,s=!j()&&r,l=(n.left+(s&&o?o.offsetLeft:0))/i,c=(n.top+(s&&o?o.offsetTop:0))/a,u=n.width/i,h=n.height/a;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function N(t){var e=B(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function U(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&L(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function V(t){return E(t).getComputedStyle(t)}function q(t){return["table","td","th"].indexOf(S(t))>=0}function H(t){return((C(t)?t.ownerDocument:t.document)||window.document).documentElement}function G(t){return"html"===S(t)?t:t.assignedSlot||t.parentNode||(L(t)?t.host:null)||H(t)}function Z(t){return I(t)&&"fixed"!==V(t).position?t.offsetParent:null}function W(t){for(var e=E(t),r=Z(t);r&&q(r)&&"static"===V(r).position;)r=Z(r);return r&&("html"===S(r)||"body"===S(r)&&"static"===V(r).position)?e:r||function(t){var e=/firefox/i.test(F());if(/Trident/i.test(F())&&I(t)&&"fixed"===V(t).position)return null;var r=G(t);for(L(r)&&(r=r.host);I(r)&&["html","body"].indexOf(S(r))<0;){var n=V(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(t)||e}function Y(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,e,r){return D(t,O(e,r))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function J(t,e){return e.reduce((function(e,r){return e[r]=t,e}),{})}const K={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,s=t.name,c=t.options,u=r.elements.arrow,h=r.modifiersData.popperOffsets,f=z(r.placement),p=Y(f),d=[o,a].indexOf(f)>=0?"height":"width";if(u&&h){var m=function(t,e){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:J(t,l))}(c.padding,r),g=N(u),y="y"===p?n:o,v="y"===p?i:a,x=r.rects.reference[d]+r.rects.reference[p]-h[p]-r.rects.popper[d],_=h[p]-r.rects.reference[p],b=W(u),w=b?"y"===p?b.clientHeight||0:b.clientWidth||0:0,T=x/2-_/2,k=m[y],A=w-g[d]-m[v],M=w/2-g[d]/2+T,S=X(k,M,A),E=p;r.modifiersData[s]=((e={})[E]=S,e.centerOffset=S-M,e)}},effect:function(t){var e=t.state,r=t.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&U(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,r=t.popper,s=t.popperRect,l=t.placement,c=t.variation,h=t.offsets,f=t.position,p=t.gpuAcceleration,d=t.adaptive,m=t.roundOffsets,g=t.isFixed,y=h.x,v=void 0===y?0:y,x=h.y,_=void 0===x?0:x,b="function"==typeof m?m({x:v,y:_}):{x:v,y:_};v=b.x,_=b.y;var w=h.hasOwnProperty("x"),T=h.hasOwnProperty("y"),k=o,A=n,M=window;if(d){var S=W(r),C="clientHeight",I="clientWidth";if(S===E(r)&&"static"!==V(S=H(r)).position&&"absolute"===f&&(C="scrollHeight",I="scrollWidth"),l===n||(l===o||l===a)&&c===u)A=i,_-=(g&&S===M&&M.visualViewport?M.visualViewport.height:S[C])-s.height,_*=p?1:-1;if(l===o||(l===n||l===i)&&c===u)k=a,v-=(g&&S===M&&M.visualViewport?M.visualViewport.width:S[I])-s.width,v*=p?1:-1}var L,P=Object.assign({position:f},d&&tt),z=!0===m?function(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:R(r*i)/i||0,y:R(n*i)/i||0}}({x:v,y:_},E(r)):{x:v,y:_};return v=z.x,_=z.y,p?Object.assign({},P,((L={})[A]=T?"0":"",L[k]=w?"0":"",L.transform=(M.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",L)):Object.assign({},P,((e={})[A]=T?_+"px":"",e[k]=w?v+"px":"",e.transform="",e))}const rt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=void 0===n||n,a=r.adaptive,o=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:z(e.placement),variation:Q(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var nt={passive:!0};const it={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=void 0===i||i,o=n.resize,s=void 0===o||o,l=E(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&c.forEach((function(t){t.addEventListener("scroll",r.update,nt)})),s&&l.addEventListener("resize",r.update,nt),function(){a&&c.forEach((function(t){t.removeEventListener("scroll",r.update,nt)})),s&&l.removeEventListener("resize",r.update,nt)}},data:{}};var at={left:"right",right:"left",bottom:"top",top:"bottom"};function ot(t){return t.replace(/left|right|bottom|top/g,(function(t){return at[t]}))}var st={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,(function(t){return st[t]}))}function ct(t){var e=E(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ut(t){return B(H(t)).left+ct(t).scrollLeft}function ht(t){var e=V(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function ft(t){return["html","body","#document"].indexOf(S(t))>=0?t.ownerDocument.body:I(t)&&ht(t)?t:ft(G(t))}function pt(t,e){var r;void 0===e&&(e=[]);var n=ft(t),i=n===(null==(r=t.ownerDocument)?void 0:r.body),a=E(n),o=i?[a].concat(a.visualViewport||[],ht(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(pt(G(o)))}function dt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,r){return e===f?dt(function(t,e){var r=E(t),n=H(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var c=j();(c||!c&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+ut(t),y:l}}(t,r)):C(e)?function(t,e){var r=B(t,!1,"fixed"===e);return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}(e,r):dt(function(t){var e,r=H(t),n=ct(t),i=null==(e=t.ownerDocument)?void 0:e.body,a=D(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=D(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+ut(t),l=-n.scrollTop;return"rtl"===V(i||r).direction&&(s+=D(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(H(t)))}function gt(t,e,r,n){var i="clippingParents"===e?function(t){var e=pt(G(t)),r=["absolute","fixed"].indexOf(V(t).position)>=0&&I(t)?W(t):t;return C(r)?e.filter((function(t){return C(t)&&U(t,r)&&"body"!==S(t)})):[]}(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce((function(e,r){var i=mt(t,r,n);return e.top=D(i.top,e.top),e.right=O(i.right,e.right),e.bottom=O(i.bottom,e.bottom),e.left=D(i.left,e.left),e}),mt(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function yt(t){var e,r=t.reference,s=t.element,l=t.placement,h=l?z(l):null,f=l?Q(l):null,p=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2;switch(h){case n:e={x:p,y:r.y-s.height};break;case i:e={x:p,y:r.y+r.height};break;case a:e={x:r.x+r.width,y:d};break;case o:e={x:r.x-s.width,y:d};break;default:e={x:r.x,y:r.y}}var m=h?Y(h):null;if(null!=m){var g="y"===m?"height":"width";switch(f){case c:e[m]=e[m]-(r[g]/2-s[g]/2);break;case u:e[m]=e[m]+(r[g]/2-s[g]/2)}}return e}function vt(t,e){void 0===e&&(e={});var r=e,o=r.placement,s=void 0===o?t.placement:o,c=r.strategy,u=void 0===c?t.strategy:c,m=r.boundary,g=void 0===m?h:m,y=r.rootBoundary,v=void 0===y?f:y,x=r.elementContext,_=void 0===x?p:x,b=r.altBoundary,w=void 0!==b&&b,T=r.padding,k=void 0===T?0:T,A=$("number"!=typeof k?k:J(k,l)),M=_===p?d:p,S=t.rects.popper,E=t.elements[w?M:_],I=gt(C(E)?E:E.contextElement||H(t.elements.popper),g,v,u),L=B(t.elements.reference),P=yt({reference:L,element:S,strategy:"absolute",placement:s}),z=dt(Object.assign({},S,P)),D=_===p?z:L,O={top:I.top-D.top+A.top,bottom:D.bottom-I.bottom+A.bottom,left:I.left-D.left+A.left,right:D.right-I.right+A.right},R=t.modifiersData.offset;if(_===p&&R){var F=R[s];Object.keys(O).forEach((function(t){var e=[a,i].indexOf(t)>=0?1:-1,r=[n,i].indexOf(t)>=0?"y":"x";O[t]+=F[r]*e}))}return O}const xt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,u=t.name;if(!e.modifiersData[u]._skip){for(var h=r.mainAxis,f=void 0===h||h,p=r.altAxis,d=void 0===p||p,y=r.fallbackPlacements,v=r.padding,x=r.boundary,_=r.rootBoundary,b=r.altBoundary,w=r.flipVariations,T=void 0===w||w,k=r.allowedAutoPlacements,A=e.options.placement,M=z(A),S=y||(M===A||!T?[ot(A)]:function(t){if(z(t)===s)return[];var e=ot(t);return[lt(t),e,lt(e)]}(A)),E=[A].concat(S).reduce((function(t,r){return t.concat(z(r)===s?function(t,e){void 0===e&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=void 0===c?g:c,h=Q(n),f=h?s?m:m.filter((function(t){return Q(t)===h})):l,p=f.filter((function(t){return u.indexOf(t)>=0}));0===p.length&&(p=f);var d=p.reduce((function(e,r){return e[r]=vt(t,{placement:r,boundary:i,rootBoundary:a,padding:o})[z(r)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}(e,{placement:r,boundary:x,rootBoundary:_,padding:v,flipVariations:T,allowedAutoPlacements:k}):r)}),[]),C=e.rects.reference,I=e.rects.popper,L=new Map,P=!0,D=E[0],O=0;O=0,N=B?"width":"height",U=vt(e,{placement:R,boundary:x,rootBoundary:_,altBoundary:b,padding:v}),V=B?j?a:o:j?i:n;C[N]>I[N]&&(V=ot(V));var q=ot(V),H=[];if(f&&H.push(U[F]<=0),d&&H.push(U[V]<=0,U[q]<=0),H.every((function(t){return t}))){D=R,P=!1;break}L.set(R,H)}if(P)for(var G=function(t){var e=E.find((function(e){var r=L.get(e);if(r)return r.slice(0,t).every((function(t){return t}))}));if(e)return D=e,"break"},Z=T?3:1;Z>0;Z--){if("break"===G(Z))break}e.placement!==D&&(e.modifiersData[u]._skip=!0,e.placement=D,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _t(t,e,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function bt(t){return[n,a,i,o].some((function(e){return t[e]>=0}))}const wt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=vt(e,{elementContext:"reference"}),s=vt(e,{altBoundary:!0}),l=_t(o,n),c=_t(s,i,a),u=bt(l),h=bt(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}};const Tt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,r=t.options,i=t.name,s=r.offset,l=void 0===s?[0,0]:s,c=g.reduce((function(t,r){return t[r]=function(t,e,r){var i=z(t),s=[o,n].indexOf(i)>=0?-1:1,l="function"==typeof r?r(Object.assign({},e,{placement:t})):r,c=l[0],u=l[1];return c=c||0,u=(u||0)*s,[o,a].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(r,e.rects,l),t}),{}),u=c[e.placement],h=u.x,f=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=h,e.modifiersData.popperOffsets.y+=f),e.modifiersData[i]=c}};const kt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,r=t.name;e.modifiersData[r]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const At={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,s=t.name,l=r.mainAxis,u=void 0===l||l,h=r.altAxis,f=void 0!==h&&h,p=r.boundary,d=r.rootBoundary,m=r.altBoundary,g=r.padding,y=r.tether,v=void 0===y||y,x=r.tetherOffset,_=void 0===x?0:x,b=vt(e,{boundary:p,rootBoundary:d,padding:g,altBoundary:m}),w=z(e.placement),T=Q(e.placement),k=!T,A=Y(w),M="x"===A?"y":"x",S=e.modifiersData.popperOffsets,E=e.rects.reference,C=e.rects.popper,I="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,L="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(S){if(u){var F,j="y"===A?n:o,B="y"===A?i:a,U="y"===A?"height":"width",V=S[A],q=V+b[j],H=V-b[B],G=v?-C[U]/2:0,Z=T===c?E[U]:C[U],$=T===c?-C[U]:-E[U],J=e.elements.arrow,K=v&&J?N(J):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[j],rt=tt[B],nt=X(0,E[U],K[U]),it=k?E[U]/2-G-nt-et-L.mainAxis:Z-nt-et-L.mainAxis,at=k?-E[U]/2+G+nt+rt+L.mainAxis:$+nt+rt+L.mainAxis,ot=e.elements.arrow&&W(e.elements.arrow),st=ot?"y"===A?ot.clientTop||0:ot.clientLeft||0:0,lt=null!=(F=null==P?void 0:P[A])?F:0,ct=V+at-lt,ut=X(v?O(q,V+it-lt-st):q,V,v?D(H,ct):H);S[A]=ut,R[A]=ut-V}if(f){var ht,ft="x"===A?n:o,pt="x"===A?i:a,dt=S[M],mt="y"===M?"height":"width",gt=dt+b[ft],yt=dt-b[pt],xt=-1!==[n,o].indexOf(w),_t=null!=(ht=null==P?void 0:P[M])?ht:0,bt=xt?gt:dt-E[mt]-C[mt]-_t+L.altAxis,wt=xt?dt+E[mt]+C[mt]-_t-L.altAxis:yt,Tt=v&&xt?function(t,e,r){var n=X(t,e,r);return n>r?r:n}(bt,dt,wt):X(v?bt:gt,dt,v?wt:yt);S[M]=Tt,R[M]=Tt-dt}e.modifiersData[s]=R}},requiresIfExists:["offset"]};function Mt(t,e,r){void 0===r&&(r=!1);var n,i,a=I(e),o=I(e)&&function(t){var e=t.getBoundingClientRect(),r=R(e.width)/t.offsetWidth||1,n=R(e.height)/t.offsetHeight||1;return 1!==r||1!==n}(e),s=H(e),l=B(t,o,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==S(e)||ht(s))&&(c=(n=e)!==E(n)&&I(n)?{scrollLeft:(i=n).scrollLeft,scrollTop:i.scrollTop}:ct(n)),I(e)?((u=B(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=ut(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function St(t){var e=new Map,r=new Set,n=[];function i(t){r.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!r.has(t)){var n=e.get(t);n&&i(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){r.has(t.name)||i(t)})),n}var Et={placement:"bottom",modifiers:[],strategy:"absolute"};function Ct(){for(var t=arguments.length,e=new Array(t),r=0;r{this._element.classList.remove(y),e.trigger(this._element,p),this._maybeScheduleHide()};this._element.classList.remove(m),n.reflow(this._element),this._element.classList.add(g,y),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown())return;if(e.trigger(this._element,u).defaultPrevented)return;const t=()=>{this._element.classList.add(m),this._element.classList.remove(y,g),e.trigger(this._element,h)};this._element.classList.add(y),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(g),super.dispose()}isShown(){return this._element.classList.contains(g)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const r=t.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){e.on(this._element,o,(t=>this._onInteraction(t,!0))),e.on(this._element,s,(t=>this._onInteraction(t,!1))),e.on(this._element,l,(t=>this._onInteraction(t,!0))),e.on(this._element,c,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=_.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return r.enableDismissTrigger(_),n.defineJQueryPlugin(_),_}(r(11),r(956),r(248),r(35))},29:function(t,e,r){ +!function(t,e,r,n){"use strict";const i=(t,i="hide")=>{const a=`click.dismiss${t.EVENT_KEY}`,o=t.NAME;e.on(document,a,`[data-bs-dismiss="${o}"]`,(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),n.isDisabled(this))return;const a=r.getElementFromSelector(this)||this.closest(`.${o}`);t.getOrCreateInstance(a)[i]()}))};t.enableDismissTrigger=i,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(e,r(956),r(411),r(35))},269:function(t){ /*! - * Bootstrap tooltip.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap data.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(t,e,r,n,i,a,o){"use strict";function s(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const l=s(t),c="tooltip",u=new Set(["sanitize","allowList","sanitizeFn"]),h="fade",f="show",p=".tooltip-inner",d=".modal",m="hide.bs.modal",g="hover",y="focus",v="click",x="manual",_="hide",b="hidden",w="show",T="shown",k="inserted",A="click",M="focusin",S="focusout",E="mouseenter",C="mouseleave",I={AUTO:"auto",TOP:"top",RIGHT:i.isRTL()?"left":"right",BOTTOM:"bottom",LEFT:i.isRTL()?"right":"left"},L={allowList:a.DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},P={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class z extends e{constructor(t,e){if(void 0===l)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return L}static get DefaultType(){return P}static get NAME(){return c}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),r.off(this._element.closest(d),m,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=r.trigger(this._element,this.constructor.eventName(w)),e=(i.findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:a}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(a.append(n),r.trigger(this._element,this.constructor.eventName(k))),this._popper=this._createPopper(n),n.classList.add(f),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))r.on(t,"mouseover",i.noop);const o=()=>{r.trigger(this._element,this.constructor.eventName(T)),!1===this._isHovered&&this._leave(),this._isHovered=!1};this._queueCallback(o,this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(r.trigger(this._element,this.constructor.eventName(_)).defaultPrevented)return;if(this._getTipElement().classList.remove(f),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))r.off(t,"mouseover",i.noop);this._activeTrigger[v]=!1,this._activeTrigger[y]=!1,this._activeTrigger[g]=!1,this._isHovered=null;const t=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),r.trigger(this._element,this.constructor.eventName(b)))};this._queueCallback(t,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(h,f),e.classList.add(`bs-${this.constructor.NAME}-auto`);const r=i.getUID(this.constructor.NAME).toString();return e.setAttribute("id",r),this._isAnimated()&&e.classList.add(h),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new o({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[p]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(h)}_isShown(){return this.tip&&this.tip.classList.contains(f)}_createPopper(t){const e=i.execute(this._config.placement,[this,t,this._element]),r=I[e.toUpperCase()];return l.createPopper(this._element,t,this._getPopperConfig(r))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return i.execute(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...i.execute(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)r.on(this._element,this.constructor.eventName(A),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if(e!==x){const t=e===g?this.constructor.eventName(E):this.constructor.eventName(M),n=e===g?this.constructor.eventName(C):this.constructor.eventName(S);r.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?y:g]=!0,e._enter()})),r.on(this._element,n,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?y:g]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},r.on(this._element.closest(d),m,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=n.getDataAttributes(this._element);for(const t of Object.keys(e))u.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:i.getElement(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,r]of Object.entries(this._config))this.constructor.Default[e]!==r&&(t[e]=r);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=z.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}return i.defineJQueryPlugin(z),z}(r(170),r(11),r(956),r(333),r(35),r(812),r(982))},248:function(t,e,r){ +t.exports=function(){"use strict";const t=new Map;return{set(e,r,n){t.has(e)||t.set(e,new Map);const i=t.get(e);i.has(r)||0===i.size?i.set(r,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(e,r)=>t.has(e)&&t.get(e).get(r)||null,remove(e,r){if(!t.has(e))return;const n=t.get(e);n.delete(r),0===n.size&&t.delete(e)}}}()},333:function(t){ /*! - * Bootstrap component-functions.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap manipulator.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -!function(t,e,r,n){"use strict";const i=(t,i="hide")=>{const a=`click.dismiss${t.EVENT_KEY}`,o=t.NAME;e.on(document,a,`[data-bs-dismiss="${o}"]`,(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),n.isDisabled(this))return;const a=r.getElementFromSelector(this)||this.closest(`.${o}`);t.getOrCreateInstance(a)[i]()}))};t.enableDismissTrigger=i,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(e,r(956),r(411),r(35))},105:function(t,e,r){ +t.exports=function(){"use strict";function t(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function e(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}return{setDataAttribute(t,r,n){t.setAttribute(`data-bs-${e(r)}`,n)},removeDataAttribute(t,r){t.removeAttribute(`data-bs-${e(r)}`)},getDataAttributes(e){if(!e)return{};const r={},n=Object.keys(e.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),r[n]=t(e.dataset[i])}return r},getDataAttribute:(r,n)=>t(r.getAttribute(`data-bs-${e(n)}`))}}()},411:function(t,e,r){ /*! - * Bootstrap config.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap selector-engine.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(t,e){"use strict";class r{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(r,n){const i=e.isElement(n)?t.getDataAttribute(n,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...e.isElement(n)?t.getDataAttributes(n):{},..."object"==typeof r?r:{}}}_typeCheckConfig(t,r=this.constructor.DefaultType){for(const[n,i]of Object.entries(r)){const r=t[n],a=e.isElement(r)?"element":e.toType(r);if(!new RegExp(i).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${i}".`)}}}return r}(r(333),r(35))},35:function(t,e){ +t.exports=function(t){"use strict";const e=e=>{let r=e.getAttribute("data-bs-target");if(!r||"#"===r){let t=e.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),r=t&&"#"!==t?t.trim():null}return r?r.split(",").map((e=>t.parseSelector(e))).join(","):null},r={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const r=[];let n=t.parentNode.closest(e);for(;n;)r.push(n),n=n.parentNode.closest(e);return r},prev(t,e){let r=t.previousElementSibling;for(;r;){if(r.matches(e))return[r];r=r.previousElementSibling}return[]},next(t,e){let r=t.nextElementSibling;for(;r;){if(r.matches(e))return[r];r=r.nextElementSibling}return[]},focusableChildren(e){const r=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(r,e).filter((e=>!t.isDisabled(e)&&t.isVisible(e)))},getSelectorFromElement(t){const n=e(t);return n&&r.findOne(n)?n:null},getElementFromSelector(t){const n=e(t);return n?r.findOne(n):null},getMultipleElementsFromSelector(t){const n=e(t);return n?r.find(n):[]}};return r}(r(35))},453:function(t,e,r){ /*! - * Bootstrap index.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap dropdown.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -!function(t){"use strict";const e=1e6,r=1e3,n="transitionend",i=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),a=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),o=t=>{do{t+=Math.floor(Math.random()*e)}while(document.getElementById(t));return t},s=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:n}=window.getComputedStyle(t);const i=Number.parseFloat(e),a=Number.parseFloat(n);return i||a?(e=e.split(",")[0],n=n.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(n))*r):0},l=t=>{t.dispatchEvent(new Event(n))},c=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),u=t=>c(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(i(t)):null,h=t=>{if(!c(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),r=t.closest("details:not([open])");if(!r)return e;if(r!==t){const e=t.closest("summary");if(e&&e.parentNode!==r)return!1;if(null===e)return!1}return e},f=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),p=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?p(t.parentNode):null},d=()=>{},m=t=>{t.offsetHeight},g=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,y=[],v=t=>{"loading"===document.readyState?(y.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of y)t()})),y.push(t)):t()},x=()=>"rtl"===document.documentElement.dir,_=t=>{v((()=>{const e=g();if(e){const r=t.NAME,n=e.fn[r];e.fn[r]=t.jQueryInterface,e.fn[r].Constructor=t,e.fn[r].noConflict=()=>(e.fn[r]=n,t.jQueryInterface)}}))},b=(t,e=[],r=t)=>"function"==typeof t?t(...e):r,w=(t,e,r=!0)=>{if(!r)return void b(t);const i=5,a=s(e)+i;let o=!1;const c=({target:r})=>{r===e&&(o=!0,e.removeEventListener(n,c),b(t))};e.addEventListener(n,c),setTimeout((()=>{o||l(e)}),a)},T=(t,e,r,n)=>{const i=t.length;let a=t.indexOf(e);return-1===a?!r&&n?t[i-1]:t[0]:(a+=r?1:-1,n&&(a=(a+i)%i),t[Math.max(0,Math.min(a,i-1))])};t.defineJQueryPlugin=_,t.execute=b,t.executeAfterTransition=w,t.findShadowRoot=p,t.getElement=u,t.getNextActiveElement=T,t.getTransitionDurationFromElement=s,t.getUID=o,t.getjQuery=g,t.isDisabled=f,t.isElement=c,t.isRTL=x,t.isVisible=h,t.noop=d,t.onDOMContentLoaded=v,t.parseSelector=i,t.reflow=m,t.toType=a,t.triggerTransitionEnd=l,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(e)},812:function(t,e){ +t.exports=function(t,e,r,n,i,a){"use strict";function o(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const s=o(t),l="dropdown",c=".bs.dropdown",u=".data-api",h="Escape",f="Tab",p="ArrowUp",d="ArrowDown",m=2,g=`hide${c}`,y=`hidden${c}`,v=`show${c}`,x=`shown${c}`,_=`click${c}${u}`,b=`keydown${c}${u}`,w=`keyup${c}${u}`,T="show",k="dropup",A="dropend",M="dropstart",S="dropup-center",E="dropdown-center",C='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',I=`${C}.${T}`,L=".dropdown-menu",P=".navbar",z=".navbar-nav",D=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",O=a.isRTL()?"top-end":"top-start",R=a.isRTL()?"top-start":"top-end",F=a.isRTL()?"bottom-end":"bottom-start",j=a.isRTL()?"bottom-start":"bottom-end",B=a.isRTL()?"left-start":"right-start",N=a.isRTL()?"right-start":"left-start",U="top",V="bottom",q={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},H={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class G extends e{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=i.next(this._element,L)[0]||i.prev(this._element,L)[0]||i.findOne(L,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return q}static get DefaultType(){return H}static get NAME(){return l}toggle(){return this._isShown()?this.hide():this.show()}show(){if(a.isDisabled(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!r.trigger(this._element,v,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(z))for(const t of[].concat(...document.body.children))r.on(t,"mouseover",a.noop);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(T),this._element.classList.add(T),r.trigger(this._element,x,t)}}hide(){if(a.isDisabled(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!r.trigger(this._element,g,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))r.off(t,"mouseover",a.noop);this._popper&&this._popper.destroy(),this._menu.classList.remove(T),this._element.classList.remove(T),this._element.setAttribute("aria-expanded","false"),n.removeDataAttribute(this._menu,"popper"),r.trigger(this._element,y,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!a.isElement(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${l.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===s)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:a.isElement(this._config.reference)?t=a.getElement(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=s.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(T)}_getPlacement(){const t=this._parent;if(t.classList.contains(A))return B;if(t.classList.contains(M))return N;if(t.classList.contains(S))return U;if(t.classList.contains(E))return V;const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains(k)?e?R:O:e?j:F}_detectNavbar(){return null!==this._element.closest(P)}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(n.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...a.execute(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const r=i.find(D,this._menu).filter((t=>a.isVisible(t)));r.length&&a.getNextActiveElement(r,e,t===d,!r.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=G.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(t.button===m||"keyup"===t.type&&t.key!==f)return;const e=i.find(I);for(const r of e){const e=G.getInstance(r);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),i=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!i||"outside"===e._config.autoClose&&i)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&t.key===f||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const a={relatedTarget:e._element};"click"===t.type&&(a.clickEvent=t),e._completeHide(a)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),r=t.key===h,n=[p,d].includes(t.key);if(!n&&!r)return;if(e&&!r)return;t.preventDefault();const a=this.matches(C)?this:i.prev(this,C)[0]||i.next(this,C)[0]||i.findOne(C,t.delegateTarget.parentNode),o=G.getOrCreateInstance(a);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),a.focus())}}return r.on(document,b,C,G.dataApiKeydownHandler),r.on(document,b,L,G.dataApiKeydownHandler),r.on(document,_,G.clearMenus),r.on(document,w,G.clearMenus),r.on(document,_,C,(function(t){t.preventDefault(),G.getOrCreateInstance(this).toggle()})),a.defineJQueryPlugin(G),G}(r(170),r(11),r(956),r(333),r(411),r(35))},647:function(t,e,r){ /*! - * Bootstrap sanitizer.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap collapse.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -!function(t){"use strict";const e={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),n=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,i=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!r.has(i)||Boolean(n.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))};function a(t,e,r){if(!t.length)return t;if(r&&"function"==typeof r)return r(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),a=[].concat(...n.body.querySelectorAll("*"));for(const t of a){const r=t.nodeName.toLowerCase();if(!Object.keys(e).includes(r)){t.remove();continue}const n=[].concat(...t.attributes),a=[].concat(e["*"]||[],e[r]||[]);for(const e of n)i(e,a)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}t.DefaultAllowlist=e,t.sanitizeHtml=a,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(e)},982:function(t,e,r){ +t.exports=function(t,e,r,n){"use strict";const i="collapse",a=".bs.collapse",o=`show${a}`,s=`shown${a}`,l=`hide${a}`,c=`hidden${a}`,u=`click${a}.data-api`,h="show",f="collapse",p="collapsing",d="collapsed",m=`:scope .${f} .${f}`,g="collapse-horizontal",y="width",v="height",x=".collapse.show, .collapse.collapsing",_='[data-bs-toggle="collapse"]',b={parent:null,toggle:!0},w={parent:"(null|element)",toggle:"boolean"};class T extends t{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const n=r.find(_);for(const t of n){const e=r.getSelectorFromElement(t),n=r.find(e).filter((t=>t===this._element));null!==e&&n.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return b}static get DefaultType(){return w}static get NAME(){return i}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(x).filter((t=>t!==this._element)).map((t=>T.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(e.trigger(this._element,o).defaultPrevented)return;for(const e of t)e.hide();const r=this._getDimension();this._element.classList.remove(f),this._element.classList.add(p),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=()=>{this._isTransitioning=!1,this._element.classList.remove(p),this._element.classList.add(f,h),this._element.style[r]="",e.trigger(this._element,s)},i=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(n,this._element,!0),this._element.style[r]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(e.trigger(this._element,l).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,n.reflow(this._element),this._element.classList.add(p),this._element.classList.remove(f,h);for(const t of this._triggerArray){const e=r.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(p),this._element.classList.add(f),e.trigger(this._element,c)};this._element.style[t]="",this._queueCallback(i,this._element,!0)}_isShown(t=this._element){return t.classList.contains(h)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=n.getElement(t.parent),t}_getDimension(){return this._element.classList.contains(g)?y:v}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(_);for(const e of t){const t=r.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=r.find(m,this._config.parent);return r.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const r of t)r.classList.toggle(d,!e),r.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const r=T.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===r[t])throw new TypeError(`No method named "${t}"`);r[t]()}}))}}return e.on(document,u,_,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of r.getMultipleElementsFromSelector(this))T.getOrCreateInstance(t,{toggle:!1}).toggle()})),n.defineJQueryPlugin(T),T}(r(11),r(956),r(411),r(35))},653:function(t,e,r){ /*! - * Bootstrap template-factory.js v5.3.3 (https://getbootstrap.com/) + * Bootstrap toast.js v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -t.exports=function(t,e,r,n){"use strict";const i="TemplateFactory",a={allowList:r.DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},o={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},s={entry:"(string|element|function|null)",selector:"(string|element)"};class l extends e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return a}static get DefaultType(){return o}static get NAME(){return i}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,r]of Object.entries(this._config.content))this._setContent(t,r,e);const e=t.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&e.classList.add(...r.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,r]of Object.entries(t))super._typeCheckConfig({selector:e,entry:r},s)}_setContent(e,r,i){const a=t.findOne(i,e);a&&((r=this._resolvePossibleFunction(r))?n.isElement(r)?this._putElementInTemplate(n.getElement(r),a):this._config.html?a.innerHTML=this._maybeSanitize(r):a.textContent=r:a.remove())}_maybeSanitize(t){return this._config.sanitize?r.sanitizeHtml(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return n.execute(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}return l}(r(411),r(105),r(812),r(35))},898:(t,e,r)=>{"use strict";r.r(e),r.d(e,{entries:()=>v,keys:()=>g,map:()=>o,nest:()=>s,set:()=>m,values:()=>y});var n="$";function i(){}function a(t,e){var r=new i;if(t instanceof i)t.each((function(t,e){r.set(e,t)}));else if(Array.isArray(t)){var n,a=-1,o=t.length;if(null==e)for(;++a=n.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var c,u,h,f=-1,p=r.length,d=n[i++],m=o(),g=s();++fn.length)return t;var a,o=i[r-1];return null!=e&&r>=n.length?a=t.entries():(a=[],t.each((function(t,e){a.push({key:e,values:s(t,r)})}))),null!=o?a.sort((function(t,e){return o(t.key,e.key)})):a}return r={object:function(t){return a(t,0,l,c)},map:function(t){return a(t,0,u,h)},entries:function(t){return s(a(t,0,u,h),0)},key:function(t){return n.push(t),r},sortKeys:function(t){return i[n.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}}function l(){return{}}function c(t,e,r){t[e]=r}function u(){return o()}function h(t,e,r){t.set(e,r)}function f(){}var p=o.prototype;function d(t,e){var r=new f;if(t instanceof f)t.each((function(t){r.add(t)}));else if(t){var n=-1,i=t.length;if(null==e)for(;++n{var n=r(785);t.exports=function(t,e){var r,i=[],a=[],o=[],s={},l=[];function c(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(e){delete s[t][e],o[e]&&c(e)}))}function u(t){var e,n,i=!1;for(a.push(t),o[t]=!0,e=0;e=e}))}(e);for(var r,i=n(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(t){for(var e=[],r=1;r{"use strict";var t=(()=>{var t=Object.defineProperty,e=Object.defineProperties,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,p=(t,e)=>function(){return t&&(e=(0,t[l(t)[0]])(t=0)),e},d=(t,e)=>function(){return e||(0,t[l(t)[0]])((e={exports:{}}).exports,e),e.exports},m=e=>((e,r,n,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let a of l(r))u.call(e,a)||a===n||t(e,a,{get:()=>r[a],enumerable:!(i=o(r,a))||i.enumerable});return e})(t({},"__esModule",{value:!0}),e),g=d({"src/version.js"(t){t.version="3.0.0"}}),y=d({"node_modules/native-promise-only/lib/npo.src.js"(t,e){var n,i,o;n="Promise",i="undefined"!=typeof window?window:t,o=function(){var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t0&&a(s,r))}catch(t){u.call(new f(r),t)}}}function u(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function h(t,e,r,n){for(var i=0;ie?1:t>=e?0:NaN}function y(t){return null===t?NaN:+t}function v(t){return!isNaN(t)}function x(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}i.ascending=g,i.descending=function(t,e){return et?1:e>=t?0:NaN},i.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},i.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},i.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},i.deviation=function(){var t=i.variance.apply(this,arguments);return t?Math.sqrt(t):t};var _=x(g);function b(t){return t.length}i.bisectLeft=_.left,i.bisect=i.bisectRight=_.right,i.bisector=function(t){return x(1===t.length?function(e,r){return g(t(e),r)}:t)},i.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},i.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},i.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var w=Math.abs;function T(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function k(){this._=Object.create(null)}function A(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function M(t){return"\0"===(t+="")[0]?t.slice(1):t}function S(t){return A(t)in this._}function E(t){return(t=A(t))in this._&&delete this._[t]}function C(){var t=[];for(var e in this._)t.push(M(e));return t}function I(){var t=0;for(var e in this._)++t;return t}function L(){for(var t in this._)return!1;return!0}function P(){this._=Object.create(null)}function z(t){return t}function D(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function O(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=R.length;re;)i.push(n/a);else for(;(n=t+r*++o)=n.length)return e?e.call(r,a):t?a.sort(t):a;for(var l,c,u,h,f=-1,p=a.length,d=n[s++],m=new k;++f=n.length)return t;var r=[],i=a[e++];return t.forEach((function(t,n){r.push({key:t,values:s(n,e)})})),i?r.sort((function(t,e){return i(t.key,e.key)})):r}return r.map=function(t,e){return o(e,t,0)},r.entries=function(t){return s(o(i.map,t,0),0)},r.key=function(t){return n.push(t),r},r.sortKeys=function(t){return a[n.length-1]=t,r},r.sortValues=function(e){return t=e,r},r.rollup=function(t){return e=t,r},r},i.set=function(t){var e=new P;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},i.event=null,i.requote=function(t){return t.replace(q,"\\$&")};var q=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function G(t){return H(t,X),t}var Z=function(t,e){return e.querySelector(t)},W=function(t,e){return e.querySelectorAll(t)},Y=function(t,e){var r=t.matches||t[O(t,"matchesSelector")];return(Y=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Z=function(t,e){return Sizzle(t,e)[0]||null},W=Sizzle,Y=Sizzle.matchesSelector),i.selection=function(){return i.select(l.documentElement)};var X=i.selection.prototype=[];function $(t){return"function"==typeof t?t:function(){return Z(t,this)}}function K(t){return"function"==typeof t?t:function(){return W(t,this)}}X.select=function(t){var e,r,n,i,a=[];t=$(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(r)?{space:Q[r],local:t}:t}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=i.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(tt(e,t[e]));return this}return this.each(tt(t,e))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=nt(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},X.sort=function(t){t=ft.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(t=t.slice(0,a));var l=yt.get(t);function c(){var e=this[n];e&&(this.removeEventListener(t,e,e.$),delete this[n])}return l&&(t=l,o=xt),a?e?function(){var i=o(e,s(arguments));c.call(this),this.addEventListener(t,this[n]=i,i.$=r),i._=e}:c:e?F:function(){var e,r=new RegExp("^__on([^.]+)"+i.requote(t)+"$");for(var n in this)if(e=n.match(r)){var a=this[n];this.removeEventListener(e[1],a,a.$),delete this[n]}}}i.selection.enter=dt,i.selection.enter.prototype=mt,mt.append=X.append,mt.empty=X.empty,mt.node=X.node,mt.call=X.call,mt.size=X.size,mt.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n1?Lt:t<-1?-Lt:Math.asin(t)}function Ot(t){return((t=Math.exp(t))+1/t)/2}var Rt=Math.SQRT2;i.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-a,f=u*u+h*h;if(f0&&(t=t.transition().duration(m)),t.call(w.event)}function S(){s&&s.domain(o.range().map((function(t){return(t-f.x)/f.k})).map(o.invert)),h&&h.domain(c.range().map((function(t){return(t-f.y)/f.k})).map(c.invert))}function E(t){g++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function I(t){--g||(t({type:"zoomend"}),e=null)}function L(){var t=this,e=b.of(t,arguments),r=0,n=i.select(u(t)).on(v,(function(){r=1,A(i.mouse(t),a),C(e)})).on(x,(function(){n.on(v,null).on(x,null),o(r),I(e)})),a=T(i.mouse(t)),o=wt(t);$i.call(t),E(e)}function P(){var t,e=this,r=b.of(e,arguments),n={},o=0,s=".zoom-"+i.event.changedTouches[0].identifier,l="touchmove"+s,c="touchend"+s,u=[],h=i.select(e),p=wt(e);function d(){var r=i.touches(e);return t=f.k,r.forEach((function(t){t.identifier in n&&(n[t.identifier]=T(t))})),r}function m(){var t=i.event.target;i.select(t).on(l,g).on(c,v),u.push(t);for(var r=i.event.changedTouches,s=0,h=r.length;s1){y=p[0];var x=p[1],_=y[0]-x[0],b=y[1]-x[1];o=_*_+b*b}}function g(){var s,l,c,u,h=i.touches(e);$i.call(e);for(var f=0,p=h.length;f360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ie(a(t+120),a(t),a(t-120))}function Ht(t,e,r){return this instanceof Ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Ht?new Ht(t.h,t.c,t.l):te(t instanceof Wt?t.l:(t=he((t=i.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ht(t,e,r)}Vt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},Vt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},Vt.rgb=function(){return qt(this.h,this.s,this.l)},i.hcl=Ht;var Gt=Ht.prototype=new Nt;function Zt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Wt(r,Math.cos(t*=Pt)*e,Math.sin(t)*e)}function Wt(t,e,r){return this instanceof Wt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Wt?new Wt(t.l,t.a,t.b):t instanceof Ht?Zt(t.h,t.c,t.l):he((t=ie(t)).r,t.g,t.b):new Wt(t,e,r)}Gt.brighter=function(t){return new Ht(this.h,this.c,Math.min(100,this.l+Yt*(arguments.length?t:1)))},Gt.darker=function(t){return new Ht(this.h,this.c,Math.max(0,this.l-Yt*(arguments.length?t:1)))},Gt.rgb=function(){return Zt(this.h,this.c,this.l).rgb()},i.lab=Wt;var Yt=18,Xt=.95047,$t=1,Kt=1.08883,Jt=Wt.prototype=new Nt;function Qt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ie(ne(3.2404542*(i=ee(i)*Xt)-1.5371385*(n=ee(n)*$t)-.4985314*(a=ee(a)*Kt)),ne(-.969266*i+1.8760108*n+.041556*a),ne(.0556434*i-.2040259*n+1.0572252*a))}function te(t,e,r){return t>0?new Ht(Math.atan2(r,e)*zt,Math.sqrt(e*e+r*r),t):new Ht(NaN,NaN,t)}function ee(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function re(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ne(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ie(t,e,r){return this instanceof ie?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ie?new ie(t.r,t.g,t.b):ce(""+t,ie,qt):new ie(t,e,r)}function ae(t){return new ie(t>>16,t>>8&255,255&t)}function oe(t){return ae(t)+""}Jt.brighter=function(t){return new Wt(Math.min(100,this.l+Yt*(arguments.length?t:1)),this.a,this.b)},Jt.darker=function(t){return new Wt(Math.max(0,this.l-Yt*(arguments.length?t:1)),this.a,this.b)},Jt.rgb=function(){return Qt(this.l,this.a,this.b)},i.rgb=ie;var se=ie.prototype=new Nt;function le(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=de.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function ue(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ut(n,i,l)}function he(t,e,r){var n=re((.4124564*(t=fe(t))+.3575761*(e=fe(e))+.1804375*(r=fe(r)))/Xt),i=re((.2126729*t+.7151522*e+.072175*r)/$t);return Wt(116*i-16,500*(n-i),200*(i-re((.0193339*t+.119192*e+.9503041*r)/Kt)))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}se.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=r.call(a,c)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(t){var e=i.event;i.event=t;try{o.progress.call(a,c)}finally{i.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach((function(t){a[t]=function(){return a.send.apply(a,[t].concat(s(arguments)))}})),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),c.setRequestHeader)for(var s in l)c.setRequestHeader(s,l[s]);return null!=e&&c.overrideMimeType&&c.overrideMimeType(e),null!=u&&(c.responseType=u),null!=i&&a.on("error",i).on("load",(function(t){i(null,t)})),o.beforesend.call(a,c),c.send(null==n?null:n),a},a.abort=function(){return c.abort(),a},i.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}de.forEach((function(t,e){de.set(t,ae(e))})),i.functor=me,i.xhr=ge(z),i.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(be),be=setTimeout(ke,e)),_e=0):(_e=1,we(ke))}function Ae(){for(var t=Date.now(),e=ve;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Me(){for(var t,e=ve,r=1/0;e;)e.c?(e.t1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function Ie(t,e){return t[0]-e[0]||t[1]-e[1]}i.timer=function(){Te.apply(this,arguments)},i.timer.flush=function(){Ae(),Me()},i.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},i.geom={},i.geom.hull=function(t){var e=Se,r=Ee;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=me(e),a=me(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;nMt)s=s.L;else{if(!((i=a-Ye(s,o))>Mt)){n>-Mt?(e=s.P,r=s):i>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=qe(t);if(Fe.insert(e,l),e||r){if(e===r)return Qe(e),r=qe(e.site),Fe.insert(l,r),l.edge=r.edge=rr(e.site,l.site),Je(e),void Je(r);if(r){Qe(e),Qe(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,p=t.y-h,d=r.site,m=d.x-u,g=d.y-h,y=2*(f*g-p*m),v=f*f+p*p,x=m*m+g*g,_={x:(g*v-p*x)/y+u,y:(f*x-m*v)/y+h};ir(r.edge,c,d,_),l.edge=rr(c,t,null,_),r.edge=rr(t,d,null,_),Je(e),Je(r)}else l.edge=rr(e.site,l.site)}}function We(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function Ye(t,e){var r=t.N;if(r)return We(r,e);var n=t.site;return n.y===e?n.x:1/0}function Xe(t){this.site=t,this.edges=[]}function $e(t,e){return e.angle-t.angle}function Ke(){sr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Je(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-St)){var f=l*l+c*c,p=u*u+g*g,d=(g*f-c*p)/h,m=(l*p-u*f)/h,g=m+s,y=Ue.pop()||new Ke;y.arc=t,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,t.circle=y;for(var v=null,x=Be._;x;)if(y.y=s)return;if(f>d){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(f>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=f,f<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=i-l,f||!(e<0)){if(e/=f,f<0){if(e>h)return;e>u&&(u=e)}else if(f>0){if(e0)){if(e/=p,p<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=a-c,p||!(e<0)){if(e/=p,p<0){if(e>h)return;e>u&&(u=e)}else if(p>0){if(e0&&(t.a={x:l+u*f,y:c+u*p}),h<1&&(t.b={x:l+h*f,y:c+h*p}),t}}}}}),l=o.length;l--;)(!tr(e=o[l],t)||!s(e)||w(e.a.x-e.b.x)Mt||w(i-r)>Mt)&&(s.splice(o,0,new ar(nr(a.site,u,w(n-h)Mt?{x:h,y:w(e-h)Mt?{x:w(r-d)Mt?{x:f,y:w(e-f)Mt?{x:w(r-p)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Mt)*Mt,y:Math.round(i(t,e)/Mt)*Mt,i:e}}))}return o.links=function(t){return hr(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return hr(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort($e),u=-1,h=c.length,f=c[h-1].edge,p=f.l===l?f.r:f.l;++ua&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:xr(r,n)})),a=wr.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;hm&&(m=x),_>g&&(g=_),c.push(x),u.push(_)}var b=m-p,T=g-d;function k(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(w(l-r)+w(c-n)<.01)A(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,f=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,k(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}b>T?g=d+b:m=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(M,t,+y(t,++h),+v(t,h),p,d,m,g)},visit:function(t){gr(t,M,p,d,m,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,f,p){if(!(u>a||h>o||f=b)<<1|e>=_,T=w+4;w=0&&!(r=i.interpolators[n](t,e)););return r}function kr(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function zr(t){return 1-Math.cos(t*Lt)}function Dr(t){return Math.pow(2,10*(t-1))}function Or(t){return 1-Math.sqrt(1-t*t)}function Rr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Fr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function jr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Nr(i),s=Br(i,a),l=Nr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,r):t,i=r>=0?t.slice(r+1):"in";return n=Mr.get(n)||Ar,i=Sr.get(i)||z,e=i(n.apply(null,o.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},i.interpolateHcl=function(t,e){t=i.hcl(t),e=i.hcl(e);var r=t.h,n=t.c,a=t.l,o=e.h-r,s=e.c-n,l=e.l-a;return isNaN(s)&&(s=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return Zt(r+o*t,n+s*t,a+l*t)+""}},i.interpolateHsl=function(t,e){t=i.hsl(t),e=i.hsl(e);var r=t.h,n=t.s,a=t.l,o=e.h-r,s=e.s-n,l=e.l-a;return isNaN(s)&&(s=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return qt(r+o*t,n+s*t,a+l*t)+""}},i.interpolateLab=function(t,e){t=i.lab(t),e=i.lab(e);var r=t.l,n=t.a,a=t.b,o=e.l-r,s=e.a-n,l=e.b-a;return function(t){return Qt(r+o*t,n+s*t,a+l*t)+""}},i.interpolateRound=Fr,i.transform=function(t){var e=l.createElementNS(i.ns.prefix.svg,"g");return(i.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new jr(r?r.matrix:Ur)})(t)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Ur={a:1,b:0,c:0,d:1,e:0,f:0};function Vr(t){return t.length?t.pop()+",":""}function qr(t,e){var r=[],n=[];return t=i.transform(t),e=i.transform(e),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:xr(t[0],e[0])},{i:i-2,x:xr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(t.translate,e.translate,r,n),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Vr(r)+"rotate(",null,")")-2,x:xr(t,e)})):e&&r.push(Vr(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(Vr(r)+"skewX(",null,")")-2,x:xr(t,e)}):e&&r.push(Vr(r)+"skewX("+e+")")}(t.skew,e.skew,r,n),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Vr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:xr(t[0],e[0])},{i:i-2,x:xr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Vr(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i0?r=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):e>0&&(l.start({type:"start",alpha:r=e}),t=Te(s.tick)),s):r},s.start=function(){var t,e,r,i=y.length,l=v.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function an(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return an(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(nn(t,(function(t){t.children&&(t.value=0)})),an(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},i.layout.partition=function(){var t=i.layout.hierarchy(),e=[1,1];function r(t,e,n,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=n,t.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=t.value?n/t.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function xn(t){return t.reduce(_n,0)}function _n(t,e){return t+e[1]}function bn(t,e){return wn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Tn(t){return[i.min(t),i.max(t)]}function kn(t,e){return t.value-e.value}function An(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Mn(t,e){t._pack_next=e,e._pack_prev=t}function Sn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function En(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,f=-1/0;if(e.forEach(Cn),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(Pn(r,n,i=e[2]),x(i),An(r,i),r._pack_prev=i,An(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&((s=c[i.bisect(f,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(e=t,a):e},a.range=function(t){return arguments.length?(r=me(t),a):r},a.bins=function(t){return arguments.length?(n="number"==typeof t?function(e){return wn(e,t)}:me(t),a):n},a.frequency=function(e){return arguments.length?(t=!!e,a):t},a},i.layout.pack=function(){var t,e=i.layout.hierarchy().sort(kn),r=0,n=[1,1];function a(i,a){var o=e.call(this,i,a),s=o[0],l=n[0],c=n[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,an(s,(function(t){t.r=+u(t.value)})),an(s,En),r){var h=r*(t?1:Math.max(2*s.r/l,2*s.r/c))/2;an(s,(function(t){t.r+=h})),an(s,En),an(s,(function(t){t.r-=h}))}return Ln(s,l/2,c/2,t?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(n=t,a):n},a.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,a):t},a.padding=function(t){return arguments.length?(r=+t,a):r},rn(a,e)},i.layout.tree=function(){var t=i.layout.hierarchy().sort(null).value(null),e=zn,r=[1,1],n=null;function a(i,a){var c=t.call(this,i,a),u=c[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;op.x&&(p=t),t.depth>d.depth&&(d=t)}));var m=e(f,p)/2-f.x,g=r[0]/(p.x+e(p,f)/2+m),y=r[1]/(d.depth||1);nn(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return c}function o(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=On(s),a=Dn(a),s&&a;)l=Dn(l),(o=On(o)).a=t,(i=s.z+h-a.z-c+e(s._,a._))>0&&(Rn(Fn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!On(o)&&(o.t=s,o.m+=h-u),a&&!Dn(l)&&(l.t=a,l.m+=c-f,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=r[0],t.y=t.depth*r[1]}return a.separation=function(t){return arguments.length?(e=t,a):e},a.size=function(t){return arguments.length?(n=null==(r=t)?l:null,a):n?null:r},a.nodeSize=function(t){return arguments.length?(n=null==(r=t)?null:l,a):n?r:null},rn(a,t)},i.layout.cluster=function(){var t=i.layout.hierarchy().sort(null).value(null),e=zn,r=[1,1],n=!1;function a(a,o){var s,l=t.call(this,a,o),c=l[0],u=0;an(c,(function(t){var r=t.children;r&&r.length?(t.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(r),t.y=function(t){return 1+i.max(t,(function(t){return t.y}))}(r)):(t.x=s?u+=e(t,s):0,t.y=0,s=t)}));var h=jn(c),f=Bn(c),p=h.x-e(h,f)/2,d=f.x+e(f,h)/2;return an(c,n?function(t){t.x=(t.x-c.x)*r[0],t.y=(c.y-t.y)*r[1]}:function(t){t.x=(t.x-p)/(d-p)*r[0],t.y=(1-(c.y?t.y/c.y:1))*r[1]}),l}return a.separation=function(t){return arguments.length?(e=t,a):e},a.size=function(t){return arguments.length?(n=null==(r=t),a):n?null:r},a.nodeSize=function(t){return arguments.length?(n=null!=(r=t),a):n?r:null},rn(a,t)},i.layout.treemap=function(){var t,e=i.layout.hierarchy(),r=Math.round,n=[1,1],a=null,o=Nn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(h)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(f)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,n,i){var a,o=-1,s=t.length,l=n.x,c=n.y,u=e?r(t.area/e):0;if(e==n.dx){for((i||u>n.dy)&&(u=n.dy);++on.dx)&&(u=n.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=i.random.normal.apply(i,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=i.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?Yn:Hn,l=n?Gr:Hr;return i=o(t,e,l,r),a=o(e,t,l,Tr),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(Fr)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return Qn(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Kn(t,e),o()},s.copy=function(){return Xn(t,e,r,n)},o()}function $n(t,e){return i.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Kn(t,e){return Gn(t,Zn(Jn(t,e)[2])),Gn(t,Zn(Jn(t,e)[2])),t}function Jn(t,e){null==e&&(e=10);var r=Vn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Qn(t,e){return i.range.apply(i,Jn(t,e))}function ti(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Gn(n.map(i),r?Math:ei);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Vn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;f--)o.push(a(c)*f);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.copy=function(){return ti(t.copy(),e,r,n)},$n(o,t)}i.scale.linear=function(){return Xn([0,1],[0,1],Tr,!1)},i.scale.log=function(){return ti(i.scale.linear().domain([0,1]),10,!0,[1,10])};var ei={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function ri(t,e,r){var n=ni(e),i=ni(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return Qn(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Kn(r,t))},a.exponent=function(o){return arguments.length?(n=ni(e=o),i=ni(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return ri(t.copy(),e,r)},$n(a,t)}function ni(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ii(t,e){var r,n,a;function o(i){return n[((r.get(i)||("range"===e.t?r.set(i,t.push(i)):NaN))-1)%n.length]}function s(e,r){return i.range(t.length).map((function(t){return e+r*t}))}return o.domain=function(n){if(!arguments.length)return t;t=[],r=new k;for(var i,a=-1,s=n.length;++a0?r[n-1]:t[0],nh?0:1;if(c=It)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,m,g,y,v,x,_,b,w,T,k,A,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===di?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=Dt(g/c*Math.sin(y))),s&&(M=Dt(g/s*Math.sin(y)))),c){v=c*Math.cos(u+S),x=c*Math.sin(u+S),_=c*Math.cos(h-S),b=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=Et?0:1;if(S&&_i(v,x,_,b)===p^C){var I=(u+h)/2;v=c*Math.cos(I),x=c*Math.sin(I),_=b=null}}else v=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),k=s*Math.cos(u+M),A=s*Math.sin(u+M);var L=Math.abs(u-h+2*M)<=Et?0:1;if(M&&_i(w,T,k,A)===1-p^L){var P=(u+h)/2;w=s*Math.cos(P),T=s*Math.sin(P),k=A=null}}else w=T=0;if(f>Mt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function bi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,p=e[1]+c,d=(u+f)/2,m=(h+p)/2,g=f-u,y=p-h,v=g*g+y*y,x=r-n,_=u*p-f*h,b=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-_*_)),w=(_*y-g*b)/v,T=(-_*g-y*b)/v,k=(_*y+g*b)/v,A=(-_*g+y*b)/v,M=w-d,S=T-m,E=k-d,C=A-m;return M*M+S*S>E*E+C*C&&(w=k,T=A),[[w-l,T-c],[w*r/x,T*r/x]]}function wi(){return!0}function Ti(t){var e=Se,r=Ee,n=wi,i=Ai,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,f=me(e),p=me(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]),i.join("")},"step-before":Si,"step-after":Ei,basis:Li,"basis-open":function(t){if(t.length<4)return Ai(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Pi(Oi,a)+","+Pi(Oi,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Ai(t){return t.length>1?t.join("L"):t+"Z"}function Mi(t){return t.join("L")+"Z"}function Si(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;cEt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=me(t),a):r},a.source=function(e){return arguments.length?(t=me(e),a):t},a.target=function(t){return arguments.length?(e=me(t),a):e},a.startAngle=function(t){return arguments.length?(n=me(t),a):n},a.endAngle=function(t){return arguments.length?(i=me(t),a):i},a},i.svg.diagonal=function(){var t=Ni,e=Ui,r=qi;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=me(e),n):t},n.target=function(t){return arguments.length?(e=me(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},i.svg.diagonal.radial=function(){var t=i.svg.diagonal(),e=qi,r=t.projection;return t.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Lt;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},i.svg.symbol=function(){var t=Gi,e=Hi;function r(r,n){return(Wi.get(t.call(this,r,n))||Zi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=me(e),r):t},r.size=function(t){return arguments.length?(e=me(t),r):e},r};var Wi=i.map({circle:Zi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Xi)),r=e*Xi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Yi),r=e*Yi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Yi),r=e*Yi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});i.svg.symbolTypes=Wi.keys();var Yi=Math.sqrt(3),Xi=Math.tan(30*Pt);X.transition=function(t){for(var e,r,n=Qi||++ra,i=aa(t),a=[],o=ta||{time:Date.now(),ease:Pr,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=Te((function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f}),0,a),h=u[n]={tween:new k,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}ea.call=X.call,ea.empty=X.empty,ea.node=X.node,ea.size=X.size,i.transition=function(t,e){return t&&t.transition?Qi?t.transition(e):t:i.selection().transition(t)},i.transition.prototype=ea,ea.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=$(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",o[1]-o[0])}function m(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function g(){var h,g,y=this,v=i.select(i.event.target),x=r.of(y,arguments),_=i.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&n,T=!/^(e|w)$/.test(b)&&a,k=v.classed("extent"),A=wt(y),M=i.mouse(y),S=i.select(u(y)).on("keydown.brush",(function(){32==i.event.keyCode&&(k||(h=null,M[0]-=o[1],M[1]-=s[1],k=2),N())})).on("keyup.brush",(function(){32==i.event.keyCode&&2==k&&(M[0]+=o[1],M[1]+=s[1],k=0,N())}));if(i.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",P):S.on("mousemove.brush",I).on("mouseup.brush",P),_.interrupt().selectAll("*").interrupt(),k)M[0]=o[0]-M[0],M[1]=s[0]-M[1];else if(b){var E=+/w$/.test(b),C=+/^n/.test(b);g=[o[1-E]-M[0],s[1-C]-M[1]],M[0]=o[E],M[1]=s[C]}else i.event.altKey&&(h=M.slice());function I(){var t=i.mouse(y),e=!1;g&&(t[0]+=g[0],t[1]+=g[1]),k||(i.event.altKey?(h||(h=[(o[0]+o[1])/2,(s[0]+s[1])/2]),M[0]=o[+(t[0]0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*o)}),(function(t,e){return(e-t)/o}),(function(t){return t.getUTCSeconds()})),f=h.range,p=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getMinutes()})),d=p.range,m=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o-t.getMinutes()*s)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getHours()})),g=m.range,y=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/c}),(function(t){return t.getDate()-1})),v=y.range;function x(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/u}))}var _=x(0),b=x(1),w=x(2),T=x(3),k=x(4),A=x(5),M=x(6),S=_.range,E=b.range,C=w.range,I=T.range,L=k.range,P=A.range,z=M.range,D=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=D.range,R=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));R.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var F=R.range,j=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCMinutes()})),B=j.range,N=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getUTCHours()})),U=N.range,V=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCDate()-1})),q=V.range;function H(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/u}))}var G=H(0),Z=H(1),W=H(2),Y=H(3),X=H(4),$=H(5),K=H(6),J=G.range,Q=Z.range,tt=W.range,et=Y.range,rt=X.range,nt=$.range,it=K.range,at=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ot=at.range,st=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));st.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var lt=st.range;t.timeDay=y,t.timeDays=v,t.timeFriday=A,t.timeFridays=P,t.timeHour=m,t.timeHours=g,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=p,t.timeMinutes=d,t.timeMonday=b,t.timeMondays=E,t.timeMonth=D,t.timeMonths=O,t.timeSaturday=M,t.timeSaturdays=z,t.timeSecond=h,t.timeSeconds=f,t.timeSunday=_,t.timeSundays=S,t.timeThursday=k,t.timeThursdays=L,t.timeTuesday=w,t.timeTuesdays=C,t.timeWednesday=T,t.timeWednesdays=I,t.timeWeek=_,t.timeWeeks=S,t.timeYear=R,t.timeYears=F,t.utcDay=V,t.utcDays=q,t.utcFriday=$,t.utcFridays=nt,t.utcHour=N,t.utcHours=U,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=j,t.utcMinutes=B,t.utcMonday=Z,t.utcMondays=Q,t.utcMonth=at,t.utcMonths=ot,t.utcSaturday=K,t.utcSaturdays=it,t.utcSecond=h,t.utcSeconds=f,t.utcSunday=G,t.utcSundays=J,t.utcThursday=X,t.utcThursdays=rt,t.utcTuesday=W,t.utcTuesdays=tt,t.utcWednesday=Y,t.utcWednesdays=et,t.utcWeek=G,t.utcWeeks=J,t.utcYear=st,t.utcYears=lt,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),_=d({"node_modules/d3-time-format/dist/d3-time-format.js"(t,e){var o;o=function(t,e){function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,c=t.periods,u=t.days,h=t.shortDays,f=t.months,vt=t.shortMonths,xt=p(c),_t=d(c),bt=p(u),wt=d(u),Tt=p(h),kt=d(h),At=p(f),Mt=d(f),St=p(vt),Et=d(vt),Ct={a:function(t){return h[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return f[t.getMonth()]},c:null,d:O,e:O,f:N,H:R,I:F,j,L:B,m:U,M:V,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:H,U:G,V:Z,w:W,W:Y,x:null,X:null,y:X,Y:$,Z:K,"%":mt},It={a:function(t){return h[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:J,e:J,f:nt,H:Q,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ct,w:ut,W:ht,x:null,X:null,y:ft,Y:pt,Z:dt,"%":mt},Lt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Dt(t,a,e,r)},d:A,e:A,f:L,H:S,I:S,j:M,L:I,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=_t[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:D,S:C,u:g,U:y,V:v,w:m,W:x,x:function(t,e,r){return Dt(t,o,e,r)},X:function(t,e,r){return Dt(t,l,e,r)},y:b,Y:_,Z:w,"%":P};function Pt(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Dt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Lt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ct.x=Pt(o,Ct),Ct.X=Pt(l,Ct),Ct.c=Pt(a,Ct),It.x=Pt(o,It),It.X=Pt(l,It),It.c=Pt(a,It),{format:function(t){var e=Pt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Pt(t+="",It);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return h(t.getDate(),e,2)}function R(t,e){return h(t.getHours(),e,2)}function F(t,e){return h(t.getHours()%12||12,e,2)}function j(t,r){return h(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return h(t.getMilliseconds(),e,3)}function N(t,e){return B(t,e)+"000"}function U(t,e){return h(t.getMonth()+1,e,2)}function V(t,e){return h(t.getMinutes(),e,2)}function q(t,e){return h(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return h(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Z(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),h(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function Y(t,r){return h(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function X(t,e){return h(t.getFullYear()%100,e,2)}function $(t,e){return h(t.getFullYear()%1e4,e,4)}function K(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function J(t,e){return h(t.getUTCDate(),e,2)}function Q(t,e){return h(t.getUTCHours(),e,2)}function tt(t,e){return h(t.getUTCHours()%12||12,e,2)}function et(t,r){return h(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return h(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return h(t.getUTCMonth()+1,e,2)}function at(t,e){return h(t.getUTCMinutes(),e,2)}function ot(t,e){return h(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return h(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),h(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ht(t,r){return h(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ft(t,e){return h(t.getUTCFullYear()%100,e,2)}function pt(t,e){return h(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function yt(t){return Math.floor(+t/1e3)}function vt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xt="%Y-%m-%dT%H:%M:%S.%LZ",_t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(xt),bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(xt);t.isoFormat=_t,t.isoParse=bt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?o(t,x()):(i=[t,r(552)],void 0===(a="function"==typeof(n=o)?n.apply(t,i):n)||(e.exports=a))}}),b=d({"node_modules/d3-format/dist/d3-format.js"(t,e){var r;r=function(t){function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,h=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e,i,o=void 0===t.grouping||void 0===t.thousands?c:(e=h.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var n=t.length,a=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",p=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(h.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",y=void 0===t.nan?"NaN":t.nan+"";function v(t){var e=(t=a(t)).fill,r=t.align,i=t.sign,c=t.symbol,h=t.zero,v=t.width,x=t.comma,_=t.precision,b=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===_&&(_=12),b=!0,w="g"),(h||"0"===e&&"="===r)&&(h=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?m:"",A=l[w],M=/[defgprs%]/.test(w);function S(t){var a,s,l,c=T,u=k;if("c"===w)u=A(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?y:A(Math.abs(t),_),b&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?f[8+n/3]:"")+u+(m&&"("===i?")":""),M)for(a=-1,s=t.length;++a(l=t.charCodeAt(a))||l>57){u=(46===l?p+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}x&&!h&&(t=o(t,1/0));var S=c.length+t.length+u.length,E=S>1)+c+t+u+E.slice(S);break;default:t=E+c+t+u}return d(t)}return _=void 0===_?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:v,formatPrefix:function(t,e){var n=v(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=f[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),w=d({"node_modules/is-string-blank/index.js"(t,e){e.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}}}),T=d({"node_modules/fast-isnumeric/index.js"(t,e){var r=w();e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0==(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}}}),k=d({"src/constants/numerical.js"(t,e){e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}}}),A=d({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(t,e){var r;r=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[e.charCodeAt(n)]=n;t.decode=function(t){var e,n,i,a,o,s=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(e=0;e>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},t.encode=function(t){var r,n=new Uint8Array(t),i=n.length,a="";for(r=0;r>2],a+=e[(3&n[r])<<4|n[r+1]>>4],a+=e[(15&n[r+1])<<2|n[r+2]>>6],a+=e[63&n[r+2]];return i%3==2?a=a.substring(0,a.length-1)+"=":i%3==1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),M=d({"src/lib/is_plain_object.js"(t,e){e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}}}),S=d({"src/lib/array.js"(t){var e=A().decode,r=M(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}t.isTypedArray=o,t.isArrayOrTypedArray=s,t.isArray1D=function(t){return!s(t[0])},t.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t};var l={u1c:"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"==typeof Int8Array?void 0:Int8Array,u1:"undefined"==typeof Uint8Array?void 0:Uint8Array,i2:"undefined"==typeof Int16Array?void 0:Int16Array,u2:"undefined"==typeof Uint16Array?void 0:Uint16Array,i4:"undefined"==typeof Int32Array?void 0:Int32Array,u4:"undefined"==typeof Uint32Array?void 0:Uint32Array,f4:"undefined"==typeof Float32Array?void 0:Float32Array,f8:"undefined"==typeof Float64Array?void 0:Float64Array};function c(t){return t.constructor===ArrayBuffer}function u(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}}}),P=d({"src/lib/relink_private.js"(t,e){var r=S().isArrayOrTypedArray,n=M();e.exports=function t(e,i){for(var a in i){var o=i[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in e)continue;e[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;ce/2?t-Math.round(t/e)*e:t}}}}),D=d({"node_modules/tinycolor2/tinycolor.js"(t,e){!function(n){var i=/^\s+/,o=/\s+$/,s=0,l=n.round,c=n.min,u=n.max,h=n.random;function f(t,e){if(e=e||{},(t=t||"")instanceof f)return t;if(!(this instanceof f))return new f(t,e);var r=function(t){var e,r,a,s={r:0,g:0,b:0},l=1,h=null,f=null,p=null,d=!1,m=!1;return"string"==typeof t&&(t=function(t){t=t.replace(i,"").replace(o,"").toLowerCase();var e,r=!1;if(I[t])t=I[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=q.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=q.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=q.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=q.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=q.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=q.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=q.hex8.exec(t))?{r:O(e[1]),g:O(e[2]),b:O(e[3]),a:B(e[4]),format:r?"name":"hex8"}:(e=q.hex6.exec(t))?{r:O(e[1]),g:O(e[2]),b:O(e[3]),format:r?"name":"hex"}:(e=q.hex4.exec(t))?{r:O(e[1]+""+e[1]),g:O(e[2]+""+e[2]),b:O(e[3]+""+e[3]),a:B(e[4]+""+e[4]),format:r?"name":"hex8"}:!!(e=q.hex3.exec(t))&&{r:O(e[1]+""+e[1]),g:O(e[2]+""+e[2]),b:O(e[3]+""+e[3]),format:r?"name":"hex"}}(t)),"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(e=t.r,r=t.g,a=t.b,s={r:255*z(e,255),g:255*z(r,255),b:255*z(a,255)},d=!0,m="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(h=F(t.s),f=F(t.v),s=function(t,e,r){t=6*z(t,360),e=z(e,100),r=z(r,100);var i=n.floor(t),a=t-i,o=r*(1-e),s=r*(1-a*e),l=r*(1-(1-a)*e),c=i%6,u=[r,s,o,o,l,r][c],h=[l,r,r,s,o,o][c],f=[o,o,l,r,r,s][c];return{r:255*u,g:255*h,b:255*f}}(t.h,h,f),d=!0,m="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(h=F(t.s),p=F(t.l),s=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=z(t,360),e=z(e,100),r=z(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(t.h,h,p),d=!0,m="hsl"),t.hasOwnProperty("a")&&(l=t.a)),l=P(l),{ok:d,format:t.format||m,r:c(255,u(s.r,0)),g:c(255,u(s.g,0)),b:c(255,u(s.b,0)),a:l}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=s++}function p(t,e,r){t=z(t,255),e=z(e,255),r=z(r,255);var n,i,a=u(t,e,r),o=c(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(f(n));return a}function C(t,e){e=e||6;for(var r=f(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(f({h:n,s:i,v:a})),a=(a+s)%1;return o}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,i=this.toRgb();return t=i.r/255,e=i.g/255,r=i.b/255,.2126*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:n.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=P(t),this._roundA=l(100*this._a)/100,this},toHsv:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=d(this._r,this._g,this._b),e=l(360*t.h),r=l(100*t.s),n=l(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=l(360*t.h),r=l(100*t.s),n=l(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return m(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var a=[R(l(t).toString(16)),R(l(e).toString(16)),R(l(r).toString(16)),R(j(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*z(this._r,255))+"%",g:l(100*z(this._g,255))+"%",b:l(100*z(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*z(this._r,255))+"%, "+l(100*z(this._g,255))+"%, "+l(100*z(this._b,255))+"%)":"rgba("+l(100*z(this._r,255))+"%, "+l(100*z(this._g,255))+"%, "+l(100*z(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+g(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=f(t);r="#"+g(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(_,arguments)},brighten:function(){return this._applyModification(b,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},f.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:F(t[n]));t=r}return f(t,e)},f.equals=function(t,e){return!(!t||!e)&&f(t).toRgbString()==f(e).toRgbString()},f.random=function(){return f.fromRatio({r:h(),g:h(),b:h()})},f.mix=function(t,e,r){r=0===r?0:r||50;var n=f(t).toRgb(),i=f(e).toRgb(),a=r/100;return f({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},f.readability=function(t,e){var r=f(t),i=f(e);return(n.max(r.getLuminance(),i.getLuminance())+.05)/(n.min(r.getLuminance(),i.getLuminance())+.05)},f.isReadable=function(t,e,r){var n,i,a,o,s,l=f.readability(t,e);switch(i=!1,(a=r,o=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(a.size||"small").toLowerCase(),"AA"!==o&&"AAA"!==o&&(o="AA"),"small"!==s&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},f.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=f(e[c]));return f.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,f.mostReadable(t,["#fff","#000"],r))};var I=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=f.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(I);function P(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function z(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=c(e,u(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),n.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function D(t){return c(1,u(0,t))}function O(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function F(t){return t<=1&&(t=100*t+"%"),t}function j(t){return n.round(255*parseFloat(t)).toString(16)}function B(t){return O(t)/255}var N,U,V,q=(U="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",V="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+V),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(t){return!!q.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=f:void 0===(a=function(){return f}.call(t,r,t,e))||(e.exports=a)}(Math)}}),O=d({"src/lib/extend.js"(t){var e=M(),r=Array.isArray;function n(t,i,a,o){var s,l,c,u,h,f,p,d=t[0],m=t.length;if(2===m&&r(d)&&r(t[1])&&0===d.length){if(p=function(t,e){var r,n;for(r=0;r=0))return t;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return t}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(r(t))},a.opacity=function(t){return t?r(t).getAlpha():0},a.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},a.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var i=r(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(t,e,n){var i=r(t).toRgb(),a=r(e).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(t,e,n){var i=r(t);return 1!==i.getAlpha()&&(i=r(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:n?i.darken(n):s).toString()},a.stroke=function(t,e){var n=r(e);t.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(t,e){var n=r(e);t.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,o,s=Object.keys(t);for(e=0;ei.max?r.set(n):r.set(+t)}},integer:{coerceFunction:function(t,r,n,i){-1===(i.extras||[]).indexOf(t)?(f(t)&&(t=p(t)),t%1||!e(t)||void 0!==i.min&&ti.max?r.set(n):r.set(+t)):r.set(t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,n){f(t)&&(t=p(t)),r(t).isValid()?e.set(t):e.set(n)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every((function(t){return r(t).isValid()}))?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,r){e.set(a.get(t,r))}},angle:{coerceFunction:function(t,r,n){f(t)&&(t=p(t)),"auto"===t?r.set("auto"):e(t)?r.set(u(+t,360)):r.set(n)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||c(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a/g),l=0;l1){var e=["LOG:"];for(t=0;t1){var i=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(r.logging>0){var e=["WARN:"];for(t=0;t0){var i=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(r.logging>0){var e=["ERROR:"];for(t=0;t0){var i=[];for(t=0;t"),"stick")}}}}),$=d({"src/lib/noop.js"(t,e){e.exports=function(){}}}),K=d({"src/lib/push_unique.js"(t,e){e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n0){for(var n=[],i=0;i=e&&n<=r?n:l}if("string"!=typeof n&&"number"!=typeof n)return l;n=String(n);var _=x(i),b=n.charAt(0);!_||"G"!==b&&"g"!==b||(n=n.substr(1),i="");var w=_&&"chinese"===i.substr(0,7),T=n.match(w?y:g);if(!T)return l;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(_){if(2===k.length)return l;var I;k=Number(k);try{var L=d.getComponentMethod("calendars","getCal")(i);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),I=L.newDate(k,L.toMonthIndex(k,A,P),M)}else I=L.newDate(k,Number(A),M)}catch(t){return l}return I?(I.toJD()-p)*c+S*u+E*h+C*f:l}k=2===k.length?(Number(k)+2e3-v)%100+v:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?l:z.getTime()+C*f},e=t.MIN_MS=t.dateTime2ms("-9999"),r=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==l};var w=90*c,A=3*u,M=5*h;function S(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+b(e,2)+":"+b(r,2),(n||i)&&(t+=":"+b(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+b(i,a)}return t}t.ms2DateTime=function(t,n,i){if("number"!=typeof t||!(t>=e&&t<=r))return l;n||(n=0);var a,s,g,y,v,_,b=Math.floor(10*o(t+.05,1)),T=Math.round(t-b/10);if(x(i)){var k=Math.floor(T/c)+p,E=Math.floor(o(t,c));try{a=d.getComponentMethod("calendars","getCal")(i).fromJD(k).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(T))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n=e+c&&t<=r-c))return l;var i=Math.floor(10*o(t+.05,1)),a=new Date(Math.round(t-i/10));return S(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},t.cleanDate=function(e,r,n){if(e===l)return r;if(t.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return a.error("unrecognized date",e),r;return e};var E=/%\d?f/g,C=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return I[r("%q")(i)]})),x(n))try{t=d.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(t,e,r,n,a,s){if(a=x(a)&&a,!e)if("y"===r)e=s.year;else if("m"===r)e=s.month;else{if("d"!==r)return function(t,e){var r=o(t+.05,c),n=b(Math.floor(r/u),2)+":"+b(o(Math.floor(r/h),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(o(t/f,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+L(s.dayMonthYear,t,n,a);e=s.dayMonth+"\n"+s.year}return L(e,t,n,a)};var D=3*c;t.incrementMonth=function(t,e,r){r=x(r)&&r;var n=o(t,c);if(t=Math.round(t-n),r)try{var i=Math.round(t/c)+p,s=d.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return e%12?s.add(l,e,"m"):s.add(l,e/12,"y"),(l.toJD()-p)*c+n}catch(e){a.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+D);return u.setUTCMonth(u.getUTCMonth()+e)+n-D},t.findExactDates=function(t,e){for(var r,n,a=0,o=0,s=0,l=0,u=x(e)&&d.getComponentMethod("calendars","getCal")(e),h=0;he}function c(t,e){return t>=e}t.findBin=function(t,n,i){if(e(n.start))return i?Math.ceil((t-n.start)/n.size-a)-1:Math.floor((t-n.start)/n.size+a);var u,h,f=0,p=n.length,d=0,m=p>1?(n[p-1]-n[0])/(p-1):1;for(h=m>=0?i?o:s:i?c:l,t+=m*a*(i?-1:1)*(m>=0?1:-1);f90&&r.log("Long binary search..."),f-1},t.sorterAsc=function(t,e){return t-e},t.sorterDes=function(t,e){return e-t},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},t.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},t.findIndexOfMin=function(t,e){e=e||n;for(var r,i=1/0,a=0;aa.length)&&(o=a.length),e(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var n=r%1;return n*t[Math.ceil(r)]+(1-n)*t[Math.floor(r)]}}}),Yt=d({"src/lib/angles.js"(t,e){var r=z(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(t){return Math.abs(t[1]-t[0])>o-1e-14}function l(t,e){return i(e-t,o)}function c(t,e){if(s(e))return!0;var r,i;e[0](i=n(i,o))&&(i+=o);var a=n(t,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(t,e,r,n,i,l,c){i=i||0,l=l||0;var u,h,f,p,d,m=s([r,n]);function g(t,e){return[t*Math.cos(e)+i,l-t*Math.sin(e)]}m?(u=0,h=a,f=o):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return u(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return u(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return u(t,e,r,n,i,a,1)}}}}),Xt=d({"src/lib/anchor_utils.js"(t){t.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},t.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},t.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},t.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},t.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},t.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}}}),$t=d({"src/lib/geometry2d.js"(t){var e,r,n,i=z().mod;function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,h=n-e,f=a-e,p=s-a,d=l*p-u*h;if(0===d)return null;var m=(c*p-u*f)/d,g=(c*h-l*f)/d;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function o(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}t.segmentsIntersect=a,t.segmentDistance=function(t,e,r,n,i,s,l,c){if(a(t,e,r,n,i,s,l,c))return 0;var u=r-t,h=n-e,f=l-i,p=c-s,d=u*u+h*h,m=f*f+p*p,g=Math.min(o(u,h,d,i-t,s-e),o(u,h,d,l-t,c-e),o(f,p,m,t-i,e-s),o(f,p,m,r-i,n-s));return Math.sqrt(g)},t.getTextLocation=function(t,a,o,s){if(t===r&&s===n||(e={},r=t,n=s),e[o])return e[o];var l=t.getPointAtLength(i(o-s/2,a)),c=t.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(i(o,a)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return e[o]=f,f},t.clearLocationCache=function(){r=null},t.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=i:f=i,h++}return a}}}),Kt=d({"src/lib/throttle.js"(t){var e={};function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}t.throttle=function(t,n,i){var a=e[t],o=Date.now();if(!a){for(var s in e)e[s].tsa.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},t.done=function(t){var r=e[t];return r&&r.timer?new Promise((function(t){var e=r.onDone;r.onDone=function(){e&&e(),t(),r.onDone=null}})):Promise.resolve()},t.clear=function(n){if(n)r(e[n]),delete e[n];else for(var i in e)t.clear(i)}}}),Jt=d({"src/lib/clear_responsive.js"(t,e){e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}}),Qt=d({"node_modules/is-mobile/index.js"(t,e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(t){t||(t={});let e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;let a=r.test(e)&&!n.test(e)||!!t.tablet&&i.test(e);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(a=!0),a}}}),te=d({"src/lib/preserve_drawing_buffer.js"(t,e){var r=T(),n=Qt();e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;return"undefined"!=typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),t}()))return!0;var i=n({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!i)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(r(c)&&(c=+c),c>=13)return!0}}return i}}}),ee=d({"src/lib/make_trace_groups.js"(t,e){var r=v();e.exports=function(t,e,n){var i=t.selectAll("g."+n.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=r.select(this)})),i}}}),re=d({"src/lib/localize.js"(t,e){var r=Vt();e.exports=function(t,e){for(var n=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return e}}}),ne=d({"src/lib/filter_unique.js"(t,e){e.exports=function(t){for(var e={},r=[],n=0,i=0;i1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),oe=d({"src/lib/clean_number.js"(t,e){var r=T(),n=k().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),r(t)?Number(t):n}}}),se=d({"src/lib/index.js"(t,e){var r=v(),n=_().utcFormat,i=b().format,a=T(),o=k(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=e.exports={};u.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};u.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,u.warn('encountered bad format: "'+e+'"'))},u.noFormat=function(t){return String(t)},u.numberFormat=function(t){var e;try{e=i(u.adjustFormat(t))}catch(e){return u.warnBadFormat(t),u.noFormat}return e},u.nestedProperty=E(),u.keyedContainer=C(),u.relativeAttr=I(),u.isPlainObject=M(),u.toLogRange=L(),u.relinkPrivateKeys=P();var f=S();u.isArrayBuffer=f.isArrayBuffer,u.isTypedArray=f.isTypedArray,u.isArrayOrTypedArray=f.isArrayOrTypedArray,u.isArray1D=f.isArray1D,u.ensureArray=f.ensureArray,u.concat=f.concat,u.maxRowLength=f.maxRowLength,u.minRowLength=f.minRowLength;var p=z();u.mod=p.mod,u.modHalf=p.modHalf;var d=Z();u.valObjectMeta=d.valObjectMeta,u.coerce=d.coerce,u.coerce2=d.coerce2,u.coerceFont=d.coerceFont,u.coercePattern=d.coercePattern,u.coerceHoverinfo=d.coerceHoverinfo,u.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,u.validate=d.validate;var m=qt();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Gt();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=Zt();var y=Wt();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var x=Et();u.init2dArray=x.init2dArray,u.transposeRagged=x.transposeRagged,u.dot=x.dot,u.translationMatrix=x.translationMatrix,u.rotationMatrix=x.rotationMatrix,u.rotationXYMatrix=x.rotationXYMatrix,u.apply3DTransform=x.apply3DTransform,u.apply2DTransform=x.apply2DTransform,u.apply2DTransform2=x.apply2DTransform2,u.convertCssMatrix=x.convertCssMatrix,u.inverseTransformMatrix=x.inverseTransformMatrix;var w=Yt();u.deg2rad=w.deg2rad,u.rad2deg=w.rad2deg,u.angleDelta=w.angleDelta,u.angleDist=w.angleDist,u.isFullCircle=w.isFullCircle,u.isAngleInsideSector=w.isAngleInsideSector,u.isPtInsideSector=w.isPtInsideSector,u.pathArc=w.pathArc,u.pathSector=w.pathSector,u.pathAnnulus=w.pathAnnulus;var A=Xt();u.isLeftAnchor=A.isLeftAnchor,u.isCenterAnchor=A.isCenterAnchor,u.isRightAnchor=A.isRightAnchor,u.isTopAnchor=A.isTopAnchor,u.isMiddleAnchor=A.isMiddleAnchor,u.isBottomAnchor=A.isBottomAnchor;var D=$t();u.segmentsIntersect=D.segmentsIntersect,u.segmentDistance=D.segmentDistance,u.getTextLocation=D.getTextLocation,u.clearLocationCache=D.clearLocationCache,u.getVisibleSegment=D.getVisibleSegment,u.findPointOnPath=D.findPointOnPath;var R=O();u.extendFlat=R.extendFlat,u.extendDeep=R.extendDeep,u.extendDeepAll=R.extendDeepAll,u.extendDeepNoArrays=R.extendDeepNoArrays;var F=X();u.log=F.log,u.warn=F.warn,u.error=F.error;var j=G();u.counterRegex=j.counter;var B=Kt();u.throttle=B.throttle,u.throttleDone=B.done,u.clearThrottle=B.clear;var N=Ct();function U(t){var e={};for(var r in t)for(var n=t[r],i=0;is||t=e)&&a(t)&&t>=0&&t%1==0},u.noop=$(),u.identity=Ht(),u.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},u.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},u.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},u.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(t,e,r){var n;function i(){return u.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var tt=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var i;return tt.test(n)?i=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,i=r[n]()),u.isValidTextValue(i)?i:""}))};var et={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return ot.apply(et,arguments)};var rt={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return ot.apply(rt,arguments)};var nt=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,it={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return ot.apply(it,arguments)};var at=/^[:|\|]/;function ot(t,e,r){var i=this,a=arguments;e||(e={});var o={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,s,l){var c="_xother"===s||"_yother"===s,h="_xother_"===s||"_yother_"===s,f="xother_"===s||"yother_"===s,p="xother"===s||"yother"===s||c||f||h,d=s;(c||h)&&(d=d.substring(1)),(f||h)&&(d=d.substring(0,d.length-1));var m,g,y,v=null,x=null;if(i.parseMultDiv){var _=function(t){var e=t.match(nt);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(d);d=_.key,v=_.op,x=_.number}if(p){if(void 0===(m=e[d]))return""}else for(y=3;y=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var st=2e9;u.seedPseudoRandom=function(){st=2e9},u.pseudoRandom=function(){var t=st;return st=(69069*st+1)%4294967296,Math.abs(st-t)<429496729?u.pseudoRandom():st/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(t,e,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(t){return t||0===t},u.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(t,e){t.attr("transform",u.getTextTransform(e)),t.style("display",e.scale?null:"none")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},u.bigFont=function(t){return Math.round(1.2*t)};var lt=u.getFirefoxVersion(),ct=null!==lt&<<86;u.getPositionFromD3Event=function(){return ct?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),le=d({"build/plotcss.js"(){var t,e,r=se(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(e in n)t=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(t,n[e])}}),ce=d({"node_modules/is-browser/client.js"(t,e){e.exports=!0}}),ue=d({"node_modules/has-hover/index.js"(t,e){var r,n=ce();r="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,e.exports=r}}),he=d({"node_modules/events/events.js"(t,e){var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,a,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,a,o,s;if(l(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var c=l.length,u=m(l,c);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),fe=d({"src/lib/events.js"(t,e){var r=he().EventEmitter,n={init:function(t){if(t._ev instanceof r)return t;var e=new r,n=new r;return t._ev=e,t._internalEv=n,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=n.on.bind(n),t._internalOnce=n.once.bind(n),t._removeInternalListener=n.removeListener.bind(n),t._removeAllInternalListeners=n.removeAllListeners.bind(n),t.emit=function(t,r){e.emit(t,r),n.emit(t,r)},t},triggerHandler:function(t,e,r){var n=t._ev;if(n){var i=n._events[e];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;an.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function _(){var t,r,n={};for(t in c(n,i),e.subplotsRegistry)if((r=e.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(t,r){s?e.nestedProperty(l[c],t).set(r):l[c+"."+t]=r}function f(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:f,applyUpdate:function(r,n){r&&h(r,n);var i=f();for(var a in i)e.nestedProperty(t,a).set(i[a])}}}}}),ye=d({"src/plots/cartesian/constants.js"(t,e){var r=G().counter;e.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),ve=d({"src/plots/cartesian/axis_ids.js"(t){var e=Vt(),r=ye();function n(t,e){if(e&&e.length)for(var r=0;rn?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},t.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},t.isLinked=function(t,e){return n(e,t._axisMatchGroups)||n(e,t._axisConstraintGroups)}}}),xe=d({"src/components/shapes/handle_outline.js"(t,e){e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearOutline:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}}}),_e=d({"src/traces/scatter/layout_attributes.js"(t,e){e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),be=d({"src/plots/get_data.js"(t){var e=Vt();ye().SUBPLOT_PATTERN,t.getSubplotCalcData=function(t,r,n){var i=e.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s0?".":"")+a;r.isPlainObject(s)?o(s,e,l,i+1):e(l,a,s)}}))}t.manageCommandObserver=function(e,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=t.hasSimpleAPICommandBindings(e,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(e,c,s.cache),s.check=function(){if(l){var t=n(e,c,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){S.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},S.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=S.graphJson(t,!1,"keepdata"),i.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],I=["year","month","dayMonth","dayMonthYear"];function L(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,S.linkSubplots(f,l,h,a),S.cleanPlot(f,l,h,a);var B=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));B&&!N?a._bgLayer.remove():N&&!B&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&d({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=S.layoutAttributes.width.min,p=S.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),S.sanitizeMargins(r)},S.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var f in c.length||c.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:w,size:r.b+g},t:{val:b,size:r.t+g}},m[e]=1}else delete d[e],delete m[e];if(!n._replotting)return S.doAutoMargin(t)}},S.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),D(e);var i=e._size,o=e.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,f=o.r,d=o.t,m=o.b,g=e._pushmargin,y=e._pushmarginIds,v=e.minreducedwidth,x=e.minreducedheight;if(!1!==o.autoexpand){for(var _ in g)y[_]||delete g[_];var b=t._fullLayout._reservedMargin;for(var w in b)for(var T in b[w]){var k=b[w][T];l[T]=Math.max(l[T],k)}for(var A in g.base={l:{val:0,size:h},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:m}},l){var M=0;for(var E in g)"base"!==E&&a(g[E][A].size)&&(M=g[E][A].size>M?g[E][A].size:M);var C=Math.max(0,o[A]-M);l[A]=Math.max(0,l[A]-C)}for(var I in g){var L=g[I].l||{},P=g[I].b||{},z=L.val,O=L.size,R=P.val,F=P.size,j=r-l.r-l.l,B=n-l.t-l.b;for(var N in g){if(a(O)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(O*U+(V-j)*z)/(U-z),H=(V*(1-z)+(O-j)*(1-U))/(U-z);q+H>h+f&&(h=q,f=H)}}if(a(F)&&g[N].t){var G=g[N].t.val,Z=g[N].t.size;if(G>R){var W=(F*G+(Z-B)*R)/(G-R),Y=(Z*(1-R)+(F-B)*(1-G))/(G-R);W+Y>m+d&&(m=W,d=Y)}}}}}var X=u.constrain(r-o.l-o.r,2,v),$=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-X),J=Math.max(0,n-$);if(K){var Q=(h+f)/K;Q>1&&(h/=Q,f/=Q)}if(J){var tt=(m+d)/J;tt>1&&(m/=tt,d/=tt)}if(i.l=Math.round(h)+l.l,i.r=Math.round(f)+l.r,i.t=Math.round(d)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(S.didMarginChange(c,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var e;o++,n||o!==a||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}S.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},S.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&S.supplyDefaults(t);var s=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function h(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(t[a],e)}else e&&(i[a]="_function")})),i}var a=Array.isArray(t),s=u.isTypedArray(t);if((a||s)&&t.dtype&&t.shape){var l=t.bdata;return h({dtype:t.dtype,shape:t.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},e)}return a?t.map((function(t){return h(t,e)})):s?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(s||[]).map((function(t){var r=h(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=h(l),i)){var p=l._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return c&&(f.frames=h(c)),a&&(f.config=h(t._context,!0)),"object"===n?f:JSON.stringify(f)},S.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(B(o,c,h),i=0;il||m>c)&&(o.style("overflow","hidden"),p=(f=o.node().getBoundingClientRect()).width,m=f.height);var g=+d.attr("x"),y=+d.attr("y"),v=-(i||d.node().getBoundingClientRect().height)/4;if("y"===P[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-p/2,v-m/2)});else if("l"===P[0])y=v-m/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,y=v;else{var x=d.attr("text-anchor");g-=p*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y}),M&&M.call(d,s),t(s)}))}))):z(),d}function z(){L.empty()||(P=d.attr("class")+"-math",L.select("svg."+P).remove()),d.text("").style("white-space","pre");var n=function(t,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function d(){c++;var r=document.createElementNS(i.svg,"tspan");e.select(r).attr({class:"line",dy:c*a+"em"}),t.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag .",n)}var I=x.test(n);I?d():(o=t,l=[{node:t}]);for(var L=n.split(g),P=0;P|>|>)/g,c=[["$","$"],["\\(","\\)"]],u={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},p="​",d=["http:","https:","mailto:","",void 0,":"],m=t.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;t.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;t.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(g),a=[],o="",s=0,l=0;l3?a.push(c.substr(0,p-3)+"..."):a.push(c.substr(0,p));break}o=""}}return a.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t}))}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==d.indexOf(i)&&-1!==d.indexOf(a)?e:""}function I(t,e,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}t.convertEntities=E,t.sanitizeHTML=function(t){t=t.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=t.split(g),o=0;o=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var a=t.domain,s=t.range,l=s.length,c=new Array(l),u=0;um-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),Ze=d({"src/components/colorscale/index.js"(t,e){var r=U(),n=Se();e.exports={moduleType:"component",name:"colorscale",attributes:Le(),layoutAttributes:Pe(),supplyLayoutDefaults:qe(),handleDefaults:Ve(),crossTraceDefaults:He(),calc:Ge(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),We=d({"src/traces/scatter/subtypes.js"(t,e){var r=se(),n=S().isTypedArraySpec;e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var e=t.marker;return r.isPlainObject(e)&&(r.isArrayOrTypedArray(e.size)||n(e.size))}}}}),Ye=d({"src/traces/scatter/make_bubble_size_func.js"(t,e){var r=T();e.exports=function(t,e){e||(e=2);var n=t.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(t){return Math.sqrt(t/i)}:function(t){return t/i};return function(t){var n=o(t/e);return r(n)&&n>0?Math.max(n,a):0}}}}),Xe=d({"src/components/fx/helpers.js"(t){var e=se();t.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},t.isTraceInSubplots=function(e,r){if("splom"===e.type){for(var n=e.xaxes||[],i=e.yaxes||[],a=0;a=0&&r.index2&&(e.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),e.push(a);if(a.length=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=A||t>=400?0:Math.floor(Math.max(t,0))};var S=i("~f"),E={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function C(t,e,i,a,s,c,u,h,f,p){var d,m=s.length;"linear"===a?d={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:f?"userSpaceOnUse":"objectBoundingBox"},reversed:p}:"radial"===a&&(d={node:"radialGradient",reversed:p});for(var g=new Array(m),y=0;y=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),i.ms2mrc){var u;u="various"===t.ms||"various"===s.size?3:i.ms2mrc(t.ms),t.mrc=u,i.selectedSizeFn&&(u=t.mrc=i.selectedSizeFn(t));var h=x.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var f=st(t,r),p=$(t,r);e.attr("d",M(h,u,f,p))}var d,m,g,y=!1;if(t.so)g=c.outlierwidth,m=c.outliercolor,d=s.outliercolor;else{var v=(c||{}).width;g=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=i.lineScale(t.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(d=l.defaultLine,y=!0),d="mc"in t?t.mcc=i.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(d=i.selectedColorFn(t))}if(t.om)e.call(l.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var _=s.gradient,b=t.mgt;b?y=!0:b=_&&_.type,n.isArrayOrTypedArray(b)&&(b=b[0],E[b]||(b=0));var w=s.pattern,T=w&&x.getPatternAttr(w.shape,t.i,"");if(b&&"none"!==b){var k=t.mgc;k?y=!0:k=_.color;var A=r.uid;y&&(A+="-"+t.i),x.gradient(e,a,A,b,[[0,k],[1,d]],"fill")}else if(T){var S=!1,C=w.fgcolor;!C&&o&&o.color&&(C=o.color,S=!0);var I=x.getPatternAttr(C,t.i,o&&o.color||null),L=x.getPatternAttr(w.bgcolor,t.i,null),P=w.fgopacity,z=x.getPatternAttr(w.size,t.i,8),D=x.getPatternAttr(w.solidity,t.i,.3);S=S||t.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var O=r.uid;S&&(O+="-"+t.i),x.pattern(e,"point",a,O,T,z,D,t.mcc,w.fillmode,L,I,P)}else n.isArrayOrTypedArray(d)?l.fill(e,d[t.i]):l.fill(e,d);g&&l.stroke(e,m)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),s.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&n.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},i=t.unselected||{},a=t.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,f=void 0!==u,p=void 0!==h;(n.isArrayOrTypedArray(c)||f||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u:e:p?h:d*e});var m=a.color,g=o.color,y=l.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=a.size,x=o.size,_=l.size,b=void 0!==x,w=void 0!==_;return s.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?x/2:e:w?_/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,d))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];n.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",n.selectedOpacityFn(e))})),n.selectedColorFn&&a.push((function(t,e){l.fill(t,n.selectedColorFn(e))})),n.selectedSizeFn&&a.push((function(t,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);t.attr("d",M(x.symbolNumber(a),o,st(r,e),$(r,e))),r.mrc2=o})),a.length&&t.each((function(t){for(var e=r.select(this),n=0;n0?r:0}function R(t,e,r){return r&&(t=V(t)),e?j(t[1]):F(t[0])}function F(t){var e=r.round(t,2);return I=e,e}function j(t){var e=r.round(t,2);return L=e,e}function B(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=3*c*(l+c),p=3*l*(l+c);return[[F(e[0]+(f&&u/f)),j(e[1]+(f&&h/f))],[F(e[0]-(p&&u/p)),j(e[1]-(p&&h/p))]]}x.textPointStyle=function(t,e,i){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=i._fullLayout;t.each((function(t){var o=r.select(this),c=s?n.extractOption(t,e,"txt","texttemplate"):n.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=n.texttemplateString(c,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=O(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:v}).text(c).call(h.convertToTspans,i).call(z,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=r.select(this),a=n.selectedTextColorFn(t),o=t.tp||e.textposition,c=O(t,e);l.fill(i,a);var u=s.traceIs(e,"bar-like");z(i,o,c,t.mrc2||t.mrc,u)}))}},x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||w>=h&&w<=c)&&(T<=f&&T>=u||T>=f&&T<=u)&&(t=[w,T])}return t}x.steps=function(t){var e=N[t]||U;return function(t){for(var r="M"+F(t[0][0])+","+j(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},G=0),i&&(x.savedBBoxes[i]=g),G++,n.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",W(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var X=/translate\([^)]*\)\s*$/;function $(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,n){t&&t.each((function(){var t,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);t=1===e&&1===n?[]:[u(o,s),"scale("+e+","+n+")",u(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},x.getMarkerStandoff=$;var K,J,Q,tt,et,rt,nt=Math.atan2,it=Math.cos,at=Math.sin;function ot(t,e){var r=e[0],n=e[1];return[r*it(t)-n*at(t),r*at(t)+n*it(t)]}function st(t,e){var r,i,o=t.ma;void 0===o&&((o=e.marker.angle)&&!n.isArrayOrTypedArray(o)||(o=0));var s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);r=l[0],i=l[1]}else{var c=e._xA,u=e._yA;if(!c||!u)return 90;r=c.c2p(t.x),i=u.c2p(t.y)}if(e._geo){var h,f=t.lonlat[0],p=t.lonlat[1],d=e._geo.project([f,p+1e-5]),m=e._geo.project([f+1e-5,p]),g=nt(m[1]-i,m[0]-r),y=nt(d[1]-i,d[0]-r);if("north"===s)h=o/180*Math.PI;else if("previous"===s){var v=f/180*Math.PI,x=p/180*Math.PI,_=K/180*Math.PI,b=J/180*Math.PI,w=_-v,T=it(b)*at(w),k=at(b)*it(x)-it(b)*at(x)*it(w);h=-nt(T,k)-Math.PI,K=f,J=p}var A=ot(g,[it(h),0]),M=ot(y,[at(h),0]);o=nt(A[1]+M[1],A[0]+M[0])/Math.PI*180,"previous"!==s||rt===e.uid&&t.i===et+1||(o=null)}if("previous"===s&&!e._geo)if(rt===e.uid&&t.i===et+1&&a(r)&&a(i)){var S=r-Q,E=i-tt,C=e.line&&e.line.shape||"",I=C.slice(C.length-1);"h"===I&&(E=0),"v"===I&&(S=0),o+=nt(E,S)/Math.PI*180+90}else o=null}return Q=r,tt=i,et=t.i,rt=e.uid,o}x.getMarkerAngle=st}}),Qe=d({"src/components/titles/index.js"(t,e){var r=v(),n=T(),i=Te(),a=Vt(),o=se(),s=o.strTranslate,l=Je(),c=q(),u=Me(),h=H(),f=Ae().OPPOSITE_SIDE,p=/ [XY][0-9]* /;e.exports={draw:function(t,e,d){var m,g=t._fullLayout,y=d.propContainer,v=d.propName,x=d.placeholder,_=d.traceIndex,b=d.avoid||{},w=d.attributes,T=d.transform,k=d.containerGroup,A=1,M=y.title,S=(M&&M.text?M.text:"").trim(),E=!1,C=M&&M.font?M.font:{},I=C.family,L=C.size,P=C.color,z=C.weight,D=C.style,O=C.variant,R=C.textcase,F=C.lineposition,j=C.shadow,B=!!d.subtitlePropName,N=d.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,Z=G.family,W=G.size,Y=G.color,X=G.weight,$=G.style,K=G.variant,J=G.textcase,Q=G.lineposition,tt=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":v.indexOf(!0)&&(m="colorbarTitleText");var et=t._context.edits[m];function rt(t,e){return void 0!==t&&void 0!==e&&t.replace(p," % ")===e.replace(p," % ")}""===S?A=0:rt(S,x)&&(et||(S=""),A=.2,E=!0),B&&(""===V?H=0:rt(V,N)&&(et||(V=""),H=.2,q=!0)),d._meta?S=o.templateString(S,d._meta):g._meta&&(S=o.templateString(S,g._meta));var nt,it=S||V||et;k||(k=o.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var at=k.selectAll("text."+e).data(it?[0]:[]);at.enter().append("text"),at.text(S).attr("class",e),at.exit().remove();var ot=null,st=e+"-subtitle",lt=V||et;if(B&<&&((ot=k.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),ot.text(V).attr("class",st),ot.exit().remove()),!it)return k;function ct(t,e){o.syncOrAsync([ut,ht],{title:t,subtitle:e})}function ut(n){var a,h=n.title,f=n.subtitle;if(!T&&nt&&(T={}),T?(a="",T.rotate&&(a+="rotate("+[T.rotate,w.x,w.y]+")"),(T.offset||nt)&&(a+=s(0,(T.offset||0)-(nt||0)))):a=null,h.attr("transform",a),h.style("opacity",A*c.opacity(P)).call(l.font,{color:c.rgb(P),size:r.round(L,2),family:I,weight:z,style:D,variant:O,textcase:R,shadow:j,lineposition:F}).attr(w).call(u.convertToTspans,t,(function(t){if(t){var e=r.select(t.node().parentNode).select("."+st);if(!e.empty()){var n=t.node().getBBox();if(n.height){var i=n.y+n.height+1.6*W;e.attr("y",i)}}}})),f){var p=k.select("."+e+"-math-group"),d=h.node().getBBox(),m=p.node()?p.node().getBBox():void 0,g=m?m.y+m.height+1.6*W:d.y+d.height+1.6*W,y=o.extendFlat({},w,{y:g});f.attr("transform",a),f.style("opacity",H*c.opacity(Y)).call(l.font,{color:c.rgb(Y),size:r.round(W,2),family:Z,weight:X,style:$,variant:K,textcase:J,shadow:tt,lineposition:Q}).attr(y).call(u.convertToTspans,t)}return i.previousPromises(t)}function ht(e){var i=e.title,a=r.select(i.node().parentNode);if(b&&b.selection&&b.side&&S){a.attr("transform",null);var c=f[b.side],u="left"===b.side||"top"===b.side?-1:1,h=n(b.pad)?b.pad:2,p=l.bBox(a.node()),d={t:0,b:0,l:0,r:0},m=t._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var _=m[v][x];d[x]=Math.max(d[x],_)}var w={left:d.l,top:d.t,right:g.width-d.r,bottom:g.height-d.b},T=b.maxShift||u*(w[b.side]-p[b.side]),k=0;if(T<0)k=T;else{var A=b.offsetLeft||0,M=b.offsetTop||0;p.left-=A,p.right-=A,p.top-=M,p.bottom-=M,b.selection.each((function(){var t=l.bBox(this);o.bBoxIntersect(p,t,h)&&(k=Math.max(k,u*(t[b.side]-p[c])+h))})),k=Math.min(T,k),y._titleScoot=Math.abs(k)}if(k>0||T<0){var E={left:[-k,0],right:[k,0],top:[0,-k],bottom:[0,k]}[b.side];a.attr("transform",s(E[0],E[1]))}}}function ft(t,e){t.text(e).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(at.call(ct,ot),et&&(S?at.on(".opacity",null):(ft(at,x),E=!0),at.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?a.call("_guiRestyle",t,v,e,_):a.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),B)){if(B&&!S){var pt=at.node().getBBox(),dt=pt.y+pt.height+1.6*W;ot.attr("y",dt)}V?ot.on(".opacity",null):(ft(ot,N),q=!0),ot.call(u.makeEditable,{gd:t}).on("edit",(function(e){a.call("_guiRelayout",t,"title.subtitle.text",e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,ot.attr("x"),ot.attr("y"))}))}return at.classed("js-placeholder",E),ot&&ot.classed("js-placeholder",q),k},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),tr=d({"src/plots/cartesian/set_convert.js"(t,e){var r=v(),n=_().utcFormat,i=se(),a=i.numberFormat,o=T(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,f=k(),p=f.FP_SAFE,d=f.BADNUM,m=f.LOG_CLIP,g=f.ONEWEEK,y=f.ONEDAY,x=f.ONEHOUR,b=f.ONEMIN,w=f.ONESEC,A=ve(),M=ye(),S=M.HOUR_PATTERN,E=M.WEEKDAY_PATTERN;function C(t){return Math.pow(10,t)}function I(t){return null!=t}e.exports=function(t,e){e=e||{};var f=t._id||"x",v=f.charAt(0);function _(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return d}function T(e,r,n,a){if((a||{}).msUTC&&o(e))return+e;var s=c(e,n||t.calendar);if(s===d){if(!o(e))return d;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);s=c(new Date(u))+l/10}return s}function k(e,r,n){return l(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function P(e){if(I(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function D(t){var e=z(t);return void 0!==e?e:o(t)?+t:void 0}function O(t){return o(t)?+t:z(t)}function R(t,e,n){return r.round(n+e*t,2)}function F(t,e,r){return(t-r)/e}var j=function(e){return o(e)?R(e,t._m,t._b):d},B=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var N="y"===v;j=function(e){if(!o(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=N;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,s=0,l=0;lu)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?R(e,t._m2,h):0},B=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?_:u,t.l2c="log"===t.type?C:u,t.l2p=j,t.p2l=B,t.c2p="log"===t.type?function(t,e){return j(_(t,e))}:j,t.p2c="log"===t.type?function(t){return C(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=B,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return _(s(t),e)},t.r2d=t.r2c=function(t){return C(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=_,t.l2d=C,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return C(B(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=B,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=T,t.c2d=t.c2r=t.l2d=t.l2r=k,t.d2p=t.r2p=function(e,r,n){return t.l2p(T(e,0,n))},t.p2d=t.p2r=function(t,e,r){return k(B(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=u,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(r){var n,a,o=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var l in s)if(l!==f){var c=e[A.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],p=[];for(n=0;nl[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var f=u+1;void 0!==r&&(f=Math.max(f,c)),a[s?0:1]=f}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,s=i.nestedProperty(t,e).get();if(a=(a="date"===t.type?i.dfltRange(t.calendar):"y"===v?M.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||M.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"!==t.type||t.autorange||(s[0]=i.cleanDate(s[0],d,t.calendar),s[1]=i.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(s[n],t.calendar)){t[e]=a;break}if(t.r2l(s[0])===t.r2l(s[1])){var u=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(u-1e3),s[1]=t.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){t[e]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-p?s[n]=-p:s[n]>p&&(s[n]=p),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=A.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h="y"===v;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(f=!f),f&&t._rangebreaks.reverse();var p=f?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;n2*s}(h,e))return"date";var g="strict"!==n.autotypenumbers;return function(t,e){for(var r=t.length,n=u(r),a=0,o=0,c={},h=0;h2*a}(h,g)?"category":function(t,e){for(var r=t.length,n=0;n0&&((k=I-s(_)-l(b))>L?M/k>P&&(w=_,T=b,P=M/k):M/I>P&&(w={val:_.val,nopad:1},T={val:b.val,nopad:1},P=M/I));if(m===g){var z=m-1,D=m+1;if(E)if(0===m)a=[0,1];else{var O=(m>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=m/(1-Math.min(.5,O/I));a=m>0?[0,R]:[R,0]}else a=C?[Math.max(0,z),Math.max(1,D)]:[z,D]}else E?(w.val>=0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:1,nopad:1})),P=(T.val-w.val-f(e,_.val,b.val))/(I-s(w)-l(T)),a=[w.val-P*s(w),T.val+P*l(T)];return a=A(a,e),e.limitRange&&e.limitRange(),v&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return n(t)&&Math.abs(t)=e}function w(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))<(r=t.d2l(r))}function A(t,e){if(!e||!e.autorangeoptions)return t;var r=t[0],n=t[1],a=e.autorangeoptions.include;if(void 0!==a){var o=e.d2l(r),s=e.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&w(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&w(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}e.exports={applyAutorangeOptions:A,getAutoRange:h,makePadFn:p,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():h(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var n=e._input,a={};a[e._attr+".range"]=e.range,a[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=h(t,e)),s._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,c,u,h,f,p,d=[],y=[],v=e.length,_=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(i=0;i0&&(f=o),o>p&&o-a&&(f=o),o>p&&o=P;i--)L(i);return{min:d,max:y,opts:r}},concatExtremes:d}}}),nr=d({"src/plots/cartesian/axes.js"(t,e){var r=v(),n=T(),i=Te(),a=Vt(),o=se(),s=o.strTranslate,l=Me(),c=Qe(),u=q(),h=Je(),f=Ce(),p=De(),d=k(),m=d.ONEMAXYEAR,g=d.ONEAVGYEAR,y=d.ONEMINYEAR,x=d.ONEMAXQUARTER,_=d.ONEAVGQUARTER,b=d.ONEMINQUARTER,w=d.ONEMAXMONTH,A=d.ONEAVGMONTH,M=d.ONEMINMONTH,S=d.ONEWEEK,E=d.ONEDAY,C=E/2,I=d.ONEHOUR,L=d.ONEMIN,P=d.ONESEC,z=d.ONEMILLI,D=d.ONEMICROSEC,O=d.MINUS_SIGN,R=d.BADNUM,F={K:"zeroline"},j={K:"gridline",L:"path"},B={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},H=Ae(),G=H.MID_SHIFT,Z=H.CAP_SHIFT,W=H.LINE_SPACING,Y=H.OPPOSITE_SIDE,X=e.exports={};X.setConvert=tr();var $=er(),K=ve(),J=K.idSort,Q=K.isLinked;X.id2name=K.id2name,X.name2id=K.name2id,X.cleanId=K.cleanId,X.list=K.list,X.listIds=K.listIds,X.getFromId=K.getFromId,X.getFromTrace=K.getFromTrace;var tt=rr();function et(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}X.getAutoRange=tt.getAutoRange,X.findExtremes=tt.findExtremes,X.coerceRef=function(t,e,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},o.coerce(t,e,u,c)},X.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},X.coercePosition=function(t,e,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=X.getFromId(e,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}t[i]=s(l)},X.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(e,r).cleanPos)(t)},X.redrawComponents=function(t,e){e=e||X.listIds(t);var r=t._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;un&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},X.saveRangeInitial=function(t,e){for(var r=X.list(t,"",!0),n=!1,i=0;i.3*f||u(i)||u(a))){var p=r.dtick/2;t+=t+ps){var l=Number(r.substr(1));a.exactYears>s&&l%12==0?t=X.tickIncrement(t,"M6","reverse")+1.5*E:a.exactMonths>s?t=X.tickIncrement(t,"M1","reverse")+15.5*E:t-=C;var c=X.tickIncrement(t,r);if(c<=n)return c}return t}(v,t,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},X.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var i,a=e.dtick&&n(e._tmin);if(a){var s=X.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,.99*s+.01*e._tmin]}else{var l=o.simpleMap(e.range,e.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(t.range=o.simpleMap(i,e.l2r),t._isMinor=!0,X.prepTicks(t,r),a){var c=n(e.dtick),u=n(t.dtick),h=c?e.dtick:+e.dtick.substring(1),f=u?t.dtick:+t.dtick.substring(1);c&&u?at(h,f)?h===2*S&&f===2*E&&(t.dtick=S):h===2*S&&f===3*E?t.dtick=S:h!==S||(e._input.minor||{}).nticks?ot(h/f,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=E:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":at(h,f)?h>=12&&2===f&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?at(h,f)||(t.dtick=ot(h/f,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},X.prepTicks=function(t,e){var r=o.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var i,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(i=t.tickfont?o.bigFont(t.tickfont.size||12):15,a=t._length/i):(i="y"===t._id.charAt(0)?40:80,a=o.constrain(t._length/i,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(n(t.dtick)||"M"!==t.dtick.charAt(0))}var i=r(),a=X.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=I,o&&!i&&t.dtickt.range[1],p=!t.ticklabelindex||o.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],d=o.simpleMap(t.range,t.r2l,void 0,void 0,e),v=d[1]=(V?0:1);q--){var H=!q;q?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var G=q?t:o.extendFlat({},t,t.minor);if(H?X.prepMinorTicks(G,t,e):X.prepTicks(G,e),"array"!==G.tickmode)if("sync"!==G.tickmode){var Z=et(d),W=Z[0],Y=Z[1],$=n(G.dtick),K="log"===l&&!($||"L"===G.dtick.charAt(0)),J=X.tickFirst(G,e);if(q){if(t._tmin=J,J=Y:nt<=Y;nt=X.tickIncrement(nt,it,v,c)){if(q&&Q++,G.rangebreaks&&!v){if(nt=k)break}if(B.length>O||nt===rt)break;rt=nt;var at={value:nt};q?(K&&nt!==(0|nt)&&(at.simpleLabel=!0),u>1&&Q%u&&(at.skipLabel=!0),B.push(at)):(at.minor=!0,N.push(at))}}else B=[],F=ct(t);else q?(B=[],F=ut(t,!H)):(N=[],j=ut(t,!H))}if(!N||N.length<2)p=!1;else{var ot=(N[1].value-N[0].value)*(f?-1:1);r=ot,i=t.tickformat,(/%f/.test(i)?r>=D:/%L/.test(i)?r>=z:/%[SX]/.test(i)?r>=P:/%M/.test(i)?r>=L:/%[HI]/.test(i)?r>=I:/%p/.test(i)?r>=C:/%[Aadejuwx]/.test(i)?r>=E:/%[UVW]/.test(i)?r>=S:/%[Bbm]/.test(i)?r>=M:/%[q]/.test(i)?r>=b:!/%[Yy]/.test(i)||r>=y)||(p=!1)}if(p){var st=B.concat(N);h&&B.length&&(st=st.slice(1)),(st=st.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){p.map((function(e){var r=t+e;r>=0&&r0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),h=r||u,f=0;h>=y?f=u>=y&&u<=m?u:g:r===_&&h>=b?f=u>=b&&u<=x?u:_:h>=M?f=u>=M&&u<=w?u:A:r===S&&h>=S?f=S:h>=E?f=E:r===C&&h>=C?f=C:r===I&&h>=I&&(f=I),f>=u&&(f=u,s=!0);var p=i+f;if(e.rangebreaks&&f>0){for(var d=0,v=0;v<84;v++){var T=(v+.5)/84;e.maskBreaks(i*(1-T)+T*p)!==R&&d++}(f*=d/84)||(t[n].drop=!0),s&&u>S&&(f=u)}(f>0||0===n)&&(t[n].periodX=i+f/2)}}(U,t,t._definedDelta),t.rangebreaks){var yt="y"===t._id.charAt(0),vt=1;"auto"===t.tickmode&&(vt=t.tickfont?t.tickfont.size:12);var xt=NaN;for(a=B.length-1;a>-1;a--)if(B[a].drop)B.splice(a,1);else{B[a].value=Bt(B[a].value,t);var _t=t.c2p(B[a].value);(yt?xt>_t-vt:xt<_t+vt)?B.splice(v?a+1:a,1):xt=_t}}jt(t)&&360===Math.abs(d[1]-d[0])&&B.pop(),t._tmax=(B[B.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var bt,wt=function(e){e.text="",t._prevDateHead=s};function Tt(t,e){var r=X.tickText(t,e.value,!1,e.simpleLabel),n=e.periodX;return void 0!==n&&(r.periodX=n,(n>k||nk&&(r.periodX=k),n10||"01-01"!==i.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=L&&a<=16||e>=I)t._tickround="M";else if(e>=P&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(n(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);n(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(wt(t.exponentformat)&&!Tt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function _t(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(t,e,r){var i;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=o.dateTick0(t.calendar,0);var s=2*e;if(s>g)e/=g,i=a(10),t.dtick="M"+12*vt(e,i,ht);else if(s>A)e/=A,t.dtick="M"+vt(e,1,ft);else if(s>E){if(t.dtick=vt(e,E,t._hasDayOfWeekBreaks?[1,2,7,14]:dt),!r){var l=X.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=o.dateTick0(t.calendar,2):t.tick0=o.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else s>I?t.dtick=vt(e,I,ft):s>L?t.dtick=vt(e,L,pt):s>P?t.dtick=vt(e,P,pt):(i=a(10),t.dtick=vt(e,i,ht))}else if("log"===t.type){t.tick0=0;var u=o.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),t.dtick="L"+vt(e,i,ht)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):jt(t)?(t.tick0=0,i=1,t.dtick=vt(e,i,yt)):(t.tick0=0,i=a(10),t.dtick=vt(e,i,ht));if(0===t.dtick&&(t.dtick=1),!n(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},X.tickIncrement=function(t,e,i,a){var s=i?-1:1;if(n(e))return o.increment(t,s*e);var l=e.charAt(0),c=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?gt:mt,h=t+.01*s,f=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},X.tickFirst=function(t,e){var i=t.r2l||Number,a=o.simpleMap(t.range,i,void 0,void 0,e),s=a[1]=0&&r<=t._length?e:null};if(l&&o.isArrayOrTypedArray(t.ticktext)){var p=o.simpleMap(t.range,t.r2l),d=(Math.abs(p[1]-p[0])-(t._lBreaks||0))/1e4;for(a=0;a ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,s,r,c):"log"===u?function(t,e,r,i,a){var s=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)e.text=kt(Math.pow(10,l),t,a,i);else if(n(s)||"D"===u&&o.mod(l+.01,1)<.1){var h=Math.round(l),f=Math.abs(h),p=t.exponentformat;"power"===p||wt(p)&&Tt(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":O)+f+"",e.fontSize*=1.25):("e"===p||"E"===p)&&f>2?e.text="1"+p+(h>0?"+":O)+f:(e.text=kt(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);e.text=String(Math.round(Math.pow(10,o.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,s,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,s):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,s,r):jt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=kt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var s=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}function r(t,n){return e(n,0)?t:r(n,t%n)}function n(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}var i=n(t),a=t*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(s[1]>=100)e.text=kt(o.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===s[1]?1===s[0]?e.text="π":e.text=s[0]+"π":e.text=["",s[0],"","⁄","",s[1],"","π"].join(""),l&&(e.text=O+e.text)}}}}(t,s,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=kt(e.x,t,i,n)}(t,s,0,c,g),i||(t.tickprefix&&!m(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!m(t.showticksuffix)&&(s.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(s.text)){var y=t.labelalias[s.text];"string"==typeof y&&(s.text=y)}return("boundaries"===t.tickson||t.showdividers)&&(s.xbnd=[f(s.x-.5),f(s.x+t.dtick-.5)]),s},X.hoverLabelText=function(t,e,r){r&&(t=o.extendFlat({},t,{hoverformat:r}));var n=o.isArrayOrTypedArray(e)?e[0]:e,i=o.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(t,n,r)+" - "+X.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,s=X.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":O+s:s};var bt=["f","p","n","μ","m","","k","M","G","T"];function wt(t){return"SI"===t||"B"===t}function Tt(t){return t>14||t<-15}function kt(t,e,r,i){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=X.getTickFormat(e),h=e.separatethousands;if(i){var f={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:n(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};xt(f),s=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,O);var p,d=Math.pow(10,-s)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":wt(l)&&(t+=bt[c/3+5])),a?O+t:t}function At(t,e){if(t){var r=Object.keys(V).reduce((function(t,r){return-1!==e.indexOf(r)&&V[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function Mt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(e){return function(){if(e){var n=X.getFromId(t,e);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(t,n,r);return n._shiftPusher&&qt(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},X.drawOne=function(t,e,r){var n,s,f,p=(r=r||{}).axShifts||{},d=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[e._mainSubplot];if(x){if(e._shiftPusher=e.autoshift||-1!==d.indexOf(e._id)||-1!==d.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var _=e.linewidth/2||0;"inside"===e.ticks&&(_+=e.ticklen),qt(e,_,p,!0),qt(e,e.shift||0,p,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,p));var b=x[y+"axislayer"],w=e._mainLinePosition,T=w+=e._shift,k=e._mainMirrorPosition,A=e._vals=X.calcTicks(e),M=[e.mirror,T,k].join("_");for(n=0;n0?r.bottom-u:0,h))));var f=0,p=0;if(e._shiftPusher&&(f=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),e.title.text!==m._dfltTitle[y]&&(p=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(p+=Ct(e))),e._fullDepth=Math.max(f,p)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1],g="number"==typeof e._shift?e._shift:0;if("x"===y){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),d.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var _=e._offset-r.left;_>0&&(n.xl=0,n.l=_)}}else if("l"===l?(e._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=e._depth+g,d.reverse()),r.height>0){var b=r.bottom-(e._offset+e._length);b>0&&(n.yb=0,n.b=b);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==m._dfltTitle[y]&&(n[l]+=Ct(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(o[c]+=h),!0===e.mirror||"ticks"===e.mirror?o[v]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(o[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}ht&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(At(n,e.automargin),At(o,e.automargin)),i.autoMargin(t,Pt(e),n),i.autoMargin(t,zt(e),o),i.autoMargin(t,Dt(e),s)})),o.syncOrAsync(ct)}}function ft(t){var r=g+(t||"tick");return S[r]||(S[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each((function(){var t=Lt(this),e=h.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}));else{var s=X.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,T)),S[r]}},X.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},X.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},X.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,f=t.tickfont?t.tickfont.size:12;return(o||n)&&(u+=f*Z,h+=(t.linewidth||0)/2),(i||a)&&(u+=(t.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=f*(1-Z)),(i||n)&&(u=-u),"bottom"!==c&&"right"!==c||(h=-h),[l?u:0,s?h:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],l=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=t.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===t._id.charAt(0)?function(e){return s(i+t._offset+t.l2p(St(e))+r,a+n)}:function(e){return s(a+n,i+t._offset+t.l2p(St(e))+r)}},X.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},X.makeLabelFns=function(t,e,r){var i=t.ticklabelposition||"",a=function(t){return-1!==i.indexOf(t)},s=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||s||c,h=a("inside"),f="inside"===i&&"inside"===t.ticks||!h&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,m=f?t.ticklen:0;if(h?m*=-1:u&&(m=0),f&&(p+=m,r)){var g=o.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(f||t.showline)&&(p+=.2*t.tickfont.size);var y,v,x,_,b,w={labelStandoff:p+=(t.linewidth||1)/2*(h?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if("x"===A)_=(b=!h&&"bottom"===k||h&&"top"===k)?1:-1,h&&(_*=-1),y=d*_,v=e+p*_,x=b?1:-.2,90===Math.abs(M)&&(h?x+=G:x=-90===M&&"bottom"===k?Z:90===M&&"top"===k?G:.5,T=G/2*(M/90)),w.xFn=function(t){return t.dx+y+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return n(e)&&0!==e&&180!==e?e*_<0!==h?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==h?-n:0};else if("y"===A){if(_=(b=!h&&"left"===k||h&&"right"===k)?1:-1,h&&(_*=-1),y=p,v=d*_,x=0,h||90!==Math.abs(M)||(x=-90===M&&"left"===k||90===M&&"right"===k?Z:.5),h){var S=n(M)?+M:0;if(0!==S){var E=o.deg2rad(S);T=Math.abs(Math.sin(E))*Z*_,x=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*x)*_+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*G},w.anchorFn=function(t,e){return n(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},X.drawTicks=function(t,e,n){n=n||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?n.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?n.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Et);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ut(e,[N]),o.attr("transform",n.transFn)},X.drawGrid=function(t,e,n){if(n=n||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?n.vals.filter((function(t){return t.minor})):[],s=e.showgrid?n.vals.filter((function(t){return!t.minor})):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,f=0;f=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Et);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof n.path&&x.attr("d",n.path)}}Ut(e,[j,B])}},X.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=X.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return J(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Ut(e,[F])},X.drawLabels=function(t,e,i){i=i||{};var a=t._fullLayout,c=e._id,u=i.cls||c+"tick",f=i.vals.filter((function(t){return t.text})),p=i.labelFns,d=i.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[u],g=i.layer.selectAll("g."+u).data(e.showticklabels?f:[],Et),y=[];function v(t,a){t.each((function(t){var o=r.select(this),c=o.select(".text-math-group"),u=p.anchorFn(t,a),f=i.transFn.call(o.node(),t)+(n(a)&&0!=+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),d=l.lineCount(o),m=W*t.fontSize,g=p.heightFn(t,n(a)?+a:0,(d-1)*m);if(g&&(f+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",f+s(v,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(e){var n=r.select(this),i=t._promises.length;n.call(l.positionText,p.xFn(e),p.yFn(e)).call(h.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(l.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){v(n,d)}))):v(n,d)})),Ut(e,[U]),g.exit().remove(),i.repositionOnUpdate&&g.each((function(t){r.select(this).select("text").call(l.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var n=e.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===e._id.charAt(0),l=0,c=s?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),p=Math.max(l,c),d=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>p||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},v(g,m+1?m:d);var x=null;e._selections&&(e._selections[u]=g);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,_.push((function(){v(g,m)}))):_.push((function(){if(v(g,d),f.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=e.autotickangles[0];var t,r=0,n=[],a=1;g.each((function(t){r=Math.max(r,t.fontSize);var i=e.l2p(t.x),o=Lt(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})}));var s=("boundaries"===e.tickson||e.showdividers)&&!i.secondary,c=f.length,u=Math.abs((f[c-1].x-f[0].x)*e._m)/(c-1),p=s?u/2:u,m=s?e.ticklen:1.25*r*a,y=p/Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),_=e.autotickangles.map((function(t){return t*Math.PI/180})),b=_.find((function(t){return Math.abs(Math.cos(t))<=y}));void 0===b&&(b=_.reduce((function(t,e){return Math.abs(Math.cos(t))O*D&&(L=D,E[S]=C[S]=P[S])}var R=Math.abs(L-I);R-k>0?k*=1+k/(R-=k):k=0,"y"!==e._id.charAt(0)&&(k=-k),E[M]=w.p2r(w.r2p(C[M])+A*k),"min"===w.autorange||"max reversed"===w.autorange?(E[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(E[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=E}var V=o.syncOrAsync(_);return V&&V.then&&t._promises.push(V),V},X.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(t,e,r){var n=o.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===R)&&(It(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=X.counterLetter(e._id),l=e._offset+(Math.abs(n[0])1)for(n=1;n4/3-s?o:s}}}),cr=d({"src/components/dragelement/cursor.js"(t,e){var r=se(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,i,a){return t="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*e),0,2),n[e][t]}}}),ur=d({"src/components/dragelement/unhover.js"(t,e){var r=fe(),n=Kt(),i=Ct().getGraphDiv,a=F(),o=e.exports={};o.wrapped=function(t,e,r){(t=i(t))._fullLayout&&n.clear(t._fullLayout._uid+a.HOVERID),o.raw(t,e,r)},o.raw=function(t,e){var n=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}}}),hr=d({"src/components/dragelement/index.js"(t,e){var r=or(),n=ue(),i=sr(),a=se().removeElement,o=ye(),s=e.exports={};s.align=lr(),s.getCursor=cr();var l=ur();function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function u(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(t){var e,r,l,h,f,p,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=b,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=b,x.addEventListener("touchstart",b,{passive:!1})):x.ontouchstart=b;var _=t.clampFn||function(t,e,r){return Math.abs(t)v&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,p),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var i=u(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,i[0],i[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},s.coverSlip=c}}),fr=d({"src/lib/setcursor.js"(t,e){e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}}}),pr=d({"src/lib/override_cursor.js"(t,e){var r=fr(),n="data-savedcursor";e.exports=function(t,e){var i=t.attr(n);if(e){if(!i){for(var a=(t.attr("class")||"").split(" "),o=0;o("legend"===t?1:0));if(!1===M&&(c[t]=void 0),(!1!==M||h.uirevision)&&(p("uirevision",c.uirevision),!1!==M)){p("borderwidth");var S,E,C,I="h"===p("orientation"),L="paper"===p("yref"),P="paper"===p("xref"),z="left";if(I?(S=0,r.getComponentMethod("rangeslider","isVisible")(e.xaxis)?L?(E=1.1,C="bottom"):(E=1,C="top"):L?(E=-.1,C="top"):(E=0,C="bottom")):(E=1,C="auto",P?S=1.02:(S=1,z="right")),n.coerce(h,f,{x:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:S}},"x"),n.coerce(h,f,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:E}},"y"),p("traceorder",b),l.isGrouped(c[t])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",z),p("yanchor",C),p("valign"),n.noneOrAll(h,f,["x","y"]),p("title.text")){p("title.side",I?"left":"top");var D=n.extendFlat({},d,{size:n.bigFont(d.size)});n.coerceFont(p,"title.font",D)}}}}e.exports=function(t,e,r){var i,a=r.slice(),o=e.shapes;if(o)for(i=0;iS&&(M=S)}k[a][0]._groupMinRank=M,k[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(k.forEach((function(t,e){t[0]._preGroupSort=e})),k.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;ar?r:t}e.exports=function(t,e,g){var y=e._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,_=(x+2*f.itemGap)/2,b=a(_,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function T(t,i,a){var c=t[0].trace,u=c.marker||{},h=u.line||{},f=u.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=a?c.visible&&c.type===a:n.traceIs(c,"bar"),d=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(p?[t]:[]);d.enter().append("path").classed("legend"+a,!0).attr("d",f).attr("transform",b),d.exit().remove(),d.each((function(t){var n=r.select(this),i=t[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var f=i.mcc;if(!g._inHover&&"mc"in i){var p=l(u),d=p.mid;void 0===d&&(d=(p.max+p.min)/2),f=o.tryColorscale(u,"")(d)}var y=f||i.mc||u.color,v=u.pattern,x=v&&o.getPatternAttr(v.shape,0,"");if(x){var _=o.getPatternAttr(v.bgcolor,0,null),b=o.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=m(v.size,8,10),A=m(v.solidity,.5,1),M="legend-"+c.uid;n.call(o.pattern,"legend",e,M,x,k,A,f,v.fillmode,_,b,T)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function k(t,a,o){var s=t[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),f=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[t]:[]);if(f.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),f.exit().remove(),f.size()){var p=l.marker||{},d=w(h(p.line.width,s.pts),p.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:d}}},m),y=i.minExtend(s,{trace:g},m);u(f,y,g,e)}}t.each((function(t){var e=r.select(this),n=i.ensureSingle(e,"g","layers");n.style("opacity",t[0].trace.opacity);var o=g.indentation,s=g.valign,l=t[0].lineHeight,c=t[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=n.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var n,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=r.select(this),f=l(a),d=f.colorscale,m=f.reversescale;if(d){if(!n){var g=d.length;u=0===c?d[m?g-1:0][1]:1===c?d[m?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",t[0]),u?h.call(s.fill,u):h.call((function(t){if(t.size()){var r="legendfill-"+a.uid;o.gradient(t,e,r,p(m,"radial"===n),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,n="waterfall"===e.type;if(t[0]._distinct&&n){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&n&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var n=r.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var a=t[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),l.exit().remove(),l.each((function(){var t=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);t.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(t,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var n,a,s=d(t),u=s.showFill,h=s.showLine,f=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=t[0],_=v.trace,b=l(_),T=b.colorscale,k=b.reversescale,A=c.hasMarkers(_)||!g?"M5,0":y?"M5,-2":"M5,-3",M=r.select(this),S=M.select(".legendfill").selectAll("path").data(u||m?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(u)o.fillGroupStyle(t,e,!0);else{var r="legendfill-"+_.uid;o.gradient(t,e,r,p(k),T,"fill")}})),h||f){var E=w(void 0,_.line,10,5);a=i.minExtend(_,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(h||f?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",A+(f?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+_.uid;o.lineGroupStyle(t),o.gradient(t,e,r,p(k),T,"stroke")}})})).each((function(t){var n,a,s=d(t),l=s.anyFill,u=s.anyLine,h=s.showLine,f=s.showMarker,p=t[0],m=p.trace,g=!f&&!u&&!l&&c.hasText(m);function y(t,e,r,n){var a=i.nestedProperty(m,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(f||g||h){var _={},w={};if(f){_.mc=y("marker.color",x),_.mx=y("marker.symbol",x),_.mo=y("marker.opacity",i.mean,[.2,1]),_.mlc=y("marker.line.color",x),_.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",i.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(_.tx="Aa",_.tp=y("textposition",x),_.ts=10,_.tc=y("textfont.color",x),_.tf=y("textfont.family",x),_.tw=y("textfont.weight",x),_.ty=y("textfont.style",x),_.tv=y("textfont.variant",x),_.tC=y("textfont.textcase",x),_.tE=y("textfont.lineposition",x),_.tS=y("textfont.shadow",x)),n=[i.minExtend(p,_)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var k=r.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(f?n:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),A.exit().remove(),A.call(o.pointStyle,a,e),f&&(n[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?n:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),M.exit().remove(),M.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),kr=d({"src/components/legend/draw.js"(t,e){var r=v(),n=se(),i=Te(),a=Vt(),o=fe(),s=hr(),l=Je(),c=q(),u=Me(),h=yr(),f=vr(),p=Ae(),d=p.LINE_SPACING,m=p.FROM_TL,g=p.FROM_BR,y=xr(),x=Tr(),_=mr(),b=/^legend[0-9]*$/;function w(t,e){var o,h,p=e||{},v=t._fullLayout,b=L(p),w=p._inHover;if(w?(h=p.layer,o="hover"):(h=v._infolayer,o=b),h){var M;if(o+=v._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!p.entries)return;M=y(p.entries,p)}else{for(var P=(t.calcdata||[]).slice(),z=v.shapes,D=0;D1)}var F=v.hiddenlabels||[];if(!(w||v.showlegend&&M.length))return h.selectAll("."+b).remove(),v._topdefs.select("#"+o).remove(),i.autoMargin(t,b);var j=n.ensureSingle(h,"g",b,(function(t){w||t.attr("pointer-events","all")})),B=n.ensureSingleById(v._topdefs,"clipPath",o,(function(t){t.append("rect")})),N=n.ensureSingle(j,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));N.call(c.stroke,p.bordercolor).call(c.fill,p.bgcolor).style("stroke-width",p.borderwidth+"px");var U,V=n.ensureSingle(j,"g","scrollbox"),q=p.title;p._titleWidth=0,p._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",b+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),E(U,V,t,p,1)):V.selectAll("."+b+"titletext").remove();var H=n.ensureSingle(j,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),G=V.selectAll("g.groups").data(M);G.enter().append("g").attr("class","groups"),G.exit().remove();var Z=G.selectAll("g.traces").data(n.identity);Z.enter().append("g").attr("class","traces"),Z.exit().remove(),Z.style("opacity",(function(t){var e=t[0].trace;return a.traceIs(e,"pie-like")?-1!==F.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){r.select(this).call(A,t,p)})).call(x,t,p).each((function(){w||r.select(this).call(S,t,b)})),n.syncOrAsync([i.previousPromises,function(){return function(t,e,n,i){var a=t._fullLayout,o=L(i);i||(i=a[o]);var s=a._size,c=_.isVertical(i),u=_.isGrouped(i),h="fraction"===i.entrywidthmode,p=i.borderwidth,d=2*p,m=f.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(p+m),v=I(i),x=i.y<0||0===i.y&&"top"===v,b=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,k={};i._maxHeight=Math.max(x||b?a.height/2:s.h,30);var A=0;i._width=0,i._height=0;var M=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(c)n.each((function(t){var e=t[0].height;l.setTranslate(this,p+M[0],p+M[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)})),A=g+i._width,i._width+=m+g+d,i._height+=y,u&&(e.each((function(t,e){l.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var S=C(i),E=i.x<0||0===i.x&&"right"===S,P=i.x>1||1===i.x&&"left"===S,z=b||x,D=a.width/2;i._maxWidth=Math.max(E?z&&"left"===S?s.l+s.w:D:P?z&&"right"===S?s.r+s.w:D:s.w,2*g);var O=0,R=0;n.each((function(t){var e=T(t,i,g);O=Math.max(O,e),R+=e})),A=null;var F=0;if(u){var j=0,B=0,N=0;e.each((function(){var t=0,e=0;r.select(this).selectAll("g.traces").each((function(r){var n=T(r,i,g),a=r[0].height;l.setTranslate(this,M[0],M[1]+p+m+a/2+e),e+=a,t=Math.max(t,n),k[r[0].trace.legendgroup]=t}));var n=t+m;B>0&&n+p+B>i._maxWidth?(F=Math.max(F,B),B=0,N+=j+w,j=e):j=Math.max(j,e),l.setTranslate(this,B,N),B+=n})),i._width=Math.max(F,B)+p,i._height=N+j+y}else{var U=n.size(),V=R+d+(U-1)*m=i._maxWidth&&(F=Math.max(F,Z),H=0,G+=q,i._height+=q,q=0),l.setTranslate(this,M[0]+p+H,M[1]+p+G+e/2+m),Z=H+r+m,H+=n,q=Math.max(q,e)})),V?(i._width=H+d,i._height=q+y):(i._width=Math.max(F,Z)+d,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+M[0],i._titleWidth+2*(p+f.titlePad))),i._height=Math.ceil(Math.max(i._height+M[1],i._titleHeight+2*(p+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var W=t._context.edits,Y=W.legendText||W.legendPosition;n.each((function(t){var e=r.select(this).select("."+o+"toggle"),n=t[0].height,a=t[0].trace.legendgroup,s=T(t,i,g);u&&""!==a&&(s=k[a]);var f=Y?g:A||s;c||h||(f+=m/2),l.setRect(e,0,-n/2,f,n)}))}(t,G,Z,p)},function(){var e,c,y,x,_=v._size,T=p.borderwidth,A="paper"===p.xref,M="paper"===p.yref;if(q.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*d,i=0,a=t.node(),o=l.bBox(a).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*f.titlePad-o):"top right"===e.title.side&&(i=e._width-2*r-2*f.titlePad-o),u.positionText(t,r+f.titlePad+i,r+n)}}(U,p,T),!w){var S,E;S=A?_.l+_.w*p.x-m[C(p)]*p._width:v.width*p.x-m[C(p)]*p._width,E=M?_.t+_.h*(1-p.y)-m[I(p)]*p._effHeight:v.height*(1-p.y)-m[I(p)]*p._effHeight;var L=function(t,e,r,n){var a=t._fullLayout,o=a[e],s=C(o),l=I(o),c="paper"===o.xref,u="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var h=o.y<.5?"b":"t",f=o.x<.5?"l":"r",p={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});c?t._fullLayout._reservedMargin[e][h]=p[h]:u||"v"===o.orientation?t._fullLayout._reservedMargin[e][f]=p[f]:t._fullLayout._reservedMargin[e][h]=p[h]}(t,b,S,E);if(L)return;if(v.margin.autoexpand){var P=S,z=E;S=A?n.constrain(S,0,v.width-p._width):P,E=M?n.constrain(E,0,v.height-p._effHeight):z,S!==P&&n.log("Constrain "+b+".x to make legend fit inside graph"),E!==z&&n.log("Constrain "+b+".y to make legend fit inside graph")}l.setTranslate(j,S,E)}if(H.on(".drag",null),j.on("wheel",null),w||p._height<=p._maxHeight||t._context.staticPlot){var D=p._effHeight;w&&(D=p._height),N.attr({width:p._width-T,height:D-T,x:T/2,y:T/2}),l.setTranslate(V,0,0),B.select("rect").attr({width:p._width-2*T,height:D-2*T,x:T,y:T}),l.setClipUrl(V,o,t),l.setRect(H,0,0,0,0),delete p._scrollY}else{var O,R,F,G=Math.max(f.scrollBarMinHeight,p._effHeight*p._effHeight/p._height),Z=p._effHeight-G-2*f.scrollBarMargin,W=p._height-p._effHeight,Y=Z/W,X=Math.min(p._scrollY||0,W);N.attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-T,x:T/2,y:T/2}),B.select("rect").attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-2*T,x:T,y:T+X}),l.setClipUrl(V,o,t),J(X,G,Y),j.on("wheel",(function(){J(X=n.constrain(p._scrollY+r.event.deltaY/Z*W,0,W),G,Y),0!==X&&X!==W&&r.event.preventDefault()}));var $=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=X})).on("drag",(function(){var t,e=r.event.sourceEvent;2===e.buttons||e.ctrlKey||(R="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,t=(R-O)/Y+F,J(X=n.constrain(t,0,W),G,Y))}));H.call($);var K=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,F=X)})).on("drag",(function(){var t,e=r.event.sourceEvent;"touchmove"===e.type&&(R=e.changedTouches[0].clientY,t=(O-R)/Y+F,J(X=n.constrain(t,0,W),G,Y))}));V.call(K)}function J(e,r,n){p._scrollY=t._fullLayout[b]._scrollY=e,l.setTranslate(V,0,-e),l.setRect(H,p._width,f.scrollBarMargin+e*n,f.scrollBarWidth,r),B.select("rect").attr("y",T+e)}t._context.edits.legendPosition&&(j.classed("cursor-move",!0),s.init({element:j.node(),gd:t,prepFn:function(t){if(t.target!==H.node()){var e=l.getTranslate(j);y=e.x,x=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==x){var n=y+t,i=x+r;l.setTranslate(j,n,i),e=s.align(n,p._width,_.l,_.l+_.w,p.xanchor),c=s.align(i+p._height,-p._height,_.t+_.h,_.t,p.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[b+".x"]=e,r[b+".y"]=c,a.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=h.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&k(t,j,n,e,r)}}))}],t)}}function T(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function k(t,e,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var c=o.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===c)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==c&&h(r,t,n))}function A(t,e,r){var i,o,s=L(r),c=t.data()[0][0],h=c.trace,p=a.traceIs(h,"pie-like"),d=!r._inHover&&e._context.edits.legendText&&!p,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=p?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(d?M(i,m):i);var y=r.indentation+r.itemwidth+2*f.itemGap;u.positionText(g,y,0),d?g.call(u.makeEditable,{gd:e,text:i}).call(E,t,e,r).on("edit",(function(n){this.text(M(n,m)).call(E,t,e,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",e,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",e,o,h.index)})):E(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,i){var a,o=e._context.doubleClickDelay,s=1,l=n.ensureSingle(t,"rect",i+"toggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-e._legendMouseDownTimeo&&(s=Math.max(s-1,1)),k(e,n,t,s,r.event)}})))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),u.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=L(r);r||(r=e._fullLayout[s]);var c,h,p=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*d;if(o){var g=l.bBox(o);c=g.height,h=g.width,1===n?l.setTranslate(a,p,p+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=t.select(y),x=u.lineCount(v),_=v.node();if(c=m*x,h=_?l.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),u.positionText(v,p+f.titlePad,p+m);else{var b=2*f.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(b=f.itemGap,h-=r.indentation+r.itemwidth),u.positionText(v,b,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,16)+3,i.width=h)}else t.remove()}(e,r,n,i)}))}function C(t){return n.isRightAnchor(t)?"right":n.isCenterAnchor(t)?"center":"left"}function I(t){return n.isBottomAnchor(t)?"bottom":n.isMiddleAnchor(t)?"middle":"top"}function L(t){return t._id||"legend"}e.exports=function(t,e){if(e)w(t,e);else{var n=t._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var t=r.select(this),e=t.attr("class").split(" ")[0];e.match(b)&&-1===i.indexOf(e)&&t.remove()}));for(var a=0;a$[0]._length||bt<0||bt>K[0]._length)return p.unhoverRaw(t,n)}else _t="xpx"in n?n.xpx:$[0]._length/2,bt="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=_t+$[0]._offset,n.pointerY=bt+K[0]._offset,nt="xval"in n?y.flat(_,n.xval):y.p2c($,_t),it="yval"in n?y.flat(_,n.yval):y.p2c(K,bt),!r(nt[0])||!r(it[0]))return i.warn("Fx.hover failed",n,t),p.unhoverRaw(t,n)}var At=1/0;function Mt(e,a){for(ot=0;otmt&&(gt.splice(0,mt),At=gt[0].distance),M&&0!==rt&&0===gt.length){dt.distance=rt,dt.index=!1;var u=lt._module.hoverPoints(dt,ft,pt,"closest",{hoverLayer:b._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,p=u.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var d=p[0];r(d.x0)&&r(d.y0)&&(h=Et(d),(!vt.vLinePoint||vt.vLinePoint.spikeDistance>h.spikeDistance)&&(vt.vLinePoint=h))}var m=u.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Et(g),(!vt.hLinePoint||vt.hLinePoint.spikeDistance>h.spikeDistance)&&(vt.hLinePoint=h))}}}}}function St(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Bt-1;Nt--)Ht(gt[Nt]);gt=Ut,Pt()}var Gt=t._hoverdata,Zt=[],Wt=W(t),Yt=Y(t);for(at=0;at1||gt.length>1)||"closest"===S&&xt&>.length>1,se=f.combine(b.plot_bgcolor||f.background,b.paper_bgcolor),le=R(gt,{gd:t,hovermode:S,rotateLabels:oe,bgColor:se,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),ce=le.hoverLabels;if(y.isUnifiedHover(S)||(function(t,e,r,n){var i,a,o,s,l,c,u,h=e?"xa":"ya",f=e?"ya":"xa",p=0,d=1,m=t.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,_=n.minY,b=n.maxY,w=function(t){return t*r._invScaleX},T=function(t){return t*r._invScaleY};function k(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}for(t.each((function(t){var n=t[h],i=t[f],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,p=B(t,e),m=t.anchor,k="end"===m?-1:1;if("middle"===m)u=(c=t.crossPos+(a?T(p.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?T(t.by):w(t.bx));else if(a)u=(c=t.crossPos+T(E+p.y)-T(t.by/2-E))+T(t.by);else{var M=w(k*E+p.x),S=M+w(k*t.bx);c=t.crossPos+Math.min(M,S),u=t.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(u,b)-Math.max(c,_)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||d*(e[0].traceIndex-t[0].traceIndex)}));!i&&p<=m;){for(p++,i=!0,s=0;s.01){for(l=S.length-1;l>=0;l--)S[l].dp+=a;for(M.push.apply(M,S),g.splice(s+1,1),u=0,l=M.length-1;l>=0;l--)u+=M[l].dp;for(o=u/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(k)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var P=L[l],z=P.datum;z.offset=P.dp,z.del=P.del}}}(ce,oe,b,le.commonLabelBoundingBox),N(ce,oe,b._invScaleX,b._invScaleY)),c&&c.tagName){var ue=g.getComponentMethod("annotations","hasClickToShow")(t,Zt);u(e.select(c),ue?"pointer":"")}c&&!s&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Gt)&&(Gt&&t.emit("plotly_unhover",{event:n,points:Gt}),t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:$,yaxes:K,xvals:nt,yvals:it}))}(t,n,o,s,c)}))},t.loneHover=function(t,r){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var i=r.gd,a=W(i),o=Y(i),s=!1,l=R(t.map((function(t){var e=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(e,n),h=Math.max(e,n),p=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,p+=x,d+=x}c.bbox={x0:u+o,x1:h+o,y0:p+a,y1:d+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||f.background,container:e.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,e){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,p=r.bgColor,d=r.container,m=r.outerContainer,v=r.commonLabelOpts||{};if(0===t.length)return[[]];var T=r.fontFamily||x.HOVERFONT,k=r.fontSize||x.HOVERFONTSIZE,A=r.fontWeight||a.font.weight,M=r.fontStyle||a.font.style,S=r.fontVariant||a.font.variant,I=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,P=r.fontShadow||a.font.shadow,D=t[0],O=D.xa,R=D.ya,F=l.charAt(0),B=F+"Label",N=D[B];if(void 0===N&&"multicategory"===O.type)for(var U=0;Ua.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+b+E+"H"+w+"v"+b+(2*C+_.height)+"H"+-w+"V"+b+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===O.side?(Q.minY=x-(2*C+_.height),Q.maxY=x-C):(Q.minY=x+C,Q.maxY=x+(2*C+_.height))}else{var F,j,B;"right"===R.side?(F="start",j=1,B="",y=O._offset+O._length):(F="end",j=-1,B="-",y=O._offset),x=R._offset+(D.y0+D.y1)/2,s.attr("text-anchor",F),r.attr("d","M0,0L"+B+E+","+E+"V"+(C+_.height/2)+"h"+B+(2*C+_.width)+"V-"+(C+_.height/2)+"H"+B+E+"V-"+E+"Z"),Q.minY=x-(C+_.height/2),Q.maxY=x+(C+_.height/2),"right"===R.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+_.width)):(Q.minX=y-E-(2*C+_.width),Q.maxX=y-E);var U,V=_.height/2,H=q-_.top-V,G="clip"+a._uid+"commonlabel"+R._id;if(y<_.width+2*C+E){U="M-"+(E+C)+"-"+V+"h-"+(_.width-C)+"V"+V+"h"+(_.width-C)+"Z";var Z=_.width-y+C;c.positionText(s,Z,H),"end"===F&&s.selectAll("tspan").each((function(){var t=e.select(this),r=h.tester.append("text").text(t.text()).call(h.font,g),i=X(n,r.node());Math.round(i.width)=0?dt:mt+vt=0?mt:Mt+vt=0?ft:pt+xt=0?pt:St+xt=0,"top"!==t.idealAlign&&K||!J?K?(B+=V/2,t.anchor="start"):t.anchor="middle":(B-=V/2,t.anchor="end"),t.crossPos=B;else{if(t.pos=B,K=F+U/2+Q<=H,J=F-U/2-Q>=0,"left"!==t.idealAlign&&K||!J)if(K)F+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=F+tt-H,rt=F-tt;et>0&&(F-=et),rt<0&&(F+=-rt)}else F-=U/2,t.anchor="end";t.crossPos=F}b.attr("text-anchor",t.anchor),D&&z.attr("text-anchor",t.anchor),r.attr("transform",o(F,B)+(u?s(w):""))})),{hoverLabels:Et,commonLabelBoundingBox:Q}}function j(t,e,r,n,a,o){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=i.templateString(t.name,t.trace._meta)),s=G(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===a?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),o&&""===l&&!t.hovertemplate&&(""===s&&o.remove(),l=s);var h=t.hovertemplate||!1;if(h){var f=t.hovertemplateLabels||t;t[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),l=(l=i.hovertemplateString(h,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=G(r,t.nameLength),""}))}return[l,s]}function B(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*M),{x:r,y:n}}function N(t,r,n,i){var a=function(t){return t*n},o=function(t){return t*i};t.each((function(t){var n=e.select(this);if(t.del)return n.remove();var i,s,l,u,f=n.select("text.nums"),p=t.anchor,d="end"===p?-1:1,m=(s={start:1,end:-1,middle:0}[(i=t).anchor],u=(l=s*(E+C))+s*(i.txwidth+C),"middle"===i.anchor&&(l-=i.tx2width/2,u+=i.txwidth/2+C),{alignShift:s,textShiftX:l,text2ShiftX:u}),g=B(t,r),y=g.x,v=g.y,x="middle"===p;n.select("path").attr("d",x?"M-"+a(t.bx/2+t.tx2width/2)+","+o(v-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(d*E+y)+","+o(E+v)+"v"+o(t.by/2-E)+"h"+a(d*t.bx)+"v-"+o(t.by)+"H"+a(d*E+y)+"V"+o(v-E)+"Z");var _=y+m.textShiftX,b=v+t.ty0-t.by/2+C,w=t.textAlign||"auto";"auto"!==w&&("left"===w&&"start"!==p?(f.attr("text-anchor","start"),_=x?-t.bx/2-t.tx2width/2+C:-t.bx-C):"right"===w&&"end"!==p&&(f.attr("text-anchor","end"),_=x?t.bx/2-t.tx2width/2-C:t.bx+C)),f.call(c.positionText,a(_),o(b)),t.tx2width&&(n.select("text.name").call(c.positionText,a(m.text2ShiftX+m.alignShift*C+y),o(v+t.ty0-t.by/2+C)),n.select("rect").call(h.setRect,a(m.text2ShiftX+(m.alignShift-1)*t.tx2width/2+y),o(v-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function U(t,e){var n=t.index,a=t.trace||{},o=t.cd[0],s=t.cd[n]||{};function l(t){return t||r(t)&&0===t}var c=Array.isArray(n)?function(t,e){var r=i.castOption(o,n,t);return l(r)?r:i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(s,a,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===a.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+f,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function V(t,e,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||u){var m=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,_,b=n.readability(v.color,m)<1.5?f.contrast(m):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,A=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,_=g),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,_=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?T:-T),cy:y,r:T,fill:k}).classed("spikeline",!0)}if(p){var E,C,I=e.vLinePoint;i=I&&I.xa,a=I&&I.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.pointerY):(E=i._offset+I.x,C=a._offset+I.y);var L,P,z=n.readability(I.color,m)<1.5?f.contrast(m):I.color,D=i.spikemode,O=i.spikethickness,R=i.spikecolor||z,F=d.getPxPosition(t,i);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(L=F,P=C),-1!==D.indexOf("across")){var j=i._counterDomainMin,B=i._counterDomainMax;"free"===i.anchor&&(j=Math.min(j,i.position),B=Math.max(B,i.position)),L=l.t+(1-B)*l.h,P=l.t+(1-j)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==i.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function H(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function G(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function Z(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function W(t){return t.offsetTop+t.clientTop}function Y(t){return t.offsetLeft+t.clientLeft}function X(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],f=c[1],p=u[0],d=u[1];return{x:h,y:f,width:p-h,height:d-f,top:Math.min(f,d),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(f,d)}}}}),Mr=d({"src/components/fx/hoverlabel_defaults.js"(t,e){var r=se(),n=q(),i=Xe().isUnifiedHover;e.exports=function(t,e,a,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Sr=d({"src/components/fx/layout_global_defaults.js"(t,e){var r=se(),n=Mr(),i=j();e.exports=function(t,e){n(t,e,(function(n,a){return r.coerce(t,e,i,n,a)}))}}}),Er=d({"src/components/fx/defaults.js"(t,e){var r=se(),n=B(),i=Mr();e.exports=function(t,e,a,o){var s=r.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,(function(i,a){return r.coerce(t,e,n,i,a)}),s)}}}),Cr=d({"src/components/fx/hovermode_defaults.js"(t,e){var r=se(),n=j();e.exports=function(t,e){function i(i,a){return void 0!==e[i]?e[i]:r.coerce(t,e,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}}),Ir=d({"src/components/fx/layout_defaults.js"(t,e){var r=se(),n=j(),i=Cr(),a=Mr();e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}i(t,e)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=e._has("mapbox"),l=e._has("map"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode="pan"),a(t,e,o),r.coerceFont(o,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}}),Lr=d({"src/components/fx/calc.js"(t,e){var r=se(),n=Vt();function i(t,e,n,i){i=i||r.identity,Array.isArray(t)&&(e[0][n]=i(t))}e.exports=function(t){var e=t.calcdata,a=t._fullLayout;function o(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var s=0;s"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),Fr=d({"src/components/shapes/draw_newshape/constants.js"(t,e){e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),jr=d({"src/components/selections/helpers.js"(t,e){var r=se().strTranslate;function n(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:n,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return n(t,r[e])}},getTransform:function(t){return r(t.xaxis._offset,t.yaxis._offset)}}}}),Br=d({"src/components/shapes/draw_newshape/helpers.js"(t){var e=$e(),r=Fr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=jr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(t,e){return Math.abs(t-e)<=1e-6}function h(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}t.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n0&&up&&(t="X"),t}));return a>p&&(d=d.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),u+d}))}(o,l,u);if("pixel"===o.xsizemode){var A=l(o.xanchor);h=A+o.x0+b,f=A+o.x1+w}else h=l(o.x0)+b,f=l(o.x1)+w;if("pixel"===o.ysizemode){var M=u(o.yanchor);p=M-o.y0+T,d=M-o.y1+k}else p=u(o.y0)+T,d=u(o.y1)+k;if("line"===m)return"M"+h+","+p+"L"+f+","+d;if("rect"===m)return"M"+h+","+p+"H"+f+"V"+d+"H"+h+"Z";var S=(h+f)/2,E=(p+d)/2,C=Math.abs(S-h),I=Math.abs(E-p),L="A"+C+","+I,P=S+C+","+E;return"M"+P+L+" 0 1,1 "+S+","+(E-I)+L+" 0 0,1 "+P+"Z"}}}),Hr=d({"src/components/shapes/display_labels.js"(t,e){var r=se(),n=nr(),i=Me(),a=Je(),o=Br().readPaths,s=qr(),l=s.getPathString,c=Ot(),u=Ae().FROM_TL;e.exports=function(t,e,h,f){if(f.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var p;if(h.label.texttemplate){var d={};if("path"!==h.type){var m=n.getFromId(t,h.xref),g=n.getFromId(t,h.yref);for(var y in c){var v=c[y](h,m,g);void 0!==v&&(d[y]=v)}}p=r.texttemplateStringForShapes(h.label.texttemplate,{},t._fullLayout._d3locale,d)}else p=h.label.text;var x,_,b,w,T={"data-index":e},k=h.label.font,A=f.append("g").attr(T).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(p);if(h.path){var M=l(t,h),S=o(M,t);x=1/0,b=1/0,_=-1/0,w=-1/0;for(var E=0;E=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,b,_,w):0),A.call((function(e){return e.call(a.font,k).attr({}),i.convertToTspans(e,t),e}));var G=function(t,e,r,n,i,a,o){var s,l,c,h,f=i.label.textposition,p=i.label.textangle,d=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,_=i.label.yanchor;if("line"===m){"start"===f?(s=t,l=e):"end"===f?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===f?"auto"===p?r>t?"left":rt?"right":rt?"right":rt?"left":r1&&(2!==t.length||"Z"!==t[1][0])&&(0===I&&(t[0][0]="M"),e[C]=t,A(),M())}}()}}function V(t,r){!function(t,r){if(e.length)for(var n=0;nR&&a>F&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";d(e,l),O=l.split("-")[0]}}function st(r){_(t)||(j&&(w=J(o.xanchor)),B&&(A=Q(o.yanchor)),"path"===o.type?D=o.path:(f=j?o.x0:J(o.x0),v=B?o.y0:Q(o.y0),x=j?o.x1:J(o.x1),b=B?o.y1:Q(o.y1)),fb?(M=v,I="y0",S=b,L="y1"):(M=b,I="y1",S=v,L="y0"),ot(r),ft(c,o),dt(e,o,t),nt.moveFn="move"===O?ut:ht,nt.altKey=r.altKey)}function lt(){_(t)||(d(e),pt(c),T(e,t,o),n.call("_guiRelayout",t,u.getUpdateObj()))}function ct(){_(t)||pt(c)}function ut(r,n){if("path"===o.type){var i=function(t){return t},a=i,u=i;j?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(J(t)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=et(A+n)):(u=function(t){return et(Q(t)+n)},Z&&"date"===Z.type&&(u=g.encodeDate(u))),V("path",o.path=k(D,a,u))}else j?V("xanchor",o.xanchor=tt(w+r)):(V("x0",o.x0=tt(f+r)),V("x1",o.x1=tt(x+r))),B?V("yanchor",o.yanchor=et(A+n)):(V("y0",o.y0=et(v+n)),V("y1",o.y1=et(b+n)));e.attr("d",y(t,o)),ft(c,o),l(t,s,o,q)}function ht(r,n){if(U){var i=function(t){return t},a=i,u=i;j?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(J(t)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=et(A+n)):(u=function(t){return et(Q(t)+n)},Z&&"date"===Z.type&&(u=g.encodeDate(u))),V("path",o.path=k(D,a,u))}else if(N){if("resize-over-start-point"===O){var h=f+r,p=B?v-n:v+n;V("x0",o.x0=j?h:tt(h)),V("y0",o.y0=B?p:et(p))}else if("resize-over-end-point"===O){var d=x+r,m=B?b-n:b+n;V("x1",o.x1=j?d:tt(d)),V("y1",o.y1=B?m:et(m))}}else{var _=function(t){return-1!==O.indexOf(t)},T=_("n"),G=_("s"),W=_("w"),Y=_("e"),X=T?M+n:M,$=G?S+n:S,K=W?E+r:E,rt=Y?C+r:C;B&&(T&&(X=M-n),G&&($=S-n)),(!B&&$-X>F||B&&X-$>F)&&(V(I,o[I]=B?X:et(X)),V(L,o[L]=B?$:et($))),rt-K>R&&(V(P,o[P]=j?K:tt(K)),V(z,o[z]=j?rt:tt(rt)))}e.attr("d",y(t,o)),ft(c,o),l(t,s,o,q)}function ft(t,e){function r(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]),a=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":a}).classed("visual-cue",!0);var o=J(j?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,m.paramIsX))),s=Q(B?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),j&&B){var l="M"+(o-1-a)+","+(s-1-a)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(j){var c="M"+(o-1-a)+","+(s-9-a)+"v18 h2 v-18 Z";n.attr("d",c)}else{var u="M"+(o-9-a)+","+(s-1-a)+"h18 v2 h-18 Z";n.attr("d",u)}}(j||B)&&r()}function pt(t){t.selectAll(".visual-cue").remove()}function dt(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}p.init(nt),rt.node().onmousemove=ot}(t,F,v,e,c,O):!0===v.editable&&F.style("pointer-events",z||u.opacity(C)*E<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(t,e){if(b(t)){var r=e.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=n,t._fullLayout._deactivateShape=A,x(t)}}}(t,F)}))}v._input&&!0===v.visible&&("above"===v.layer?M(t._fullLayout._shapeUpperLayer):"paper"===v.xref||"paper"===v.yref?M(t._fullLayout._shapeLowerLayer):"between"===v.layer?M(w.shapelayerBetween):w._hadPlotinfo?M((w.mainplotinfo||w).shapelayer):M(t._fullLayout._shapeLowerLayer))}function T(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function k(t,e,r){return t.replace(m.segmentRE,(function(t){var n=0,i=t.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+t.substr(1).replace(m.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,x(t))}e.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(b(t)){c(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e1?(P=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],z=["resetGeo"]):g?(P=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(L=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],P=["toggleHover"],z=["resetViewMap"]):v?P=["hoverClosestPie"]:A?(P=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):P=["toggleHover"],m&&P.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;en?i.substr(n):a.substr(r))+o:i+a+t*e:o}function d(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;os*x)||T)for(i=0;iz&&FL&&(L=F);f/=(L-I)/(2*P),I=c.l2r(I),L=c.l2r(L),c.range=c._input.range=S=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function T(r){var a,o,c,p,d,m,g=r._fullLayout,y=g._size,v=y.p,x=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),t.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function _(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-v-n:e._offset+e._length+v+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+v+n:e._offset-v-n:y.l+y.w*(t.position||0)+n%1}for(a=0;a.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,r,m);if(g>0){!function(t,e,r,a){var o="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(t,e,r,n,a){var o="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=i.isTopAnchor(e)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(e)&&"t"===r||i.isBottomAnchor(e)&&"b"===r)&&l=0;k--){var A=i.append("path").attr(g).style("opacity",k?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,k?"solid":b,k?4+_:_);if(p(A,t,f),w){var M=s(t.layout,"selections",f);A.style({cursor:"move"});var S={element:A.node(),plotinfo:m,gd:t,editHelpers:M,isActiveSelection:!0},E=r(l,t);n(E,A,S)}else A.style("pointer-events",k?"all":"none");T[k]=A}var C=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(h(t)){var r=e.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===t._fullLayout._activeSelectionIndex)return void d(t);t._fullLayout._activeSelectionIndex=n,t._fullLayout._deactivateSelection=d,u(t)}}}(t,C)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;o.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function d(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,u(t))}e.exports={draw:u,drawOne:f,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=d,u(t)}}}}}),an=d({"node_modules/polybooljs/lib/build-log.js"(t,e){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}}}),on=d({"node_modules/polybooljs/lib/epsilon.js"(t,e){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}}}),sn=d({"node_modules/polybooljs/lib/linked-list.js"(t,e){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}}}),ln=d({"node_modules/polybooljs/lib/intersecter.js"(t,e){var r=sn();e.exports=function(t,e,n){function i(t,e,r){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=r.create();function o(t,r){a.insertBefore(t,(function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(t,e){var n=function(t,e){var n=r.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(n,t.end),n}(t,e);return function(t,e,n){var i=r.node({isStart:!1,pt:e.end,seg:e,primary:n,other:t,status:null});t.other=i,o(i,t.pt)}(n,t,e),n}function l(t,e){var r=i(e,t.seg.end,t.seg);return function(t,e){n&&n.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(r,t.primary)}function c(i,o){var s=r.create();function c(t){return s.findTransition((function(r){var n=function(t,r){var n=t.seg.start,i=t.seg.end,a=r.seg.start,o=r.seg.end;return e.pointsCollinear(n,a,o)?e.pointsCollinear(i,a,o)||e.pointAboveOrOnLine(i,a,o)?1:-1:e.pointAboveOrOnLine(n,a,o)?1:-1}(t,r.ev);return n>0}))}function u(t,r){var i=t.seg,a=r.seg,o=i.start,s=i.end,c=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),p=e.pointsSame(s,u);if(f&&p)return r;var d=!f&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(f)return m?l(r,s):l(t,u),r;d&&(p||(m?l(r,s):l(t,u)),l(r,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(r,o):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,s));return!1}for(var h=[];!a.isEmpty();){var f=a.getHead();if(n&&n.vert(f.pt[0]),f.isStart){let e=function(){if(d){var t=u(f,d);if(t)return t}return!!m&&u(f,m)};n&&n.segmentNew(f.seg,f.primary);var p=c(f),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;n&&n.tempStatus(f.seg,!!d&&d.seg,!!m&&m.seg);var g,y,v=e();if(v)t?(y=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above):v.seg.otherFill=f.seg.myFill,n&&n.segmentUpdate(v.seg),f.other.remove(),f.remove();if(a.getHead()!==f){n&&n.rewind(f.seg);continue}t?(y=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=y?!f.seg.myFill.below:f.seg.myFill.below):null===f.seg.otherFill&&(g=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:i,f.seg.otherFill={above:g,below:g}),n&&n.status(f.seg,!!d&&d.seg,!!m&&m.seg),f.other.status=p.insert(r.node({ev:f}))}else{var x=f.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}h.push(f.seg)}a.getHead().remove()}return n&&n.done(),h}return t?{addRegion:function(t){for(var r,i,a,o=t[t.length-1],l=0;la!=p>a&&i<(f-u)*(a-h)/(p-h)+u&&(o=!o)}return o}}}),dn=d({"src/lib/polygon.js"(t,e){var r=Et().dot,n=k().BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),e=1;ea||c===n||cs||e&&l(t))}:function(t,e){var l=t[0],c=t[1];if(l===n||la||c===n||cs)return!1;var u,h,f,p,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(h,g)||c>Math.max(f,y)))if(cu||Math.abs(r(o,f))>i)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}}}),mn=d({"src/components/selections/constants.js"(t,e){e.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),gn=d({"src/components/selections/select.js"(t,e){var r=fn(),n=pn(),i=Vt(),a=Je().dashStyle,o=q(),s=zr(),l=Xe().makeEventData,c=Dr(),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,m=qr(),g=Vr(),y=Gr(),v=xe().clearOutline,x=Br(),_=x.handleEllipse,b=x.readPaths,w=Nr().newShapes,T=Ur(),k=nn().activateLastSelection,A=se(),M=A.sorterAsc,S=dn(),E=Kt(),C=ve().getFromId,I=Or(),L=rn().redrawReglTraces,P=mn(),z=P.MINSELECT,D=S.filter,O=S.tester,R=jr(),F=R.p2r,j=R.axValue,B=R.getTransform;function N(t){return void 0!==t.subplot}function U(t,e,r,n,i,a,o){var s,l,c,u,h,f,d,m,g,v=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,_=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){Z(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(f=K(b))){for(o&&o.remove(),g=0;g=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(r),l=d(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,t)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(t)&&(u=T(h,t)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){e&&k(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Y(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Y),c=r.map(Y);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function J(t,e,r){var n,a;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ct(et);ut([C(t,nt,"x"),C(t,pt,"y")])(Q,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),p._reselect=!1}if(!a&&p._deselect){var mt=p._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!x){var r=M.clickmode;E.done(Mt).then((function(){if(E.clear(Mt),2===t){for(_t.remove(),K=0;K-1&&U(e,k,n.xaxes,n.yaxes,n.subplot,n,_t),"event"===r&&ht(k,void 0);s.click(k,e,L.id)})).catch(A.error)}},n.doneFn=function(){kt.remove(),E.done(Mt).then((function(){E.clear(Mt),!S&&$&&n.selectionDefs&&($.subtract=xt,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),b&&ht(k,at)})).catch(A.error)}},clearOutline:v,clearSelectionsCache:W,selectOnClick:U}}}),yn=d({"src/components/annotations/arrow_paths.js"(t,e){e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),vn=d({"src/constants/axis_placeable_objects.js"(t,e){e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}}}),xn=d({"src/components/annotations/attributes.js"(t,e){var r=yn(),n=R(),i=ye(),a=ge().templatedArray;vn(),e.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),_n=d({"src/traces/scatter/constants.js"(t,e){e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),bn=d({"src/traces/scatter/fillcolor_attribute.js"(t,e){e.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}}),wn=d({"src/traces/scatter/attributes.js"(t,e){var r=Ee().axisHoverFormat,n=Dt().texttemplateAttrs,i=Dt().hovertemplateAttrs,a=Le(),o=R(),s=Pt().dash,l=Pt().pattern,c=Je(),u=_n(),h=O().extendFlat,f=bn();e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:f(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),Tn=d({"src/components/selections/attributes.js"(t,e){var r=xn(),n=wn().line,i=Pt().dash,a=O().extendFlat,o=Lt().overrideAll,s=ge().templatedArray;vn(),e.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),kn=d({"src/components/selections/defaults.js"(t,e){var r=se(),n=nr(),i=je(),a=Tn(),o=qr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete e.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var f,p,d,m=u[h],g={_fullLayout:i},y=n.coerceRef(t,e,g,m);if((f=n.getFromId(g,y))._selectionIndices.push(e._index),d=o.rangeToShapePosition(f),p=o.shapePositionToRange(f),c){var v=m+"0",x=m+"1",_=t[v],b=t[x];t[v]=p(t[v],!0),t[x]=p(t[x],!0),n.coercePosition(e,g,s,y,v),n.coercePosition(e,g,s,y,x);var w=e[v],T=e[x];void 0!==w&&void 0!==T&&(e[v]=d(w),e[x]=d(T),t[v]=_,t[x]=b)}}c&&r.noneOrAll(t,e,["x0","x1","y0","y1"])}e.exports=function(t,e){i(t,e,{name:"selections",handleItemDefaults:s});for(var r=e.selections,n=0;n=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function G(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Z(t){P&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long"),P=!1)}function W(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,i,a){for(var o,s,l,c,u=!1,h={},f={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(G(o),2!==n||yt||function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];it&&(r=r.concat(H)),at&&(r=r.concat(K)),nt.xaxes&&(r=r.concat(nt.xaxes)),nt.yaxes&&(r=r.concat(nt.yaxes));var n,i,a={};if("reset+autosize"===e)for(e="autosize",i=0;i-1&&S(a,o,H,K,e.id,Lt),l.indexOf("event")>-1&&f.click(o,a,e.id);else if(1===n&&yt){var u=g?z:P,h="s"===g||"w"===v?0:1,p=u._name+".range["+h+"]",d=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===v&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(_t).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(d),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(t){var e=u.d2r(t);void 0!==e&&s.call("_guiRelayout",o,p,e)}))}}}function Dt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+bt)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-bt),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Ct.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>L||o>L?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,bt>n?Tt.l=bt-a:Tt.r=bt+a),Ct.attr("d",W(Tt))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Ct.attr("d",W(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;u1&&(void 0!==a.maxallowed&&st===(a.range[0]1&&(void 0!==o.maxallowed&<===(o.range[0]1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))e.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;e.set(v)}return!m&&(f(g,y),p(t),!0)}var x,_,b,w,T,k,A,M,S=Object.keys(l).map(Number).sort(i),E=e.get(),C=E||[],I=u(y,h).get(),L=[],P=-1,z=C.length;for(x=0;xC.length-(A?0:1))n.warn("index out of range",h,b);else if(void 0!==k)T.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,b),s(k)?L.push(b):A?("add"===k&&(k={}),C.splice(b,0,k),I&&I.splice(b,0,{})):n.warn("Unrecognized full object edit value",h,b,k),-1===P&&(P=b);else for(_=0;_=0;x--)C.splice(L[x],1),I&&I.splice(L[x],1);if(C.length?E||e.set(C):e.set(null),m)return!1;if(f(g,y),d!==r){var D;if(-1===P)D=S;else{for(z=Math.max(C.length,z),D=[],x=0;x=P);x++)D.push(b);for(x=P;x0&&n.log("Clearing previous rejected promises from queue."),t._promises=[]},t.cleanLayout=function(e){var r;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(e));for(r=0;r3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===e.dragmode&&(e.dragmode="orbit"),o.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var a=0;a0)return t.substr(0,e)}t.hasParent=function(t,e){for(var r=g(e);r;){if(r in t)return!0;r=g(r)}return!1};var y=["x","y","z"];t.clearAxisTypes=function(t,e,r){for(var i=0;i=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&z(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,n,o,s){!function(t,e,r,n){var a=i.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var o in z(t,r,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,n,o);for(var l=function(t,e,n,o){var s,l,c,u,h,f=i.isPlainObject(o),p=[];for(var d in Array.isArray(n)||(n=[n]),n=P(n,t.data.length-1),e)for(var m=0;m0&&"string"!=typeof z.parts[O];)O--;var R=z.parts[O],F=z.parts[O-1]+"."+R,N=z.parts.slice(0,O).join("."),U=a(t.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==D){k[P]=D,S[P]="reverse"===R?D:j(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==D)for(var G in H.impliedEdits)E(i.relativeAttr(P,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(P))if(D){E("autosize",null);var W="height"===P?"width":"height";E(W,u[W])}else u[P]=t._initialAutoSize[P];else if("autosize"===P)E("width",D?null:u.width),E("height",D?null:u.height);else if(F.match(Z))L(F),a(u,N+"._inputRange").set(null);else if(F.match(Y)){L(F),a(u,N+"._inputRange").set(null);var $=a(u,N).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&a(u,N+"._inputDomain").set(null);if("type"===R){C=U;var J="linear"===V.type&&"log"===D,Q="log"===V.type&&"linear"===D;if(J||Q){if(C&&C.range)if(V.autorange)J&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var tt=C.range[0],et=C.range[1];J?(tt<=0&&et<=0&&E(N+".autorange",!0),tt<=0?tt=et/1e6:et<=0&&(et=tt/1e6),E(N+".range[0]",Math.log(tt)/Math.LN10),E(N+".range[1]",Math.log(et)/Math.LN10)):(E(N+".range[0]",Math.pow(10,tt)),E(N+".range[1]",Math.pow(10,et)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(t,V,D,E),l.getComponentMethod("images","convertCoords")(t,V,D,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(R.match(M)){var rt=a(u,P).get(),nt=(D||{}).type;nt&&"-"!==nt||(nt="linear"),l.getComponentMethod("annotations","convertCoords")(t,rt,nt,E),l.getComponentMethod("images","convertCoords")(t,rt,nt,E)}var it=b.containerArrayMatch(P);if(it){r=it.array,n=it.index;var at=it.property,ot=H||{editType:"calc"};""!==n&&""===at&&(b.isAddVal(D)?S[P]=null:b.isRemoveVal(D)?S[P]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",e)),A.update(T,ot),y[r]||(y[r]={});var st=y[r][n];st||(st=y[r][n]={}),st[at]=D,delete e[P]}else"reverse"===R?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===D&&!1!==q||!1!==D&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==q&&"select"!==q?T.plot=!0:H?A.update(T,H):T.calc=!0,z.set(D))}}for(r in y)b.applyContainerArrayChanges(t,p(s,r),y[r],T,p)||(T.plot=!0);for(var lt in I){var ct=(C=h.getFromId(t,lt))&&C._constraintGroup;if(ct)for(var ut in T.calc=!0,ct)I[ut]||(h.getFromId(t,ut)._constraintShrinkable=!0)}(K(t)||e.height||e.width)&&(T.plot=!0);var ht=u.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=a(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var f,p,d=0;function m(t){return Array.isArray(a)?d>=a.length?t.transitionOpts=a[d]:t.transitionOpts=a[0]:t.transitionOpts=a,d++,t}var g=[],y=null==e,v=Array.isArray(e);if(y||v||!i.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(f=0;f0&&bb)&&T.push(p);g=T}}g.length>0?function(e){if(0!==e.length){for(var i=0;in._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,u.transition(t,e.frame.data,e.frame.layout,w.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}()}}(g):(t.emit("plotly_animated"),o())}))},t.addFrames=function(t,e,r){if(t=i.getGraphDiv(t),null==e)return Promise.resolve();if(!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,c=t._transitionData._frames,h=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=c.length+2*e.length,p=[],d={};for(n=e.length-1;n>=0;n--)if(i.isPlainObject(e[n])){var m=e[n].name,g=(h[m]||d[m]||{}).name,y=e[n].name,v=h[g]||d[g];g&&y&&"number"==typeof y&&v&&S<5&&(S++,i.warn('addFrames: overwriting frame "'+(h[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:u.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=p[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+t._transitionData._counter++];);if(h[a.name]){for(o=0;o=0;r--)n=e[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,f=[t,l],p=[t,o];return s&&s.add(t,c,f,h,p),u.modifyFrames(t,o)},t.addTraces=function e(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=t.deleteTraces,h=e,f=[r,c],p=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r")?"":e.html(t).text()}));return e.remove(),n}(_)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(s,"'")}}}),Rn=d({"src/snapshot/svgtoimg.js"(t,e){var r=se(),n=he().EventEmitter,i=Dn();e.exports=function(t){var e=t.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=t.svg,u=t.format||"png",h=t.canvas,f=t.scale||1,p=t.width||300,d=t.height||150,m=f*p,g=f*d,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!t.promise)return e.emit("error",l)}n(r),t.promise||e.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!t.promise)return e.emit("error",r)},v.src=s}));return t.promise?a:e}}}),Fn=d({"src/plot_api/to_image.js"(t,e){var r=T(),n=zn(),i=Te(),a=se(),o=Dn(),s=On(),l=Rn(),c=g().version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var h,f,p,d;function m(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(h=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=a.getGraphDiv(t),h=a.extendDeep([],t.data),f=a.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(t,r){return a.coerce(e,g,u,t,r)}var v=y("format"),x=y("width"),_=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},f);x?A.width=x:null===e.width&&r(d.width)&&(A.width=d.width),_?A.height=_:null===e.height&&r(d.height)&&(A.height=d.height);var M=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,o.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=s(k,v,b),u=k._fullLayout.width,h=k._fullLayout.height;function f(){n.purge(k),document.body.removeChild(k)}if("full-json"===v){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=c,p=JSON.stringify(p),f(),t(T?p:o.encodeJSON(p))}if(f(),"svg"===v)return t(T?r:o.encodeSVG(r));var d=document.createElement("canvas");d.id=a.randstr(),l({format:v,width:u,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){n.newPlot(k,h,A,M).then(S).then(E).then(C).then((function(e){t(function(t){return T?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}}}),jn=d({"src/plot_api/validate.js"(t,e){var r=se(),n=Te(),i=me(),a=W().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(t,e,n,i,a,u){u=u||[];for(var h=Object.keys(t),m=0;mx.length&&i.push(f("unused",a,y.concat(x.length)));var A,M,S,E,C,I=x.length,L=Array.isArray(k);if(L&&(I=Math.min(I,k.length)),2===_.dimensions)for(M=0;Mx[M].length&&i.push(f("unused",a,y.concat(M,x[M].length)));var P=x[M].length;for(A=0;A<(L?Math.min(P,k[M].length):P);A++)S=L?k[M][A]:k,E=v[M][A],C=x[M][A],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M,A),E,C)):i.push(f("value",a,y.concat(M,A),E))}else i.push(f("array",a,y.concat(M),v[M]));else for(M=0;M1&&p.push(f("object","layout"))),n.supplyDefaults(d);for(var m=d._fullData,g=l.length,y=0;yT?h.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else h.push({code:"data"});if(function t(e,n){for(var i in e)if("_"!==i.charAt(0)){var a=e[i],o=p(e,i,n);r(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:g,layout:f},""),h.length)return h.map(m)}}}),Vn=d({"src/plot_api/index.js"(t){var e=zn();t._doPlot=e._doPlot,t.newPlot=e.newPlot,t.restyle=e.restyle,t.relayout=e.relayout,t.redraw=e.redraw,t.update=e.update,t._guiRestyle=e._guiRestyle,t._guiRelayout=e._guiRelayout,t._guiUpdate=e._guiUpdate,t._storeDirectGUIEdit=e._storeDirectGUIEdit,t.react=e.react,t.extendTraces=e.extendTraces,t.prependTraces=e.prependTraces,t.addTraces=e.addTraces,t.deleteTraces=e.deleteTraces,t.moveTraces=e.moveTraces,t.purge=e.purge,t.addFrames=e.addFrames,t.deleteFrames=e.deleteFrames,t.animate=e.animate,t.setPlotConfig=e.setPlotConfig;var r=Ct().getGraphDiv,n=Zr().eraseActiveShape;t.deleteActiveShape=function(t){return n(r(t))},t.toImage=Fn(),t.validate=jn(),t.downloadImage=Nn();var i=Un();t.makeTemplate=i.makeTemplate,t.validateTemplate=i.validateTemplate}}),qn=d({"src/traces/scatter/xy_defaults.js"(t,e){var r=se(),n=Vt();e.exports=function(t,e,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}}}),Hn=d({"src/traces/scatter/period_defaults.js"(t,e){var r=se().dateTick0,n=k().ONEWEEK;function i(t,e){return r(e,t%n==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}}}),Gn=d({"src/traces/scatter/stack_defaults.js"(t,e){var r=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(e):(c=l[o]={traceIndices:[],traces:[e]},u=!0);for(var h={orientation:e.x&&!e.y?"h":"v"},f=0;f=0;f--){var p=t[f];if("scatter"===p.type&&p.xaxis===u.xaxis&&p.yaxis===u.yaxis){p.opacity=void 0;break}}}}}}}),ti=d({"src/traces/scatter/layout_defaults.js"(t,e){var r=se(),n=_e();e.exports=function(t,e){var i,a,o="group"===e.barmode;"group"===e.scattermode&&(i="scattergap",a=o?e.bargap:.2,r.coerce(t,e,n,i,a))}}}),ei=d({"src/plots/cartesian/align_period.js"(t,e){var r=T(),n=se(),i=n.dateTime2ms,a=n.incrementMonth,o=k().ONEAVGMONTH;e.exports=function(t,e,n,s){if("date"!==e.type)return{vals:s};var l=t[n+"periodalignment"];if(!l)return{vals:s};var c,u=t[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"==typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var f=e.calendar,p="start"===l,d="end"===l,m=t[n+"period0"],g=i(m,f)||0,y=[],v=[],x=[],_=s.length,b=0;b<_;b++){var w,T,k,A=s[b];if(c){for(w=Math.round((A-g)/(c*o)),k=a(g,c*w,f);k>A;)k=a(k,-c,f);for(;k<=A;)k=a(k,c,f);T=a(k,-c,f)}else{for(k=g+(w=Math.round((A-g)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}y[b]=p?T:d?k:(T+k)/2,v[b]=T,x[b]=k}return{vals:y,starts:v,ends:x}}}}),ri=d({"src/traces/scatter/colorscale_calc.js"(t,e){var r=Se().hasColorscale,n=Ge(),i=We();e.exports=function(t,e){i.hasLines(e)&&r(e,"line")&&n(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ni=d({"src/traces/scatter/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;nd&&I[y].gap;)y--;for(x=I[y].s,g=I.length-1;g>y;g--)I[g].s=x;for(;dh+c||!r(u))}for(var p=0;pS[h]&&h0?o:s)/(I._m*z*(I._m>0?o:s)))),a*=1e3}if(l===i){if(P&&(l=I.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Y(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[u(t[0],at,ot),u(t[1],st,lt)]}function ht(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0}function ft(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ht(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c),s}}function pt(t){var e=t[0],r=t[1],n=e===G[Z-1][0],i=r===G[Z-1][1];if(!n||!i)if(Z>1){var a=e===G[Z-2][0],o=r===G[Z-2][1];n&&(e===at||e===ot)&&a?o?Z--:G[Z-1]=t:i&&(r===st||r===lt)&&o?a?Z--:G[Z-1]=t:G[Z++]=t}else G[Z++]=t}function dt(t){G[Z-1][0]!==t[0]&&G[Z-1][1]!==t[1]&&pt([Q,tt]),pt(t),et=null,Q=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&$(o,t)<$(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===B||"vh"===B?nt=function(t,e){var r=[],n=ut(t),i=ut(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===B?nt=ft(0,at,ot):"vhv"===B&&(nt=ft(1,st,lt));var mt=l.isArrayOrTypedArray(R);function gt(e){if(e&&O&&(e.i=n,e.d=t,e.trace=E,e.marker=mt?R[e.i]:R,e.backoff=O),M=e[0]/z,S=e[1]/D,K=e[0]ot?ot:0,J=e[1]lt?lt:0,K||J){if(Z)if(et){var r=nt(et,e);r.length>1&&(dt(r[0]),G[Z++]=r[1])}else rt=nt(G[Z-1],e)[0],G[Z++]=rt;else G[Z++]=[K||e[0],J||e[1]];var i=G[Z-1];K&&J&&(i[0]!==K||i[1]!==J)?(et&&(Q!==K&&tt!==J?pt(Q&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[Q||K,tt||J]):Q&&tt&&pt([Q,tt])),pt([K,J])):Q-K&&tt-J&&pt([K||Q,J||tt]),et=e,Q=K,tt=J}else et&&dt(nt(et,e)[0]),G[Z++]=e;var a,o,s,l}for(n=0;nX(m,yt))break;f=m,(w=v[0]*y[0]+v[1]*y[1])>_?(_=w,p=m,g=!1):w=t.length||!m)break;gt(m),a=m}}else gt(p)}et&&pt([Q||et[0],tt||et[1]]),V.push(G.slice(0,Z))}var vt=B.slice(B.length-1);if(O&&"h"!==vt&&"v"!==vt){for(var xt=!1,_t=-1,bt=[],wt=0;wt=0?l=p:(l=p=f,f++),l=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(t){return v?t.transition():t}var _=u.xaxis,b=u.yaxis,w=f[0].trace,T=w.line,k=r.select(d),A=a(k,"g","errorbars"),M=a(k,"g","lines"),S=a(k,"g","points"),E=a(k,"g","text");if(n.getComponentMethod("errorbars","plot")(t,A,u,m),!0===w.visible){var C,I;x(k).style("opacity",w.opacity);var L,P,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,P=b.c2p(0,!0)):"x"===z&&(L=0,P=_.c2p(0,!0)),f[0][u.isRangePlot?"nodeRangePlot3":"node3"]=k;var D,O,R="",F=[],j=w._prevtrace,B=null,N=null;j&&(R=j._prevRevpath||"",I=j._nextFill,F=j._ownPolygons,B=j._fillsegments,N=j._fillElement);var U,V,q,H,G,Z,W="",Y="",X=[];w._polygons=[];var $=[],K=[],J=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){I&&I.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(U=s.steps(T.shape),V=s.steps(T.shape.split("").reverse().join(""))):U=V="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),T.smoothing):s.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},q=function(t){return V(t.reverse())},K=c(f,{xaxis:_,yaxis:b,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill}),$=new Array(K.length);var Q=0;for(g=0;g0,g=u(t,e,n);(h=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(t,e,n){e.each((function(e){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,t);var l=e[0].trace,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(t){l[t]=null})).remove(),u.order().each((function(t){l[t]=a(r.select(this),"path","js-fill")}))}))}(t,h,e),m?(c&&(p=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(t,n,e,r,g,this,l)}))}))):h.each((function(r,n){f(t,n,e,r,g,this,l)})),d&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),fi=d({"src/traces/scatter/marker_colorbar.js"(t,e){e.exports={container:"marker",min:"cmin",max:"cmax"}}}),pi=d({"src/traces/scatter/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,e,"x"),s=r.getFromTrace(a,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var c=t.orig_y;return void 0===c&&(c=t.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),di=d({"src/traces/scatter/style.js"(t,e){var r=v(),n=Je(),i=Vt();function a(t,e,r){n.pointStyle(t.selectAll("path.point"),e,r)}function o(t,e,r){n.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=r.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){a(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){o(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(n.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,t,!1),i.getComponentMethod("errorbars","style")(e)},stylePoints:a,styleText:o,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,t),o(r,i,t))}}}}),mi=d({"src/traces/scatter/get_trace_color.js"(t,e){var r=q(),n=We();e.exports=function(t,e){var i,a;if("lines"===t.mode)return(i=t.line.color)&&r.opacity(i)?i:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(t.line||{}).color)&&r.opacity(i)&&n.hasLines(t)&&t.line.width?i:t.fillcolor}}}),gi=d({"src/traces/scatter/hover.js"(t,e){var r=se(),n=zr(),i=Vt(),a=mi(),o=q(),s=r.fillText;e.exports=function(t,e,l,c){var u=t.cd,h=u[0].trace,f=t.xa,p=t.ya,d=f.c2p(e),m=p.c2p(l),g=[d,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,_=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var b=function(t){var e=Math.max(v,t.mrc||0),r=f.c2p(t.x)-d,n=p.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},w=n.getDistanceFunction(c,(function(t){if(x){var e=f.c2p(t.xStart),r=f.c2p(t.xEnd);return d>=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(f.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return ar!=(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),d=Math.max(d,a)));return{x0:h=Math.max(h,0),x1:d=Math.min(d,f._length),y0:r,y1:r}}(h._polygons);null===P&&(P={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(t,{distance:t.maxHoverDistance,x0:P.x0,x1:P.x1,y0:P.y0,y1:P.y1,color:z,hovertemplate:!1}),delete t.index,h.text&&!r.isArrayOrTypedArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}}),yi=d({"src/traces/scatter/select.js"(t,e){var r=We();e.exports=function(t,e){var n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===e)for(n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",h=c[u],f={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=t.autotypenumbers,a(c,l)){var p=i(c),d=[];for(o=0;o0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),s||"array"!==c||(c=e.categoryorder="trace"),"trace"===c?e._initialCategories=[]:"array"===c?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=_(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=_(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===n.autorange){var f=n.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]_[1]-1/4096&&(e.domain=s),n.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return i("layer"),e}}}),ki=d({"src/plots/cartesian/layout_defaults.js"(t,e){var r=se(),n=q(),i=Xe().isUnifiedHover,a=Cr(),o=ge(),s=Bt(),l=Ce(),c=xi(),u=wi(),h=en(),f=Ti(),p=ve(),d=p.id2name,m=p.name2id,g=ye().AX_ID_PATTERN,y=Vt(),v=y.traceIs,x=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,y){var b,w,T=e.autotypenumbers,k={},A={},M={},S={},E={},C={},I={},L={},P={},z={};for(b=0;bs.duration?(function(){for(var r={},i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!e.xr1,f=!!e.yr1,p=[];if(h){var d=i.simpleMap(e.xr0,s.r2l),m=i.simpleMap(e.xr1,s.r2l),g=d[1]-d[0],y=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(d[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var v=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),_=v[1]-v[0],b=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*b/_),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;o.drawOne(t,s,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[s._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,k=h?p[0]:0,A=f?p[1]:0,M=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=s._offset-M,C=l._offset-S;n.clipRect.call(a.setTranslate,k,A).call(a.setScale,1/w,1/T),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,T),a.setPointGroupScale(n.zoomScalePts,1/w,1/T),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}o.redrawComponents(t)}}}),Mi=d({"src/plots/cartesian/index.js"(t){var e=v(),r=Vt(),n=se(),i=Te(),a=Je(),o=be().getModuleCalcData,s=ve(),l=ye(),c=ke(),u=n.ensureSingle;function h(t,e,r){return n.ensureSingle(t,e,r,(function(t){t.datum(r)}))}var f=l.zindexSeparator;function p(t,n,i,s,c){for(var u,h,f,p=l.traceLayerClasses,d=t._fullLayout,m=d._zindices,g=d._modules,y=[],v=[],x=0;x1,m=e.mainplotinfo;if(!e.mainplot||d)if(p)e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.xaxislayer=u(n,"g","xaxislayer-above"),e.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");e.shapelayer=u(g,"g","shapelayer"),e.imagelayer=u(g,"g","imagelayer"),m&&d?(e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer):(e.minorGridlayer=u(n,"g","minor-gridlayer"),e.gridlayer=u(n,"g","gridlayer"),e.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");e.shapelayerBetween=u(y,"g","shapelayer"),e.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),e.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),e.overaxesBelow=u(n,"g","overaxes-below")}e.overplot=u(n,"g","overplot"),e.plot=u(e.overplot,"g",i),a||(e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),e.overaxesAbove=u(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+o),e.ylines=n.select(".ylines-"+c),e.xaxislayer=n.select(".xaxislayer-"+o),e.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",_=i+"-y";e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",_),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",_),e.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",_),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",_),e.xlines=v.select(".overlines-"+o).select("."+x),e.ylines=v.select(".overlines-"+c).select("."+_),e.xaxislayer=v.select(".overaxes-"+o).select("."+x),e.yaxislayer=v.select(".overaxes-"+c).select("."+_)}a||(p||(h(e.minorGridlayer,"g",e.xaxis._id),h(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort),h(e.gridlayer,"g",e.xaxis._id),h(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function m(t,r){if(t){var n={};for(var i in t.each((function(t){var i=t[0];e.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o0){var g=m.id;if(-1!==g.indexOf(f))continue;g+=f+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x1&&(w+=f+b),_.push(n+w),r=0;r=0,x=e.indexOf("end")>=0,_=d.backoff*g+a.standoff,b=m.backoff*y+a.startstandoff;if("line"===p.nodeName){c={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=c.x-u.x,T=c.y-u.y;if(f=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void D();if(_){if(_*_>w*w+T*T)return void D();var k=_*Math.cos(h),A=_*Math.sin(h);u.x+=k,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void D();var M=b*Math.cos(h),S=b*Math.sin(h);c.x-=M,c.y-=S,t.attr({x1:c.x,y1:c.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),C="";if(E<_+b)return void D();var I=p.getPointAtLength(0),L=p.getPointAtLength(.1);h=Math.atan2(I.y-L.y,I.x-L.x),c=p.getPointAtLength(Math.min(b,E)),C="0px,"+b+"px,";var P=p.getPointAtLength(E),z=p.getPointAtLength(E-.1);f=Math.atan2(P.y-z.y,P.x-z.x),u=p.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+"px,"+E+"px",t.style("stroke-dasharray",C)}function D(){t.style("stroke-dasharray","0px,100px")}function O(e,i,c,u){e.path&&(e.noRotate&&(c=0),r.select(p.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&O(m,c,h,y),x&&O(d,u,f,g)}}}),Ci=d({"src/components/annotations/draw.js"(t,e){var r=v(),n=Vt(),i=Te(),a=se(),o=a.strTranslate,s=nr(),l=q(),c=Je(),u=zr(),h=Me(),f=fr(),p=hr(),d=ge().arrayEditor,m=Ei();function g(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),i=s.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),x(t,r,e,!1,n,i)}function y(t,e,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return t?c?a+(l?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(l?-e:e)/u}function x(t,e,i,g,v,x){var _,b,w=t._fullLayout,T=t._fullLayout._size,k=t._context.edits;g?(_="annotation-"+g,b=g+".annotations"):(_="annotation",b="annotations");var A=d(t.layout,b,e),M=A.modifyBase,S=A.modifyItem,E=A.getUpdateObj;w._infolayer.selectAll("."+_+'[data-index="'+i+'"]').remove();var C="clip"+w._uid+"_ann"+i;if(e._input&&!1!==e.visible){var I={x:{},y:{}},L=+e.textangle||0,P=w._infolayer.append("g").classed(_,!0).attr("data-index",String(i)).style("opacity",e.opacity),z=P.append("g").classed("annotation-text-g",!0),D=k[e.showarrow?"annotationTail":"annotationPosition"],O=e.captureevents||k.annotationText||D,R=z.append("g").style("pointer-events",O?"all":null).call(f,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",Z(r.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){u.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,j=e.borderpad,B=F+j,N=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var q=e.font,H=w._meta?a.templateString(e.text,w._meta):e.text,G=R.append("text").classed("annotation-text",!0).text(H);k.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(W).on("edit",(function(r){e.text=r,this.call(W),S("text",r),v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0),n.call("_guiRelayout",t,E())})):G.call(W)}else r.selectAll("#"+C).remove();function Z(t){var r={index:i,annotation:e._input,fullAnnotation:e,event:t};return g&&(r.subplotId=g),r}function W(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,Y),r}function Y(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(N.node());var i=R.select(".annotation-text-math-group"),u=!i.empty(),d=c.bBox((u?i:G).node()),_=d.width,b=d.height,A=e.width||_,O=e.height||b,j=Math.round(A+2*B),q=Math.round(O+2*B);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Y=["x","y"],X=0;X1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var dt="domain"===ft;"x"===et?(J=e[et],$=dt?it._offset+it._length*J:$=T.l+T.w*J):(J=1-e[et],$=dt?it._offset+it._length*J:$=T.t+T.h*J),Q=e.showarrow?.5:J}if(e.showarrow){ht.head=$;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=s.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=T.t+T.h*mt):ht.tail=T.l+T.w*mt:ht.tail=it._offset+it.r2p(mt),K=tt}else ht.tail=$+mt,K=tt+mt;ht.text=ht.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=a.constrain(ht.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-yt;vt>0?(ht.tail+=vt,ht.text+=vt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ut,ht.head+=ut}else K=tt=lt*H(Q,ct),ht.text=$+tt;ht.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var _t=0,bt=0;if("left"!==e.align&&(_t=(A-_)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),u)i.select("svg").attr({x:B+_t-1,y:B+bt}).call(c.setClipUrl,U?C:null,t);else{var wt=B+bt-d.top,Tt=B+_t-d.left;G.call(h.positionText,Tt,wt).call(c.setClipUrl,U?C:null,t)}V.select("rect").call(c.setRect,B,B,A,O),N.call(c.setRect,F/2,F/2,j-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-j/2),Math.round(I.y.text-q/2)),z.attr({transform:"rotate("+L+","+I.x.text+","+I.y.text+")"});var kt,At=function(r,i){P.selectAll(".annotation-arrow-g").remove();var s=I.x.head,u=I.y.head,h=I.x.tail+r,f=I.y.tail+i,d=I.x.text+r,_=I.y.text+i,b=a.rotationXYMatrix(L,d,_),w=a.apply2DTransform(b),A=a.apply2DTransform2(b),C=+N.attr("width"),D=+N.attr("height"),O=d-.5*C,F=O+C,j=_-.5*D,B=j+D,U=[[O,j,O,B],[O,B,F,B],[F,B,F,j],[F,j,O,j]].map(A);if(!U.reduce((function(t,e){return t^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=a.segmentsIntersect(h,f,s,u,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=P.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),Z=G.append("path").attr("d","M"+h+","+f+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(Z,H,e),k.annotationPosition&&Z.node().parentNode&&!g){var W=s,Y=u;if(e.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-f,2));W+=e.standoff*(h-s)/X,Y+=e.standoff*(f-u)/X}var $,K,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(f-Y),transform:o(W,Y)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:J.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);$=t.x,K=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w($,K),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",o(t,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&At(0,0),D&&p.init({element:R.node(),gd:t,prepFn:function(){kt=z.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(g)return;var i,a;if(v)i=y(v,t,"x",T,e);else{var s=e._xsize/T.w,l=e.x+(e._xshift-e.xshift)/T.w-s/2;i=p.align(l+t/T.w,s,0,1,e.xanchor)}if(x)a=y(x,r,"y",T,e);else{var c=e._ysize/T.h,u=e.y-(e._yshift+e.yshift)/T.h-c/2;a=p.align(u-r/T.h,c,0,1,e.yanchor)}S("x",i),S("y",a),v&&x||(n=p.getCursor(v?.5:i,x?.5:a,e.xanchor,e.yanchor))}z.attr({transform:o(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Z(n))},doneFn:function(){f(R),n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var o,s,l=a(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(c.length||u.length){for(o=0;o1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=n(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*a[0],e.yaxis.r2l(l.y)*a[1],e.zaxis.r2l(l.z)*a[2]]),r(t.graphDiv,l,s,t.id,l._xa,l._ya))}}}}),Ui=d({"src/components/annotations3d/index.js"(t,e){var r=Vt(),n=se();e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Ri()}}},layoutAttributes:Ri(),handleDefaults:Fi(),includeBasePlot:function(t,e){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(t),s=0;s0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function c(t,e,r){var n,o,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],o=e[s+"1"],l&&(c=e[s+"0shift"],u=e[s+"1shift"])):(n=e[s+"anchor"],o=e[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(e.path){var f,p,d,m,g=1/0,y=-1/0,v=e.path.match(i.segmentRE);for("date"===t.type&&(h=a.decodeDate(h)),f=0;fy&&(y=m)));return y>=g?[g,y]:void 0}}e.exports=function(t){var e=t._fullLayout,a=r.filterVisible(e.shapes);if(a.length&&t._fullData.length)for(var l=0;l0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}n("visible","skip"===t.method||Array.isArray(t.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}}),ea=d({"src/components/updatemenus/scrollbox.js"(t,e){e.exports=o;var r=v(),n=q(),i=Je(),a=se();function o(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(t,e,a){var s=this.gd._fullLayout,l=s.width,c=s.height;this.position=t;var u,h,f,p,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,_="left"===v,b="up"===v,w=m,T=y;x||_||"right"===v||b||(this.position.direction="down",x=!0),x||b?(h=(u=d)+w,x?(f=g,T=(p=Math.min(f+T,c))-f):T=(p=g+T)-(f=Math.max(p-T,0))):(p=(f=g)+T,_?w=(h=d+w)-(u=Math.max(h-w,0)):(u=d,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:f,w,h:T};var k=m>w,A=o.barLength+2*o.barPad,M=o.barWidth+2*o.barPad,S=d,E=g+y;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),k?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=y>T,L=o.barWidth+2*o.barPad,P=o.barLength+2*o.barPad,z=d+m,D=g;z+L>l&&(z=l-L);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),I?(this.vbar=O.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:D,width:L,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=I?h+L+.5:h+.5,B=f-.5,N=k?p+M+.5:p+.5,U=s._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(N)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},o.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},o.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,i=n+this._hbarTranslateMax;t=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,s=o+this._vbarTranslateMax;e=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},o.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=a.constrain(t||0,0,r),e=a.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var o=t/r;this.hbar.call(i.setTranslate,t+o*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}}}),ra=d({"src/components/updatemenus/draw.js"(t,e){var r=v(),n=Te(),i=q(),a=Je(),o=se(),s=Me(),l=ge().arrayEditor,c=Ae().LINE_SPACING,u=Ji(),h=ea();function f(t){return t._index}function p(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function d(t,e,r,n,i,a,o,s){e.active=o,l(t.layout,u.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(u.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||g(t,n,i,a,e))}function m(t,e,r,n,i){var s=o.ensureSingle(e,"g",u.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,t).call(M,i,f,d),o.ensureSingle(e,"text",u.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(S,String(p(r,i)?-1:i._index)),g(t,e,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(T,i)})),a.setTranslate(e,l.lx,l.ly)}function g(t,e,i,a,s){i||(i=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),f=h.enter().append("g").classed(c,!0),p=h.exit();"dropdown"===s.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var _={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},k={l:_.x+s.borderwidth,t:_.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,t).call(M,s,_),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(d(t,s,0,e,i,a,-1),n.executeAPICommand(t,o.method,o.args2)):(d(t,s,0,e,i,a,l),n.executeAPICommand(t,o.method,o.args))),t.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,s),h.call(b,s)}))})),h.call(b,s),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=_.y-k.t):(k.w=_.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=s.direction,a&&(h.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,f=i._dims,p=i.active;if(h)for(s=0,l=0;l0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,f);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),y=0;y0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,s=o.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(t,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._context.staticPlot,i=t._fullLayout,o=function(t,e){for(var r=t[u.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),n.autoMargin(t,m(e))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h0?t.touches[0].clientX:0}function g(t,e,r,n){var i=a.ensureSingle(t,"rect",d.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(e,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(t,e,r,n){var i=e._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function x(t,e,n,o){var l,c=e.calcdata,f=t.selectAll("g."+d.rangePlotClassName).data(n._subplotsWith,a.identity);f.enter().append("g").attr("class",(function(t){return d.rangePlotClassName+" "+t})).call(s.setClipUrl,o._clipId,e),f.order(),f.exit().remove(),f.each((function(t,a){var s=r.select(this),f=0===a,p=h.getFromId(e,t,"y"),d=p._name,m=o[d],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[d]={type:p.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[d].rangebreaks=p.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};f?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(e,x,function(t,e){for(var r=[],n=0;n=n.max)e=j[r+1];else if(t=n.pmax)e=j[r+1];else if(ti._length||v+b<0)return;u=y+b,f=v+b;break;case l:if(_="col-resize",y+b>i._length)return;u=y+b,f=v;break;case c:if(_="col-resize",v+b<0)return;u=y,f=v+b;break;default:_="ew-resize",u=g,f=g+b}if(f0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a1){f||p||d||"independent"===k("pattern")&&(f=!0),g._hasSubplotGrid=f;var x,_,b="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:c("x",k,w,x,v),y:c("y",k,T,_,y,b)}}else delete e.grid}function k(t,e){return r.coerce(n,g,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,c,h,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var x=f.subplots||[];c=r.subplots=new Array(m);var _=1;for(n=0;n0,h=t._context.staticPlot;e.each((function(e){var f,p=e[0].trace,d=p.error_x||{},m=p.error_y||{};p.ids&&(f=function(t){return t.id});var g=a.hasMarkers(p)&&p.marker.maxdisplayed>0;m.visible||d.visible||(e=[]);var y=r.select(this).selectAll("g.errorbar").data(e,f);if(y.exit().remove(),e.length){d.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,t),y.each((function(t){var e=r.select(this),i=function(t,e,r){var i={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(i.yh=r.c2p(t.yh),i.ys=r.c2p(t.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(i.xh=e.c2p(t.xh),i.xs=e.c2p(t.xs),n(i.xs)||(i.noXS=!0,i.xs=e.c2p(t.xs,!0))),i}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var f=m.width;a="M"+(i.x-f)+","+i.yh+"h"+2*f+"m-"+f+",0V"+i.ys,i.noYS||(a+="m-"+f+",0h"+2*f),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(d.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(d.copy_ystyle?m:d).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}}))}}))}}}),Ia=d({"src/components/errorbars/style.js"(t,e){var r=v(),n=q();e.exports=function(t){t.each((function(t){var e=t[0].trace,i=e.error_y||{},a=e.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),La=d({"src/components/errorbars/index.js"(t,e){var r=se(),n=Lt().overrideAll,i=Aa(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Ma(),calc:Ea(),makeComputeError:Sa(),plot:Ca(),style:Ia(),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}}}),Pa=d({"src/components/colorbar/constants.js"(t,e){e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),za=d({"src/components/colorbar/draw.js"(t,e){var r=v(),n=D(),i=Te(),a=Vt(),o=nr(),s=hr(),l=se(),c=l.strTranslate,u=O().extendFlat,h=fr(),f=Je(),p=q(),d=Qe(),m=Me(),g=Se().flipScale,y=wi(),x=Ti(),_=Ce(),b=Ae(),w=b.LINE_SPACING,T=b.FROM_TL,k=b.FROM_BR,A=Pa().cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return u(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var h=0;h0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var pt=Math.pow(10,Math.floor(Math.log(ft)/Math.LN10));ut*=pt*l.roundUp(ft/pt,[2,5,10]),(Math.abs(Z.start)/Z.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}lt.domain=s?[ot+P/j.h,ot+Q-P/j.h]:[ot+L/j.w,ot+Q-L/j.w],lt.setScale(),t.attr("transform",c(Math.round(j.l),Math.round(j.t)));var dt,mt=t.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(j.l),-Math.round(j.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select("."+A.cbaxis),xt=0,_t=0;function bt(r,n){var i={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;t.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(a,r,u(i,n||{}))}function wt(){var t,e;(s&&ct||!s&&!ct)&&("top"===V&&(t=L+j.l+tt*z,e=P+j.t+et*(1-ot-Q)+3+.75*yt),"bottom"===V&&(t=L+j.l+tt*z,e=P+j.t+et*(1-ot)-3-.25*yt),"right"===V&&(e=P+j.t+et*D+3+.75*yt,t=L+j.l+tt*ot),bt(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":s?"start":"middle"}}))}function Tt(){if(s&&!ct||!s&&ct){var t,n,i=lt.position||0,o=lt._offset+lt._length/2;if("right"===V)n=o,t=j.l+tt*i+10+yt*(lt.showticklabels?1:.5);else if(t=o,"bottom"===V&&(n=j.t+et*i+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===V){var l=U.text.split("
").length;n=j.t+et*i+10-$-w*yt*l}bt((s?"h":"v")+lt._id+"title",{avoid:{selection:r.select(a).selectAll("g."+lt._id+"tick"),side:V,offsetTop:s?0:j.t,offsetLeft:s?j.l:0,maxShift:s?F.width:F.height},attributes:{x:t,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}}function kt(){if(!s&&!ct||s&&ct){var i,u=t.select("."+A.cbtitle),h=u.select("text"),p=[-M/2,M/2],d=u.select(".h"+lt._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),d?(i=f.bBox(d),_t=i.width,(xt=i.height)>g&&(p[1]-=(xt-g)/2)):h.node()&&!h.classed(A.jsPlaceholder)&&(i=f.bBox(h.node()),_t=i.width,xt=i.height),s){if(xt){if(xt+=5,"top"===V)lt.domain[1]-=xt/j.h,p[1]*=-1;else{lt.domain[0]+=xt/j.h;var y=m.lineCount(h);p[1]+=(1-y)*g}u.attr("transform",c(p[0],p[1])),lt.setScale()}}else _t&&("right"===V&&(lt.domain[0]+=(_t+yt/2)/j.w),u.attr("transform",c(p[0],p[1])),lt.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",s?c(0,Math.round(j.h*(1-lt.domain[1]))):c(Math.round(j.w*lt.domain[0]),0)),vt.attr("transform",s?c(0,Math.round(-j.t)):c(Math.round(-j.l),0));var v=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(A.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?q[0]:(Y[i]+Y[i-1])/2,i===Y.length-1?q[1]:(Y[i]+Y[i+1])/2].map(lt.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",rt).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(e._fillgradient)f.gradient(c,a,e._id,s?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=G(t).replace("e-","");c.attr("fill",n(u).toHexString())}}));var _=t.select("."+A.cblines).selectAll("path."+A.cbline).data(N.color&&N.width?X:[]);_.enter().append("path").classed(A.cbline,!0),_.exit().remove(),_.each((function(t){var e=rt,n=Math.round(lt.c2p(t))+N.width/2%1;r.select(this).attr("d","M"+(s?e+","+n:n+","+e)+(s?"h":"v")+$).call(f.lineGroupStyle,N.width,H(t),N.dash)})),vt.selectAll("g."+lt._id+"tick,path").remove();var b=rt+$+(M||0)/2-("outside"===e.ticks?1:0),T=o.calcTicks(lt),k=o.getTickSigns(lt)[2];return o.drawTicks(a,lt,{vals:"inside"===lt.ticks?o.clipEnds(lt,T):T,layer:vt,path:o.makeTickPath(lt,b,k),transFn:o.makeTransTickFn(lt)}),o.drawLabels(a,lt,{vals:T,layer:vt,transFn:o.makeTransTickLabelFn(lt),labelFns:o.makeLabelFns(lt,b)})}function At(){var r,o=$+M/2;-1===gt.indexOf("inside")&&(r=f.bBox(vt.node()),o+=s?r.width:r.height),dt=mt.select("text");var l=0,u=s&&"top"===V,d=!s&&"right"===V,m=0;if(dt.node()&&!dt.classed(A.jsPlaceholder)){var y,x=mt.select(".h"+lt._id+"title-math-group").node();x&&(s&&ct||!s&&!ct)?(l=(r=f.bBox(x)).width,y=r.height):(l=(r=f.bBox(mt.node())).right-j.l-(s?rt:st),y=r.bottom-j.t-(s?st:rt),s||"top"!==V||(o+=r.height,m=r.height)),d&&(dt.attr("transform",c(l/2+yt/2,0)),l*=2),o=Math.max(o,s?l:y)}var _=2*(s?L:P)+o+S+M/2,w=0;!s&&U.text&&"bottom"===I&&D<=0&&(_+=w=_/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var B=S+M,N=(s?rt:st)-B/2-(s?L:0),q=(s?st:rt)-(s?J:P+m-w);t.select("."+A.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(_-w,2)).attr(s?"height":"width",Math.max(J+B,2)).call(p.fill,E).call(p.stroke,e.bordercolor).style("stroke-width",S);var H=d?Math.max(l-10,0):0;t.selectAll("."+A.cboutline).attr("x",(s?rt:st+L)+H).attr("y",(s?st+P-J:rt)+(u?xt:0)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(J-(s?2*P+xt:2*L+H),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":M});var G=s?nt*_:0,Z=s?0:(1-it)*_-m;if(G=R?j.l-G:-G,Z=O?j.t-Z:-Z,t.attr("transform",c(G,Z)),!s&&(S||n(E).getAlpha()&&!n.equals(F.paper_bgcolor,E))){var W=vt.selectAll("text"),Y=W[0].length,X=t.select("."+A.cbbg).node(),K=f.bBox(X),Q=f.getTranslate(t),tt=2;W.each((function(t,e){var r=0,n=Y-1;if(e===r||e===n){var i,a=f.bBox(this),o=f.getTranslate(this);if(e===n){var s=a.right+o.x;(i=K.right+Q.x+st-S-tt+z-s)>0&&(i=0)}else if(e===r){var l=a.left+o.x;(i=K.left+Q.x+st+S+tt-l)<0&&(i=0)}i&&(Y<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var et={},at=T[C],ot=k[C],ut=T[I],ht=k[I],ft=_-$;s?("pixels"===g?(et.y=D,et.t=J*ut,et.b=J*ht):(et.t=et.b=0,et.yt=D+h*ut,et.yb=D-h*ht),"pixels"===b?(et.x=z,et.l=_*at,et.r=_*ot):(et.l=ft*at,et.r=ft*ot,et.xl=z-v*at,et.xr=z+v*ot)):("pixels"===g?(et.x=z,et.l=J*at,et.r=J*ot):(et.l=et.r=0,et.xl=z+h*at,et.xr=z-h*ot),"pixels"===b?(et.y=1-D,et.t=_*ut,et.b=_*ht):(et.t=ft*ut,et.b=ft*ht,et.yt=D-v*ut,et.yb=D+v*ht));var pt=e.y<.5?"b":"t",_t=e.x<.5?"l":"r";a._fullLayout._reservedMargin[e._id]={};var bt={r:F.width-N-G,l:N+et.r,b:F.height-q-Z,t:q+et.b};R&&O?i.autoMargin(a,e._id,et):R?a._fullLayout._reservedMargin[e._id][pt]=bt[pt]:O||s?a._fullLayout._reservedMargin[e._id][_t]=bt[_t]:a._fullLayout._reservedMargin[e._id][pt]=bt[pt]}return l.syncOrAsync([i.previousPromises,wt,kt,Tt,i.previousPromises,At],a)}(g,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,l="v"===e.orientation,u=r._fullLayout,f=u._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,a){t.attr("transform",n+c(r,a)),i=s.align((l?e._uFrac:e._vFrac)+r/f.w,l?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=s.align((l?e._vFrac:1-e._uFrac)-a/f.h,l?e._lenFrac:e._thickFrac,0,1,e.yanchor);var u=s.getCursor(i,o,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==i&&void 0!==o){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=o,void 0!==e._traceIndex?a.call("_guiRestyle",r,n,e._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}}}),Da=d({"src/components/colorbar/index.js"(t,e){e.exports={moduleType:"component",name:"colorbar",attributes:Ie(),supplyDefaults:Ue(),draw:za().draw,hasColorbar:ze()}}}),Oa=d({"src/components/legend/index.js"(t,e){e.exports={moduleType:"component",name:"legend",layoutAttributes:dr(),supplyLayoutDefaults:gr(),draw:kr(),style:Tr()}}}),Ra=d({"src/locale-en.js"(t,e){e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),Fa=d({"src/locale-en-us.js"(t,e){e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),ja=d({"src/snapshot/cloneplot.js"(t,e){var r=Vt(),n=se(),i=n.extendFlat,a=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var n,s,l=t.data,c=t.layout,u=a([],l),h=a({},c,o(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var p=Object.keys(h);for(n=0;n-1&&(h[p[n]].title={text:""});for(n=0;n=0)return t}else if("string"==typeof t&&"%"===(t=t.trim()).slice(-1)&&r(t.slice(0,-1))&&(t=+t.slice(0,-1))>=0)return t+"%"}function p(t,e,r,i,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),f=!(!1===o.moduleHasTextangle),p=!(!1===o.moduleHasInsideanchor),d=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),_=!(t.textfont&&t.textfont.color);if(_&&delete x.color,h(i,"insidetextfont",x),d){var b=n.extendFlat({},v);_&&delete b.color,h(i,"pathbar.textfont",b)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),f&&i("textangle"),i("texttemplate")}g&&p&&i("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,c){function h(r,i){return n.coerce(t,e,u,r,i)}if(o(t,e,c,h)){s(t,e,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",e.x&&!e.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var f=h("textposition");p(t,0,c,h,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,h,r,c);var d=(e.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(t,e,d||i.defaultLine,{axis:"y"}),m(t,e,d||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function a(t,e){return n.coerce(i._input,i,u,t,e)}for(var o=0;o0&&!f[y]&&(h=!0),f[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:e},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==p&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");e.barcornerradius=o(v)}else delete e.barmode}}}),Xa=d({"src/traces/bar/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;na))return r}return void 0!==n?n:t.dflt},t.coerceColor=function(t,e,n){return r(e).isValid()?e:void 0!==n?n:t.dflt},t.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},t.getValue=function(t,e){var r;return n(t)?e1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){p(r.select(this),e[0].trace,t)})),o.getComponentMethod("errorbars","style")(e)},styleTextPoints:d,styleOnSelect:function(t,e,n){var s=e[0].trace;s.selectedpoints?function(t,e,n){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,n){t.each((function(t){var o,s=r.select(this);if(t.selected){o=a.ensureUniformFontSize(n,m(s,t,e,n));var l=e.selected.textfont&&e.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,n)}(n,s,t):(p(n,s,t),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:b,resizeText:s}}}),to=d({"src/traces/bar/plot.js"(t,e){var r=v(),n=T(),i=se(),a=Me(),o=q(),s=Je(),l=Vt(),c=nr().tickText,u=Ka(),h=u.recordMinTextSize,f=u.clearMinTextSize,p=Qa(),d=Ja(),m=qa(),g=Ha(),y=g.text,x=g.textposition,_=Xe().appendArrayPointValue,b=m.TEXTPAD;function w(t){return t.id}function k(t){return(t>0)-(t<0)}function A(t,e){return t0}function E(t,e,r,n,i){return!(t<0||e<0)&&(r<=t&&n<=e||r<=e&&n<=t||(i?t>=r*(e/n):e>=n*(t/r)))}function C(t){return"auto"===t?0:t}function I(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,f=((a.leftToRight||0)+1)/2,p=1-f,d=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(e-t),_=Math.abs(n-r),w=x>2*b&&_>2*b?b:0;x-=2*w,_-=2*w;var T=C(l);"auto"!==l||y<=x&&v<=_||!(y>x||v>_)||(y>_||v>x)&&yb){var E=function(t,e,r,n,i,a,o,s,l){var c,u,h,f,p,d=Math.max(0,Math.abs(e-t)-2*b),m=Math.max(0,Math.abs(n-r)-2*b),g=a-b,y=o?g-Math.sqrt(g*g-(g-o)*(g-o)):g,v=l?2*g:s?g-o:2*y,x=l?2*g:s?2*y:g-o;return i.y/i.x>=m/(d-v)?f=m/i.y:i.y/i.x<=(m-x)/d?f=d/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(d-g)*(d-g)+(m/2-g)*(m/2-g)-g*g,f=(-(u=-2*i.x*(d-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(d/2-g)*(d/2-g)+(m/2-g)*(m/2-g)-g*g,f=(-(u=-i.x*(d/2-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(d/2-g)*(d/2-g)+(m-g)*(m-g)-g*g,f=(-(u=-i.x*(d/2-g)-2*i.y*(m-g))+Math.sqrt(u*u-4*c*h))/(2*c)),f=Math.min(1,f),p=s?Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(m-i.y*f)/2)*(g-(m-i.y*f)/2)))-o):Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(d-i.x*f)/2)*(g-(d-i.x*f)/2)))-o),{scale:f,pad:p}}(t,e,r,n,S,m,g,o,d);k=E.scale,M=E.pad}else k=1,s&&(k=Math.min(1,x/S.x,_/S.y)),M=0;var L=i.left*p+i.right*f,P=(i.top+i.bottom)/2,z=(t+b)*p+(e-b)*f,D=(r+n)/2,O=0,R=0;if(h||u){var F=(o?S.x:S.y)/2;m&&(u||d)&&(w+=M);var j=o?A(t,e):A(r,n);o?h?(z=t+j*w,O=-j*F):(z=e-j*w,O=j*F):h?(D=r+j*w,R=-j*F):(D=n-j*w,R=j*F)}return{textX:L,textY:P,targetX:z,targetY:D,anchorX:O,anchorY:R,scale:k,rotate:T}}e.exports={plot:function(t,e,u,m,g,v){var T=e.xaxis,P=e.yaxis,z=t._fullLayout,D=t._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},f("bar",z));var O=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),f=l[0].trace,m=l[0].t,O="waterfall"===f.type,R="funnel"===f.type,F="histogram"===f.type,j="bar"===f.type,B=j||R,N=0;O&&f.connector.visible&&"between"===f.connector.mode&&(N=f.connector.line.width/2);var U="h"===f.orientation,V=S(g),q=i.ensureSingle(u,"g","points"),H=function(t){if(t.ids)return w}(f),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var S,O,R=r.select(this),q=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(u,T,P,U),H=q[0][0],G=q[0][1],Z=q[1][0],W=q[1][1],Y=0==(U?G-H:W-Z);if(Y&&B&&d.getLineWidth(f,u)&&(Y=!1),Y||(Y=!(n(H)&&n(G)&&n(Z)&&n(W))),u.isBlank=Y,Y&&(U?G=H:W=Z),N&&!Y&&(U?(H-=A(H,G)*N,G+=A(H,G)*N):(Z-=A(Z,W)*N,W+=A(Z,W)*N)),"waterfall"===f.type){if(!Y){var X=f[u.dir].marker;S=X.line.width,O=X.color}}else S=d.getLineWidth(f,u),O=u.mc||f.marker.color;function $(t){var e=r.round(S/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(t)-e,2):t}var K=o.opacity(O)<1||S>.01?$:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?$(t):t>e?Math.ceil(t):Math.floor(t)};t._context.staticPlot||(H=K(H,G,U),G=K(G,H,U),Z=K(Z,W,!U),W=K(W,Z,!U));var J,Q=U?T.c2p:P.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var tt,et,rt=j||F?function(t,e){if(!t)return 0;var r,n=U?Math.abs(W-Z):Math.abs(G-H),i=U?Math.abs(G-H):Math.abs(W-Z),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===e?n*(Math.min(50,t)/100):t,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,nt="M"+H+","+Z+"V"+W+"H"+G+"V"+Z+"Z",it=0;if(rt&&u.s){var at=0===k(u.s0)||k(u.s)===k(u.s0)?u.s1:u.s0;if((it=K(u.hasB?0:Math.abs(Q(J,!0)-Q(at,!0))))0?Math.sqrt(it*(2*rt-it)):0,ht=ot>0?Math.max:Math.min;tt="M"+H+","+Z+"V"+(W-ct*st)+"H"+ht(G-(rt-it)*ot,H)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st-ut)+"V"+(Z+rt*st+ut)+"A "+rt+","+rt+" 0 0 "+lt+" "+ht(G-(rt-it)*ot,H)+","+(Z+ct*st)+"Z"}else if(u.hasB)tt="M"+(H+rt*ot)+","+Z+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(Z+rt*st)+"V"+(W-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+W+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st)+"V"+(Z+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+Z+"Z";else{var ft=(et=Math.abs(W-Z)+it)0?Math.sqrt(it*(2*rt-it)):0,dt=st>0?Math.max:Math.min;tt="M"+(H+ft*ot)+","+Z+"V"+dt(W-(rt-it)*st,Z)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot-pt)+","+W+"H"+(G-rt*ot+pt)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-ft*ot)+","+dt(W-(rt-it)*st,Z)+"V"+Z+"Z"}}else tt=nt}else tt=nt;var mt=M(i.ensureSingle(R,"path"),z,g,v);if(mt.style("vector-effect",D?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*(W-Z))||Y&&t._context.staticPlot?"M0,0Z":tt).call(s.setClipUrl,e.layerClipId,t),!z.uniformtext.mode&&V){var gt=s.makePointStyleFns(f);s.singlePointStyle(u,mt,f,gt,t)}!function(t,e,r,n,o,l,u,f,m,g,v,w,T){var k,S=e.xaxis,P=e.yaxis,z=t._fullLayout;function D(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+k,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,t)}var O=n[0].trace,R="h"===O.orientation,F=function(t,e,r,n,a){var o,s=e[0].trace,l=s.texttemplate;return o=l?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,f,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(t){return c(u,u.c2l(t),!0).text}function v(t){return c(f,f.c2l(t),!0).text}g?(l="y",u=a,h="x",f=n):(l="x",u=n,h="y",f=a);var x=e[r],b={};b.label=x.p,b.labelLabel=b[l+"Label"]=y(x.p);var w=i.castOption(o,x.i,"text");(0===w||w)&&(b.text=w),b.value=x.s,b.valueLabel=b[h+"Label"]=v(x.s);var T={};_(T,o,x.i),(p||void 0===T.x)&&(T.x=g?b.value:b.label),(p||void 0===T.y)&&(T.y=g?b.label:b.value),(p||void 0===T.xLabel)&&(T.xLabel=g?b.valueLabel:b.labelLabel),(p||void 0===T.yLabel)&&(T.yLabel=g?b.labelLabel:b.valueLabel),d&&(b.delta=+x.rawS||x.s,b.deltaLabel=v(b.delta),b.final=x.v,b.finalLabel=v(b.final),b.initial=b.final-b.delta,b.initialLabel=v(b.initial)),m&&(b.value=x.s,b.valueLabel=v(b.value),b.percentInitial=x.begR,b.percentInitialLabel=i.formatPercent(x.begR),b.percentPrevious=x.difR,b.percentPreviousLabel=i.formatPercent(x.difR),b.percentTotal=x.sumR,b.percenTotalLabel=i.formatPercent(x.sumR));var k=i.castOption(o,x.i,"customdata");return k&&(b.customdata=k),i.texttemplateString(s,b,t._d3locale,T,b,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(t){return c(o?n:r,t,!0).text}function h(t){return c(o?r:n,+t,!0).text}var f,p=a.textinfo,d=t[e],m=p.split("+"),g=[],y=function(t){return-1!==m.indexOf(t)};if(y("label")&&g.push(u(t[e].p)),y("text")&&(0===(f=i.castOption(a,d.i,"text"))||f)&&g.push(f),s){var v=+d.rawS||d.s,x=d.v,_=x-v;y("initial")&&g.push(h(_)),y("delta")&&g.push(h(v)),y("final")&&g.push(h(x))}if(l){y("value")&&g.push(h(d.s));var b=0;y("percent initial")&&b++,y("percent previous")&&b++,y("percent total")&&b++;var w=b>1;y("percent initial")&&(f=i.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),y("percent previous")&&(f=i.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),y("percent total")&&(f=i.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(e,r,n,a):d.getValue(s.text,r),d.coerceString(y,o)}(z,n,o,S,P);k=function(t,e){var r=d.getValue(t.textposition,e);return d.coerceEnumerated(x,r)}(O,o);var j="stack"===w.mode||"relative"===w.mode,B=n[o],N=!j||B._outmost,U=B.hasB,V=g&&g-v>b;if(F&&"none"!==k&&(!B.isBlank&&l!==u&&f!==m||"auto"!==k&&"inside"!==k)){var q=z.font,H=p.getBarColor(n[o],O),G=p.getInsideTextFont(O,o,q,H),Z=p.getOutsideTextFont(O,o,q),W=O.insidetextanchor||"end",Y=r.datum();R?"log"===S.type&&Y.s0<=0&&(l=S.range[0]0&&J>0;it=V?U?E(rt-2*g,nt,K,J,R)||E(rt,nt-2*g,K,J,R):R?E(rt-(g-v),nt,K,J,R)||E(rt,nt-2*(g-v),K,J,R):E(rt,nt-(g-v),K,J,R)||E(rt-2*(g-v),nt,K,J,R):E(rt,nt,K,J,R),at&&it?k="inside":(k="outside",X.remove(),X=null)}else k="inside";if(!X){var ot=(X=D(r,F,Q=i.ensureUniformFontSize(t,"outside"===k?Z:G))).attr("transform");if(X.attr("transform",""),K=($=s.bBox(X.node())).width,J=$.height,X.attr("transform",ot),K<=0||J<=0)return void X.remove()}var st,lt=O.textangle;st="outside"===k?function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,f=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*b?b:0:f>2*b?b:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/u));var m=C(c),g=I(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,_=(t+e)/2,w=(r+n)/2,T=0,k=0,M=s?A(e,t):A(r,n);return s?(_=e-M*o,T=M*y):(w=n+M*o,k=-M*y),{textX:v,textY:x,targetX:_,targetY:w,anchorX:T,anchorY:k,scale:d,rotate:m}}(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:lt}):L(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:lt,anchor:W,hasB:U,r:g,overhead:v}),st.fontSize=Q.size,h("histogram"===O.type?"bar":O.type,st,z),B.transform=st;var ct=M(X,z,w,T);i.setTransormAndDisplay(ct,st)}else r.select("text").remove()}(t,e,R,l,w,H,G,Z,W,rt,it,g,v),e.layerClipId&&s.hideOutsideRangePoint(u,R.select("text"),T,P,f.xcalendar,f.ycalendar)}));var Z=!1===f.cliponaxis;s.setClipUrl(u,Z?null:e.layerClipId,t)}));l.getComponentMethod("errorbars","plot")(t,O,e,g)},toMoveInsideBar:L}}}),eo=d({"src/traces/bar/hover.js"(t,e){var r=zr(),n=Vt(),i=q(),a=se().fillText,o=Ja().getLineWidth,s=nr().hoverLabelText,l=k().BADNUM;function c(t,e,n,i,o){var c,u,h,f,p,d,m,g=t.cd,y=g[0].trace,v=g[0].t,x="closest"===i,_="waterfall"===y.type,b=t.maxHoverDistance,w=t.maxSpikeDistance;"h"===y.orientation?(c=n,u=e,h="y",f="x",p=D,d=P):(c=e,u=n,h="x",f="y",d=D,p=P);var T=y[h+"period"],k=x||T;function A(t){return S(t,-1)}function M(t){return S(t,1)}function S(t,e){var r=t.w;return t[h]+e*r/2}function E(t){return t[h+"End"]-t[h+"Start"]}var C=x?A:T?function(t){return t.p-E(t)/2}:function(t){return Math.min(A(t),t.p-v.bardelta/2)},I=x?M:T?function(t){return t.p+E(t)/2}:function(t){return Math.max(M(t),t.p+v.bardelta/2)};function L(t,e,n){return o.finiteRange&&(n=0),r.inbox(t-c,e-c,n+Math.min(1,Math.abs(e-t)/m)-1)}function P(t){return L(C(t),I(t),b)}function z(t){var e=t[f];if(_){var r=Math.abs(t.rawS)||0;u>0?e+=r:u<0&&(e-=r)}return e}function D(t){var e=u,n=t.b,i=z(t);return r.inbox(n-e,i-e,b+(i-e)/(i-n)-1)}var O=t[h+"a"],R=t[f+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F=r.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(r.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==l){k||(C=function(t){return Math.min(A(t),t.p-v.bargroupwidth/2)},I=function(t){return Math.max(M(t),t.p+v.bargroupwidth/2)});var j=g[t.index],B=y.base?j.b+j.s:j.s;t[f+"0"]=t[f+"1"]=R.c2p(j[f],!0),t[f+"LabelVal"]=B;var N=v.extents[v.extents.round(j.p)];t[h+"0"]=O.c2p(x?C(j):N[0],!0),t[h+"1"]=O.c2p(x?I(j):N[1],!0);var U,V,q,H,G=void 0!==j.orig_p;return t[h+"LabelVal"]=G?j.orig_p:j.p,t.labelLabel=s(O,t[h+"LabelVal"],y[h+"hoverformat"]),t.valueLabel=s(R,t[f+"LabelVal"],y[f+"hoverformat"]),t.baseLabel=s(R,j.b,y[f+"hoverformat"]),t.spikeDistance=(V=u,q=(U=j).b,H=z(U),(r.inbox(q-V,H-V,w+(H-V)/(H-q)-1)+function(t){return L(A(t),M(t),w)}(j))/2),t[h+"Spike"]=O.c2p(j.p,!0),a(j,y,t),t.hovertemplate=y.hovertemplate,t}}function u(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=o(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,i,a){var o=c(t,e,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),ro=d({"src/traces/bar/event_data.js"(t,e){e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}}}),no=d({"src/traces/bar/select.js"(t,e){function r(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var n,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(n=0;n0?(g="v",y=x>0?Math.min(b,_):Math.min(_)):x>0?(g="h",y=Math.min(b)):y=0;if(y){e._length=y;var S=i("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(i("x0",0),i("dx",1)):"h"===S&&0===v&&(i("y0",0),i("dy",1)):"v"===S&&0===x?i("x0"):"h"===S&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function u(t,e,n,i){var a=i.prefix,o=r.coerce2(t,e,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete e.marker;var h=n("hoveron");"all"!==h&&-1===h.indexOf("points")||n("hovertemplate"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,o){function s(n,i){return r.coerce(t,e,l,n,i)}if(c(t,e,s,o),!1!==e.visible){a(t,e,o,s),s("xhoverformat"),s("yhoverformat");var h=e._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(e.line.color,.5));var f=!1;if(h){var p=s("mean"),d=s("sd");p&&p.length&&(f=!0,d&&d.length&&(f="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",f)),s("showwhiskers","quartiles"===g),"sd"!==g&&"sd"!==m||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(t.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(t,e,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(t,e){var n,i;function a(t){return r.coerce(i._input,i,l,t)}for(var s=0;sE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return v.d2c((e[t]||[])[l])},q=1/0,H=-1/0;for(l=0;l=E.q1&&E.q3>=E.med){var Z=V("lowerfence");E.lf=Z!==o&&Z<=E.q1?Z:f(E,I,L);var W=V("upperfence");E.uf=W!==o&&W>=E.q3?W:p(E,I,L);var Y=V("mean");E.mean=Y!==o?Y:L?a.mean(I,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Y!==o&&X>=0?X:L?a.stdev(I,L,E.mean):E.q3-E.q1,E.lo=d(E),E.uo=m(E);var $=V("notchspan");$=$!==o&&$>0?$:g(E,L),E.ln=E.med-$,E.un=E.med+$;var K=E.lf,J=E.uf;e.boxpoints&&I.length&&(K=Math.min(K,I[0]),J=Math.max(J,I[L-1])),e.notched&&(K=Math.min(K,E.ln),J=Math.max(J,E.un)),E.min=K,E.max=J}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(N),M.push(E)}}e._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var tt=v.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ht;(E={}).pos=E[b]=j[l],C=E.pts=nt[l].sort(u),L=(I=E[x]=C.map(h)).length,E.min=I[0],E.max=I[L-1],E.mean=a.mean(I,L),E.sd=a.stdev(I,L,E.mean)*e.sdmultiple,E.med=a.interp(I,.5),L%2&&(lt||ct)?(lt?(ut=I.slice(0,L/2),ht=I.slice(L/2+1)):ct&&(ut=I.slice(0,L/2+1),ht=I.slice(L/2)),E.q1=a.interp(ut,.5),E.q3=a.interp(ht,.5)):(E.q1=a.interp(I,.25),E.q3=a.interp(I,.75)),E.lf=f(E,I,L),E.uf=p(E,I,L),E.lo=d(E),E.uo=m(E);var ft=g(E,L);E.ln=E.med-ft,E.un=E.med+ft,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=C.filter(N),M.push(E)}e.notched&&a.isTypedArray(tt)&&(tt=Array.from(tt)),e._extremes[v._id]=n.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:B,posLetter:b,valLetter:x,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean||"sd"===e.sizemode?s(t,"mean ± σ:").replace("σ",1===e.sdmultiple?"σ":e.sdmultiple+"σ"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in l)a.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function u(t,e){return t.v-e.v}function h(t){return t.v}function f(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(a.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function p(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(a.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function d(t){return 4*t.q1-3*t.q3}function m(t){return 4*t.q3-3*t.q1}function g(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}}}),ho=d({"src/traces/box/cross_trace_calc.js"(t,e){var r=nr(),n=se(),i=en().getAxisGroup,a=["v","h"];function o(t,e,a,o){var s,l,c,u=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],m=0;for(s=0;s1,_=1-h[t+"gap"],b=1-h[t+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,Z=E.marker.size/2,W=0;H+G>=0&&((W=V*(H+G))>M?(q=!0,N=Z,j=W):W>R&&(N=Z,j=M)),W<=M&&(j=M);var Y=0;H-G<=0&&((Y=-V*(H-G))>S?(q=!0,U=Z,B=Y):Y>F&&(U=Z,B=S)),Y<=S&&(B=S)}else j=M,B=S;var X=new Array(c.length);for(l=0;lt.lo&&(x.so=!0)}return a}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function s(t,e,i,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,h=a.bPos,f=a.bPosPxOffset||0,p=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+h,!0),n=c.l2p(e-o)+f,a=c.l2p(e+s)+f,d=u?(n+a)/2:c.l2p(e)+f,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+n+"L"+y+","+d+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+n+","+m+"L"+d+","+y+"Z":""))}))}e.exports={plot:function(t,e,i,l){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(t){var e,n,i=r.select(this),l=t[0],f=l.t,p=l.trace;f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty?i.remove():("h"===p.orientation?(e=h,n=u):(e=u,n=h),a(i,{pos:e,val:n},p,f,c),o(i,{x:u,y:h},p,f),s(i,{pos:e,val:n},p,f))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),po=d({"src/traces/box/style.js"(t,e){var r=v(),n=q(),i=Je();e.exports={style:function(t,e,a){var o=a||r.select(t).selectAll("g.trace.boxes");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(e){var a=r.select(this),o=e[0].trace,s=o.line.width;function l(t,e,r,i){t.style("stroke-width",e+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(t){if(!t.empty){var e=r.select(this),n=o[t.dir];l(e,n.line.width,n.line.color,n.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,t)}}))},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}}}),mo=d({"src/traces/box/hover.js"(t,e){var r=nr(),n=se(),i=zr(),a=q(),o=n.fillText;function s(t,e,o,s){var l,c,u,h,f,p,d,m,g,y,v,x,_,b,w=t.cd,T=t.xa,k=t.ya,A=w[0].trace,M=w[0].t,S="violin"===A.type,E=M.bdPos,C=M.wHover,I=function(t){return u.c2l(t.pos)+M.bPos-u.c2l(p)};S&&"both"!==A.side?("positive"===A.side&&(g=function(t){var e=I(t);return i.inbox(e,e+C,y)},x=E,_=0),"negative"===A.side&&(g=function(t){var e=I(t);return i.inbox(e-C,e,y)},x=0,_=E)):(g=function(t){var e=I(t);return i.inbox(e-C,e+C,y)},x=_=E),b=S?function(t){return i.inbox(t.span[0]-f,t.span[1]-f,y)}:function(t){return i.inbox(t.min-f,t.max-f,y)},"h"===A.orientation?(f=e,p=o,d=b,m=g,l="y",u=k,c="x",h=T):(f=o,p=e,d=g,m=b,l="x",u=T,c="y",h=k);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function P(t){return(d(t)+m(t))/2}y=t.maxHoverDistance-L,v=t.maxSpikeDistance-L;var z=i.getDistanceFunction(s,d,m,P);if(i.getClosest(w,z,t),!1===t.index)return[];var D=w[t.index],O=A.line.color,R=(A.marker||{}).color;a.opacity(O)&&A.line.width?t.color=O:a.opacity(R)&&A.boxpoints?t.color=R:t.color=A.fillcolor,t[l+"0"]=u.c2p(D.pos+M.bPos-_,!0),t[l+"1"]=u.c2p(D.pos+M.bPos+x,!0),t[l+"LabelVal"]=void 0!==D.orig_p?D.orig_p:D.pos;var F=l+"Spike";t.spikeDistance=P(D)*v/y,t[F]=u.c2p(D.pos,!0);var j=A.boxmean||"sd"===A.sizemode||(A.meanline||{}).visible,B=A.boxpoints||A.points,N=B&&j?["max","uf","q3","med","mean","q1","lf","min"]:B&&!j?["max","uf","q3","med","q1","lf","min"]:!B&&j?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]0&&(a=!0);for(var l=0;la){var o=a-n[t];return n[t]=a,o}}return 0},max:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]l?t>a?t>1.1*n?n:t>1.1*i?i:a:t>o?o:t>s?s:l:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function f(t,e,r,i,o,s){if(i&&t>a){var l=p(e,o,s),c=p(r,o,s),u=t===n?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var i=e.c2d(t,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}e.exports=function(t,e,r,i,o){var s,l,h=-1.1*e,f=-.1*e,p=t-f,d=r[0],m=r[1],g=Math.min(u(d+f,d+p,i,o),u(m+f,m+p,i,o)),y=Math.min(u(d+h,d+f,i,o),u(m+h,m+f,i,o));if(g>y&&ya){var v=s===n?1:6,x=s===n?"M12":"M1";return function(e,r){var a=i.c2d(e,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var u=i.d2c(a,0,o);if(uo.r2l(j)&&(N=a.tickIncrement(N,_.size,!0,p)),D.start=o.l2r(N),F||n.nestedProperty(e,y+".start").set(D.start)}var U=_.end,V=o.r2l(z.end),q=void 0!==V;if((_.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,d);D.end=o.l2r(H),q||n.nestedProperty(e,y+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=n.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var i,f,p,d,m=[],g=[],y="h"===e.orientation,v=a.getFromId(t,y?e.yaxis:e.xaxis),x=y?"y":"x",_={x:"y",y:"x"}[x],b=e[x+"calendar"],w=e.cumulative,T=h(t,e,v,x),k=T[0],A=T[1],M="string"==typeof k.size,S=[],E=M?S:k,C=[],I=[],L=[],P=0,z=e.histnorm,D=e.histfunc,O=-1!==z.indexOf("density");w.enabled&&O&&(z=z.replace(/ ?density$/,""),O=!1);var R,F="max"===D||"min"===D?null:0,j=s.count,B=l[z],N=!1,U=function(t){return v.r2c(t,0,b)};for(n.isArrayOrTypedArray(e[_])&&"count"!==D&&(R=e[_],N="avg"===D,j=s[D]),i=U(k.start),p=U(k.end)+(i-a.tickIncrement(i,k.size,!1,b))/1e6;i=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,tt=K-1;for(i=0;i=Q;i--)if(g[i]){tt=i;break}for(i=Q;i<=tt;i++)if(r(m[i])&&r(g[i])){var et={p:m[i],s:g[i],b:0};w.enabled||(et.pts=L[i],Z?et.ph0=et.ph1=L[i].length?A[L[i][0]]:m[i]:(e._computePh=!0,et.ph0=H(S[i]),et.ph1=H(S[i+1],!0))),J.push(et)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,k.size,!1,b)-J[0].p),o(J,e),n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(J,e,X),J},calcAllAutoBins:h}}}),Io=d({"src/traces/histogram2d/calc.js"(t,e){var r=se(),n=nr(),i=Ao(),a=Mo(),o=So(),s=Eo(),l=Co().calcAllAutoBins;function c(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;iS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],I=[],L="string"==typeof w.size,P="string"==typeof A.size,z=[],D=[],O=L?z:w,R=P?D:A,F=0,j=[],B=[],N=e.histnorm,U=e.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],Z=!1,W=[],Y=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(Z="avg"===U,H=i[U]);var $=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,$,!1,y))/1e6;for(s=K;s=0&&p=0&&dm&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-m))))}return y}e.exports=function(t,e){var n,o=1;for(a(t,e),n=0;n.01;n++)o=a(t,e,i(o));return o>.01&&r.log("interp2d didn't converge quickly",o),t}}}),Do=d({"src/traces/heatmap/find_empties.js"(t,e){var r=se().maxRowLength;e.exports=function(t){var e,n,i,a,o,s,l,c,u=[],h={},f=[],p=t[0],d=[],m=[0,0,0],g=r(t);for(n=0;n=0;o--)(s=((h[[(n=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}}}),Oo=d({"src/traces/heatmap/make_bound_array.js"(t,e){var r=Vt(),n=se().isArrayOrTypedArray;e.exports=function(t,e,i,a,o,s){var l,c,u,h=[],f=r.traceIs(t,"contour"),p=r.traceIs(t,"histogram");if(n(e)&&e.length>1&&!p&&"category"!==s.type){var d=e.length;if(!(d<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f)h=Array.from(e).slice(0,o);else if(1===o)h="log"===s.type?[.5*e[0],2*e[0]]:[e[0]-.5,e[0]+.5];else if("log"===s.type){for(h=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],u=1;u1){var e=(t[t.length-1]-t[0])/(t.length-1),r=Math.abs(e/100);for(k=0;kr)return!1}return!0}(M.rangebreaks||S.rangebreaks)&&(T=function(t,e,r){for(var n=[],i=-1,a=0;a0;)k=A.c2p(B[I]),I--;for(k0;)C=M.c2p(N[I]),I--;C=A._length||k<=0||E>=M._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void _(z);"fast"===X?(K=Z,J=G):(K=Q,J=tt);var et=document.createElement("canvas");et.width=K,et.height=J;var rt,nt,it=et.getContext("2d",{willReadFrequently:!0}),at=f(O,{noNumericCheck:!0,returnArray:!0});"fast"===X?(rt=W?function(t){return Z-1-t}:s.identity,nt=Y?function(t){return G-1-t}:s.identity):(rt=function(t){return s.constrain(Math.round(A.c2p(B[t])-v),0,Q)},nt=function(t){return s.constrain(Math.round(M.c2p(N[t])-E),0,tt)});var ot,st,lt,ct,ut=nt(0),ht=[ut,ut],ft=W?0:1,pt=Y?0:1,dt=0,mt=0,gt=0,yt=0;function vt(t,e){if(void 0!==t){var r=at(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),dt+=e,mt+=r[0]*e,gt+=r[1]*e,yt+=r[2]*e,r}return[0,0,0,0]}function xt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return vt(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,vt(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==X){var _t,bt=0;try{_t=new Uint8Array(K*J*4)}catch(t){_t=new Array(K*J*4)}if("smooth"===X){var wt,Tt,kt,At=U||B,Mt=V||N,St=new Array(At.length),Et=new Array(Mt.length),Ct=new Array(Q),It=U?w:b,Lt=V?w:b;for(I=0;IXt||Xt>M._length))for(L=Gt;LKt||Kt>A._length)){var Jt=c({x:$t,y:Yt},O,t._fullLayout);Jt.x=$t,Jt.y=Yt;var Qt=D.z[I][L];void 0===Qt?(Jt.z="",Jt.zLabel=""):(Jt.z=Qt,Jt.zLabel=o.tickText(Ut,Qt,"hover").text);var te=D.text&&D.text[I]&&D.text[I][L];void 0!==te&&!1!==te||(te=""),Jt.text=te;var ee=s.texttemplateString(Bt,Jt,t._fullLayout._d3locale,Jt,O._meta||{});if(ee){var re=ee.split("
"),ne=re.length,ie=0;for(P=0;P=b[0].length||p<0||p>b.length)return}else{if(r.inbox(e-x[0],e-x[x.length-1],0)>0||r.inbox(s-_[0],s-_[_.length-1],0)>0)return;if(d){var E;for(M=[2*x[0]-x[1]],E=1;E=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ss=d({"src/traces/contour/attributes.js"(t,e){var r=_o(),n=wn(),i=Ee(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Le(),l=Pt().dash,c=R(),u=O().extendFlat,h=os(),f=h.COMPARISON_OPS2,p=h.INTERVAL_OPS,d=n.line;e.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(f).concat(p),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},d.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),ls=d({"src/traces/histogram2dcontour/attributes.js"(t,e){var r=ts(),n=ss(),i=Le(),a=Ee().axisHoverFormat,o=O().extendFlat;e.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),cs=d({"src/traces/contour/contours_defaults.js"(t,e){e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}}}),us=d({"src/traces/contour/label_defaults.js"(t,e){var r=se();e.exports=function(t,e,n,i){if(i||(i={}),t("contours.showlabels")){var a=e.font;r.coerceFont(t,"contours.labelfont",a,{overrideDflt:{color:n}}),t("contours.labelformat")}!1!==i.hasHover&&t("zhoverformat")}}}),hs=d({"src/traces/contour/style_defaults.js"(t,e){var r=Ve(),n=us();e.exports=function(t,e,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,r(t,e,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),fs=d({"src/traces/histogram2dcontour/defaults.js"(t,e){var r=se(),n=es(),i=cs(),a=hs(),o=wo(),s=ls();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,(function(n){return r.coerce2(t,e,s,n)})),a(t,e,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&o(u,c))}}}),ps=d({"src/traces/contour/set_contours.js"(t,e){var r=nr(),n=se();function i(t,e,n){var i={type:"linear",range:[t,e]};return r.autoTicks(i,(e-t)/(n||15)),i}e.exports=function(t,e){var a=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),t._input.contours||(t._input.contours={}),n.extendFlat(t._input.contours,{start:a.start,end:a.end,size:a.size}),t._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,f=t._input.contours;u>h&&(a.start=f.start=h,h=a.end=f.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,t.ncontours).dtick,f.size=a.size=c)}}}}),ds=d({"src/traces/contour/end_plus.js"(t,e){e.exports=function(t){return t.end+t.size/1e6}}}),ms=d({"src/traces/contour/calc.js"(t,e){var r=Ze(),n=Ro(),i=ps(),a=ds();e.exports=function(t,e){var o=n(t,e),s=o[0].z;i(e,s);var l,c=e.contours,u=r.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var h=c.start,f=a(c),p=c.size||1,d=Math.floor((f-h)/p)+1;isFinite(p)||(p=1,d=1);var m=h-p/2;l=[m,m+d*p]}else l=s;return r.calc(t,e,{vals:l,cLetter:"z"}),o}}}),gs=d({"src/traces/contour/constants.js"(t,e){e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),ys=d({"src/traces/contour/make_crossings.js"(t,e){var r=gs();function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,i,a,o,s,l,c,u,h,f=t[0].z,p=f.length,d=f[0].length,m=2===p||2===d;for(i=0;i20&&e?208===t||1114===t?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(t)?a=1:-1!==n.LEFTSTART.indexOf(t)?i=1:-1!==n.TOPSTART.indexOf(t)?a=-1:i=-1,[i,a]}(h,a,e),p=[o(t,e,[-f[0],-f[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),y=f.slice();for(c=0;c<1e4;c++){if(h>20?(h=n.CHOOSESADDLE[h][(f[0]||f[1])<0?0:1],t.crossings[u]=n.SADDLEREMAINDER[h]):delete t.crossings[u],!(f=n.NEWDELTA[h])){r.log("Found bad marching index:",h,e,t.level);break}p.push(o(t,e,f)),e[0]+=f[0],e[1]+=f[1],u=e.join(","),i(p[p.length-1],p[p.length-2],s,l)&&p.pop();var v=f[0]&&(e[0]<0||e[0]>m-2)||f[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&f[0]===y[0]&&f[1]===y[1]||a&&v)break;h=t.crossings[u]}1e4===c&&r.log("Infinite loop in contour?");var x,_,b,w,T,k,A,M,S,E,C,I,L,P,z,D=i(p[0],p[p.length-1],s,l),O=0,R=.2*t.smoothing,F=[],j=0;for(c=1;c=j;c--)if((x=F[c])=j&&x+F[_]M&&S--,t.edgepaths[S]=C.concat(p,E));break}V||(t.edgepaths[M]=p.concat(E))}for(M=0;M":o(">"),"<":o("<"),"=":o("=")}}}),_s=d({"src/traces/contour/empty_pathinfo.js"(t,e){var r=se(),n=xs(),i=ds();e.exports=function(t,e,a){for(var o="constraint"===t.type?n[t._operation](t.value):t,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y},f=o.start;f1e3){r.warn("Too many contours, clipping at 1000",t);break}return l}}}),bs=d({"src/traces/contour/convert_to_constraints.js"(t,e){var r=se();function n(t){return r.extendFlat({},t,{edgepaths:r.extendDeep([],t.edgepaths),paths:r.extendDeep([],t.paths),starts:r.extendDeep([],t.starts)})}e.exports=function(t,e){var i,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&r.warn("Contour data invalid for the specified inequality operation."),a=t[0],i=0;io.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),hc&&(n.prefixBoundary=!0)}}}}}),Ts=d({"src/traces/contour/plot.js"(t){var e=v(),r=se(),n=Je(),i=Ze(),a=Me(),o=nr(),s=tr(),l=Bo(),c=ys(),u=vs(),h=_s(),f=bs(),p=ws(),d=gs(),m=d.LABELOPTIMIZER;function g(t,e){var i,a,o,s,l,c,u,h="",f=0,p=t.edgepaths.map((function(t,e){return e})),d=!0;function m(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(c=n.smoothopen(t.edgepaths[f],t.smoothing),h+=d?c:c.replace(/^M/,"L"),p.splice(p.indexOf(f),1),i=t.edgepaths[f][t.edgepaths[f].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",f,t);break}for(u=i,Math.abs(u[1]-e[0][1])<.01&&!y(i)?a=e[1]:g(i)?a=e[0]:m(i)?a=e[3]:y(i)&&(a=e[2]),l=0;l=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===t.edgepaths.length){r.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;fi.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=m.EDGECOST*(1/(f-1)+1/(p-1));d+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,_=0;_2*m.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=m.MAXCOST)return u},t.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),f=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},p=[f(-a/2,-o/2),f(-a/2,o/2),f(a/2,o/2),f(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},t.drawLabels=function(t,n,i,o,s){var l=t.selectAll("text").data(n,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var r=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;e.select(this).text(t.text).attr({x:r,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),f=0;fy&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:r(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t("contours.value",0),r(e.value)||(l(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(i,g),"="===y?p=g.showlines=!0:(p=i("contours.showlines"),m=i("fillcolor",a((t.line||{}).color||h,.5))),p&&(d=i("line.color",m&&o(m)?a(e.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,d,f)}}}),Ls=d({"src/traces/contour/defaults.js"(t,e){var r=se(),n=bo(),i=Hn(),a=Is(),o=cs(),s=hs(),l=wo(),c=ss();e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,c,n,i)}if(n(t,e,f,h)){i(t,e,h,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var p="constraint"===f("contours.type");f("connectgaps",r.isArray1D(e.z)),p?a(t,e,f,h,u):(o(t,e,f,(function(n){return r.coerce2(t,e,c,n)})),s(t,e,f,h)),e.contours&&"heatmap"===e.contours.coloring&&l(f,h),f("zorder")}else e.visible=!1}}}),Ps=d({"src/traces/contour/index.js"(t,e){e.exports={attributes:ss(),supplyDefaults:Ls(),calc:ms(),plot:Ts().plot,style:As(),colorbar:Ms(),hoverPoints:Ss(),moduleType:"trace",name:"contour",basePlotModule:Mi(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),zs=d({"lib/contour.js"(t,e){e.exports=Ps()}}),Ds=d({"src/traces/scatterternary/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=bn(),a=wn(),o=N(),s=Le(),l=Pt().dash,c=O().extendFlat,u=a.marker,h=a.line,f=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Os=d({"src/traces/scatterternary/defaults.js"(t,e){var r=se(),n=_n(),i=We(),a=Zn(),o=Wn(),s=Yn(),l=Xn(),c=$n(),u=Ds();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}var d,m=p("a"),g=p("b"),y=p("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){e._length=d,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",d"),o.hovertemplate=f.hovertemplate,a}function x(t,e){y.push(t._hovertitle+": "+e)}}}}),Ns=d({"src/traces/scatterternary/event_data.js"(t,e){e.exports=function(t,e,r,n,i){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[i]){var a=n[i];t.a=a.a,t.b=a.b,t.c=a.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}}}),Us=d({"src/plots/ternary/ternary.js"(t,e){var r=v(),n=D(),i=Vt(),a=se(),o=a.strTranslate,s=a._,l=q(),c=Je(),u=tr(),h=O().extendFlat,f=Te(),p=nr(),d=hr(),m=zr(),g=Dr(),y=g.freeMode,x=g.rectMode,_=Qe(),b=Sn().prepSelect,w=Sn().selectOnClick,T=Sn().clearOutline,k=Sn().clearSelectionsCache,A=ye();function M(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.updateFx(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;aE*_?i=(a=_)*E:a=(i=x)/E,s=y*i/x,f=v*a/_,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=b,p.xaxis={type:"linear",range:[w+2*k-b,b-w-2*T],domain:[m-s/2,m+s/2],_id:"x"},u(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,b-T-k],domain:[g-f/2,g+f/2],_id:"y"},u(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,b-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});u(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[b-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(S,p.graphDiv._fullLayout),S.setScale();var C=p.caxis=h({},t.caxis,{range:[b-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});u(C,p.graphDiv._fullLayout),C.setScale();var I="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",I),p.layers.plotbg.select("path").attr("d",I);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",L);var P=o(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),p.clipDefRelative.select("path").attr("transform",null);var z=o(r-S._offset,n+a);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var D=o(r+i/2,n)+"rotate(30)"+o(0,-M._offset);p.layers.aaxis.attr("transform",D),p.layers.agrid.attr("transform",D);var O=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);p.layers.caxis.attr("transform",O),p.layers.cgrid.attr("transform",O),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.layers,a=e.aaxis,o=e.baxis,l=e.caxis;if(e.drawAx(a),e.drawAx(o),e.drawAx(l),t){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=_.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:e.x0+e.w/2,y:e.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=_.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:e.x0-u,y:e.y0+e.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=_.draw(r,"c"+n,{propContainer:l,propName:e.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:e.x0+e.w+u,y:e.y0+e.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this,n=r.graphDiv,i=t._name,o=i.charAt(0),s=t._id,l=r.layers[i],c=o+"tickLayout",u=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);r[c]!==u&&(l.selectAll("."+s+"tick").remove(),r[c]=u),t.setScale();var h=p.calcTicks(t),f=p.clipEnds(t,h),d=p.makeTransTickFn(t),m=p.getTickSigns(t)[2],g=a.deg2rad(30),y=m*(t.linewidth||1)/2,v=m*t.ticklen,x=r.w,_=r.h,b="b"===o?"M0,"+y+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+y+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,w={a:"M0,0l"+_+",-"+x/2,b:"M0,0l-"+x/2+",-"+_,c:"M0,0l-"+_+","+x/2}[o];p.drawTicks(n,t,{vals:"inside"===t.ticks?f:h,layer:l,path:b,transFn:d,crisp:!1}),p.drawGrid(n,t,{vals:f,layer:r.layers[o+"grid"],path:w,transFn:d,crisp:!1}),p.drawLabels(n,t,{vals:h,layer:l,transFn:d,labelFns:p.makeLabelFns(t,0,30)})};var C=A.MINZOOM/2+.87,I="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",P="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function R(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,u,h,f,p,g,v,_,T,k,M=this,S=M.layers.plotbg.select("path").node(),C=M.graphDiv,D=C._fullLayout._zoomlayer;function O(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=C._fullLayout.clickmode;R(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,O({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,C,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&m.click(C,e,M.id)}function j(t,e){return 1-e/M.h}function B(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function N(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(n,i){var a=r+n*t,o=u+i*e,s=Math.max(0,Math.min(1,j(0,u),j(0,o))),l=Math.max(0,Math.min(1,B(r,u),B(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),d=(s/2+c)*M.w,m=(1-s/2-l)*M.w,y=(d+m)/2,x=m-d,b=(1-s)*M.h,w=b-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),_=!0),C.emit("plotly_relayouting",O(p))}function V(){R(C),p!==h&&(i.call("_guiRelayout",C,O(p)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long"),z=!1))}function q(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(p={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,p.b,p.c].sort(a.sorterAsc),s=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[s],b:i[l],c:i[u]},e=(h.a-p.a)*M.yaxis._m,t=(h.c-p.c-h.b+p.b)*M.xaxis._m);var f=o(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d=o(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,M),C.emit("plotly_relayouting",O(p))}function H(){i.call("_guiRelayout",C,O(p))}this.dragOptions={element:S,gd:C,plotinfo:{id:M.id,domain:C._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(i,s,c){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=C._fullLayout._invScaleX,e=C._fullLayout._invScaleY;var d=M.dragOptions.dragmode=C._fullLayout.dragmode;y(d)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===d?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,i){var s=S.getBoundingClientRect();r=e-s.left,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,d=a.apply3DTransform(c)(r,u);r=d[0],u=d[1],h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,f=M.aaxis.range[1]-h.a,g=n(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),v="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",_=!1,T=D.append("path").attr("class","zoombox").attr("transform",o(M.x0,M.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=D.append("path").attr("class","zoombox-corners").attr("transform",o(M.x0,M.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(C)}(0,s,c)):"pan"===d?(M.dragOptions.moveFn=q,M.dragOptions.clickFn=F,M.dragOptions.doneFn=H,h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,M.clearOutline(C)):(x(d)||y(d))&&b(i,s,c,M.dragOptions,d)}},S.onmousemove=function(t){m.hover(C,t,M.id),C._fullLayout._lasthover=S,C._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){C._dragging||d.unhover(C,t)},d.init(this.dragOptions)}}}),Vs=d({"src/plots/ternary/layout_attributes.js"(t,e){var r=V(),n=Ta().attributes,i=Ce(),a=Lt().overrideAll,o=O().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=e.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),qs=d({"src/plots/subplot_defaults.js"(t,e){var r=se(),n=ge(),i=Ta().defaults;e.exports=function(t,e,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,f=o.partition||"x",p=e._subplots[c],d=p.length,m=d&&p[0].replace(/\d+$/,"");function g(t,e){return r.coerce(s,l,u,t,e)}for(var y=0;y=u&&(p.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=h[e._name];function f(r,n){return i.coerce(t,e,a,r,n)}f("uirevision",n.uirevision),e.type="linear";var p=f("color"),d=p!==a.color.dflt?p:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=f("title.text",g);e._hovertitle=y===g?y:m,i.coerceFont(f,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:d}}),f("min"),c(t,e,f,"linear"),s(t,e,f,"linear"),o(t,e,f,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(t,e,f,{outerTicks:!0}),f("showticklabels")&&(i.coerceFont(f,"tickfont",r.font,{overrideDflt:{color:d}}),f("tickangle"),f("tickformat")),u(t,e,f,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),f("hoverformat"),f("layer")}e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}}}),Gs=d({"src/plots/ternary/index.js"(t){var e=Us(),r=be().getSubplotCalcData,n=se().counterRegex,i="ternary";t.name=i;var a=t.attr="subplot";t.idRoot=i,t.idRegex=t.attrRegex=n(i),(t.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},t.layoutAttributes=Vs(),t.supplyLayoutDefaults=Hs(),t.plot=function(t){for(var n=t._fullLayout,a=t.calcdata,o=n._subplots[i],s=0;s0){var _,b,w,T,k,A=t.xa,M=t.ya;"h"===d.orientation?(k=e,_="y",w=M,b="x",T=A):(k=s,_="x",w=A,b="y",T=M);var S=p[t.index];if(k>=S.span[0]&&k<=S.span[1]){var E=n.extendFlat({},t),C=T.c2p(k,!0),I=o.getKdeValue(S,d,k),L=o.getPositionOnKdePath(S,d,C),P=w._offset,z=w._length;E[_+"0"]=L[0],E[_+"1"]=L[1],E[b+"0"]=E[b+"1"]=C,E[b+"Label"]=b+": "+i.hoverLabelText(T,k,d[b+"hoverformat"])+", "+p[0].t.labels.kde+" "+I.toFixed(3);for(var D=0,O=0;O path").each((function(t){if(!t.isBlank){var e=s.marker;r.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(n.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),yl=d({"src/traces/funnel/hover.js"(t,e){var r=q().opacity,n=eo().hoverOnBars,i=se().formatPercent;e.exports=function(t,e,a,o,s){var l=n(t,e,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,f=c[l.index];l[(h?"x":"y")+"LabelVal"]=f.s,l.percentInitial=f.begR,l.percentInitialLabel=i(f.begR,1),l.percentPrevious=f.difR,l.percentPreviousLabel=i(f.difR,1),l.percentTotal=f.sumR,l.percentTotalLabel=i(f.sumR,1);var p=f.hi||u.hoverinfo,d=[];if(p&&"none"!==p&&"skip"!==p){var m="all"===p,g=p.split("+"),y=function(t){return m||-1!==g.indexOf(t)};y("percent initial")&&d.push(l.percentInitialLabel+" of initial"),y("percent previous")&&d.push(l.percentPreviousLabel+" of previous"),y("percent total")&&d.push(l.percentTotalLabel+" of total")}return l.extraText=d.join("
"),l.color=function(t,e){var n=t.marker,i=e.mc||n.color,a=e.mlc||n.line.color,o=e.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,f),[l]}}}}),vl=d({"src/traces/funnel/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"percentInitial"in e&&(t.percentInitial=e.percentInitial),"percentPrevious"in e&&(t.percentPrevious=e.percentPrevious),"percentTotal"in e&&(t.percentTotal=e.percentTotal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),xl=d({"src/traces/funnel/index.js"(t,e){e.exports={attributes:sl(),layoutAttributes:ll(),supplyDefaults:cl().supplyDefaults,crossTraceDefaults:cl().crossTraceDefaults,supplyLayoutDefaults:ul(),calc:fl(),crossTraceCalc:pl(),plot:dl(),style:ml().style,hoverPoints:yl(),eventData:vl(),selectPoints:no(),moduleType:"trace",name:"funnel",basePlotModule:Mi(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),_l=d({"lib/funnel.js"(t,e){e.exports=xl()}}),bl=d({"src/traces/waterfall/constants.js"(t,e){e.exports={eventDataKeys:["initial","delta","final"]}}}),wl=d({"src/traces/waterfall/attributes.js"(t,e){var r=Ha(),n=wn().line,i=N(),a=Ee().axisHoverFormat,o=Dt().hovertemplateAttrs,s=Dt().texttemplateAttrs,l=bl(),c=O().extendFlat,u=q();function h(t){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}e.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),Tl=d({"src/traces/waterfall/layout_attributes.js"(t,e){e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),kl=d({"src/constants/delta.js"(t,e){e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Al=d({"src/traces/waterfall/defaults.js"(t,e){var r=se(),n=Jn(),i=Wa().handleText,a=qn(),o=Hn(),s=wl(),l=q(),c=kl(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function f(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",l.defaultLine),t(e+".marker.line.width")}e.exports={supplyDefaults:function(t,e,n,l){function c(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,l,c)){o(t,e,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var p=c("textposition");i(t,e,l,c,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(c("texttemplate"),e.texttemplate||c("textinfo")),f(c,"increasing",u),f(c,"decreasing",h),f(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}if("group"===e.waterfallmode)for(var l=0;l0&&(g+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(o.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;r.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(n.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),Ll=d({"src/traces/waterfall/hover.js"(t,e){var r=nr().hoverLabelText,n=q().opacity,i=eo().hoverOnBars,a=kl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;e.exports=function(t,e,a,l,c){var u=i(t,e,a,l,c);if(u){var h=u.cd,f=h[0].trace,p="h"===f.orientation,d=p?"x":"y",m=p?t.xa:t.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=k(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=k(u.final),u.initialLabel=k(u.initial);var x=g.hi||f.hoverinfo,_=[];if(x&&"none"!==x&&"skip"!==x){var b="all"===x,w=x.split("+"),T=function(t){return b||-1!==w.indexOf(t)};g.isSum||(!T("final")||T(p?"x":"y")||_.push(u.finalLabel),T("delta")&&(y<0?_.push(u.deltaLabel+" "+s):_.push(u.deltaLabel+" "+o)),T("initial")&&_.push("Initial: "+u.initialLabel))}return _.length&&(u.extraText=_.join("
")),u.color=function(t,e){var r=t[e.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(f,g),[u]}function k(t){return r(m,t,f[d+"hoverformat"])}}}}),Pl=d({"src/traces/waterfall/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),zl=d({"src/traces/waterfall/index.js"(t,e){e.exports={attributes:wl(),layoutAttributes:Tl(),supplyDefaults:Al().supplyDefaults,crossTraceDefaults:Al().crossTraceDefaults,supplyLayoutDefaults:Ml(),calc:Sl(),crossTraceCalc:El(),plot:Cl(),style:Il().style,hoverPoints:Ll(),eventData:Pl(),selectPoints:no(),moduleType:"trace",name:"waterfall",basePlotModule:Mi(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Dl=d({"lib/waterfall.js"(t,e){e.exports=zl()}}),Ol=d({"src/traces/image/constants.js"(t,e){e.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var e=t.slice(0,3);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var e=t.slice(0,4);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%",""]}}}}}),Rl=d({"src/traces/image/attributes.js"(t,e){var r,n,i=N(),a=wn().zorder,o=Dt().hovertemplateAttrs,s=O().extendFlat,l=Ol().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n0?s-4:s;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},t.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,l=0,c=n-i;lc?c:l+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};var e,r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0;e<64;++e)r[e]=a[e],n[a.charCodeAt(e)]=e;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,n){for(var i,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),Ul=d({"node_modules/ieee754/index.js"(t){t.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}}}),Vl=d({"node_modules/buffer/index.js"(t){var e=Nl(),r=Ul(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);const i=function(t){if(o.isBuffer(t)){const e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),a(t<0?0:0|f(t))}function u(t){const e=t.length<0?0:0|f(t.length),r=a(e);for(let n=0;n=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:H(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){let a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=e.length;let o;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function T(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function k(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[i+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(W(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const l=Math.min(a,s),c=this.slice(n,i),u=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function M(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function z(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function D(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,n,i,a){return e=+e,n>>>=0,a||D(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function R(t,e,n,i,a){return e=+e,n>>>=0,a||D(t,0,n,8),r.write(t,e,n,i,52,8),n+8}o.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=$((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=e,i=1,a=this[t+--n];for(;n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=$((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||I(t,4,this.length),r.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),r.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=$((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=$((function(t,e=0){return z(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=0,a=1,o=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=$((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=$((function(t,e=0){return z(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function N(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){U(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||V(e,t.length-(r+1))}(n,i,a)}function U(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){if(Math.floor(t)!==t)throw U(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=B(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(t,e){let r;e=e||1/0;const n=t.length;let i=null;const a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}var X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function $(t){return"undefined"==typeof BigInt?K:t}function K(){throw new Error("BigInt not supported")}}}),ql=d({"node_modules/has-symbols/shams.js"(t,e){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}}}),Hl=d({"node_modules/has-tostringtag/shams.js"(t,e){var r=ql();e.exports=function(){return r()&&!!Symbol.toStringTag}}}),Gl=d({"node_modules/es-errors/index.js"(t,e){e.exports=Error}}),Zl=d({"node_modules/es-errors/eval.js"(t,e){e.exports=EvalError}}),Wl=d({"node_modules/es-errors/range.js"(t,e){e.exports=RangeError}}),Yl=d({"node_modules/es-errors/ref.js"(t,e){e.exports=ReferenceError}}),Xl=d({"node_modules/es-errors/syntax.js"(t,e){e.exports=SyntaxError}}),$l=d({"node_modules/es-errors/type.js"(t,e){e.exports=TypeError}}),Kl=d({"node_modules/es-errors/uri.js"(t,e){e.exports=URIError}}),Jl=d({"node_modules/has-symbols/index.js"(t,e){var r="undefined"!=typeof Symbol&&Symbol,n=ql();e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}}}),Ql=d({"node_modules/has-proto/index.js"(t,e){var r={foo:{}},n=Object;e.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}}),tc=d({"node_modules/function-bind/implementation.js"(t,e){var r=Object.prototype.toString,n=Math.max,i=function(t,e){for(var r=[],n=0;n1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return E(t,L,(function(t,e,r,i){n[n.length]=r?E(i,P,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=z("%"+n+"%",e),a=i.name,o=i.value,c=!1,u=i.alias;u&&(n=u[0],S(r,M([0,1],u)));for(var h=1,p=!0;h=r.length){var y=f(o,d);o=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[d]}else p=A(o,d),o=o[d];p&&!c&&(b[a]=o)}}return o}}}),ic=d({"node_modules/es-define-property/index.js"(t,e){var r=nc()("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(t){r=!1}e.exports=r}}),ac=d({"node_modules/gopd/index.js"(t,e){var r=nc()("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(t){r=null}e.exports=r}}),oc=d({"node_modules/define-data-property/index.js"(t,e){var r=ic(),n=Xl(),i=$l(),a=ac();e.exports=function(t,e,o){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=o}}}}),sc=d({"node_modules/has-property-descriptors/index.js"(t,e){var r=ic(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},e.exports=n}}),lc=d({"node_modules/set-function-length/index.js"(t,e){var r=nc(),n=oc(),i=sc()(),a=ac(),o=$l(),s=r("%Math.floor%");e.exports=function(t,e){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||s(e)!==e)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(t,"length",e,!0,!0):n(t,"length",e)),t}}}),cc=d({"node_modules/call-bind/index.js"(t,e){var r=ec(),n=nc(),i=lc(),a=$l(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=ic(),u=n("%Math.max%");e.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=l(r,s,arguments);return i(e,1+u(0,t.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h}}),uc=d({"node_modules/call-bind/callBound.js"(t,e){var r=nc(),n=cc(),i=n(r("String.prototype.indexOf"));e.exports=function(t,e){var a=r(t,!!e);return"function"==typeof a&&i(t,".prototype.")>-1?n(a):a}}}),hc=d({"node_modules/is-arguments/index.js"(t,e){var r=Hl()(),n=uc()("Object.prototype.toString"),i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=o?i:a}}),fc=d({"node_modules/is-generator-function/index.js"(t,e){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Hl()(),s=Object.getPrototypeOf;e.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(t);if(!s)return!1;if(void 0===r){var e=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&s(e)}return s(t)===r}}}),pc=d({"node_modules/is-callable/index.js"(t,e){var r,n,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(t){t!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(t){try{var e=i.call(t);return s.test(e)}catch(t){return!1}},c=function(t){try{return!l(t)&&(i.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};"object"==typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(p=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})),e.exports=a?function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{a(t,null,r)}catch(t){if(t!==n)return!1}return!l(t)&&c(t)}:function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(h)return c(t);if(l(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&c(t)}}}),dc=d({"node_modules/for-each/index.js"(t,e){var r=pc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(t,e,a){if(!r(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(t)?function(t,e,r){for(var n=0,a=t.length;n-1?e:"Object"===e&&function(t){var e=!1;return r(d,(function(r,n){if(!e)try{r(t),e=h(n,1)}catch(t){}})),e}(t)}return o?function(t){var e=!1;return r(d,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=h(n,1))}catch(t){}})),e}(t):null}}}),yc=d({"node_modules/is-typed-array/index.js"(t,e){var r=dc(),n=mc(),i=uc(),a=i("Object.prototype.toString"),o=Hl()(),s=ac(),l="undefined"==typeof globalThis?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!s&&function(t){var e=!1;return r(f,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}}}),vc=d({"node_modules/util/support/types.js"(t){var e=hc(),r=fc(),n=gc(),i=yc();function a(t){return t.call.bind(t)}var o,s,l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);function d(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===u(t)}function g(t){return"[object Set]"===u(t)}function y(t){return"[object WeakMap]"===u(t)}function v(t){return"[object WeakSet]"===u(t)}function x(t){return"[object ArrayBuffer]"===u(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function b(t){return"[object DataView]"===u(t)}function w(t){return"undefined"!=typeof DataView&&(b.working?b(t):t instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i,t.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||w(t)},t.isUint8Array=function(t){return"Uint8Array"===n(t)},t.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===n(t)},t.isUint16Array=function(t){return"Uint16Array"===n(t)},t.isUint32Array=function(t){return"Uint32Array"===n(t)},t.isInt8Array=function(t){return"Int8Array"===n(t)},t.isInt16Array=function(t){return"Int16Array"===n(t)},t.isInt32Array=function(t){return"Int32Array"===n(t)},t.isFloat32Array=function(t){return"Float32Array"===n(t)},t.isFloat64Array=function(t){return"Float64Array"===n(t)},t.isBigInt64Array=function(t){return"BigInt64Array"===n(t)},t.isBigUint64Array=function(t){return"BigUint64Array"===n(t)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(t){return"undefined"!=typeof Set&&(g.working?g(t):t instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),t.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(y.working?y(t):t instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(t){return v(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,b.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&b(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(t){return"[object SharedArrayBuffer]"===u(t)}function A(t){return void 0!==T&&(void 0===k.working&&(k.working=k(new T)),k.working?k(t):t instanceof T)}function M(t){return d(t,h)}function S(t){return d(t,f)}function E(t){return d(t,p)}function C(t){return l&&d(t,o)}function I(t){return c&&d(t,s)}t.isSharedArrayBuffer=A,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},t.isGeneratorObject=function(t){return"[object Generator]"===u(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},t.isNumberObject=M,t.isStringObject=S,t.isBooleanObject=E,t.isBigIntObject=C,t.isSymbolObject=I,t.isBoxedPrimitive=function(t){return M(t)||S(t)||E(t)||C(t)||I(t)},t.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||A(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))}}),xc=d({"node_modules/util/support/isBufferBrowser.js"(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}}),_c=d({"(disabled):node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}})),l=i[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function c(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return u(r)}var x,T="",k=!1,A=["{","}"];return f(r)&&(k=!0,A=["[","]"]),w(r)&&(T=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(T=" "+RegExp.prototype.toString.call(r)),_(r)&&(T=" "+Date.prototype.toUTCString.call(r)),b(r)&&(T=" "+u(r)),0!==o.length||k&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,T,A)):A[0]+T+A[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=d(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function d(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function b(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=vc(),t.isArray=f,t.isBoolean=p,t.isNull=d,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=_,t.types.isDate=_,t.isError=b,t.types.isNativeError=b,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},t.isBuffer=xc();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(S&&t[S]){var r;if("function"!=typeof(r=t[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:s,value:function(t,e){return o(this,function(t){for(var e=1;e2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,a,o,s;if("string"==typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(i(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r}}),kc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(t,e){var r=Tc().codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}}}),Ac=d({"node_modules/util-deprecate/browser.js"(t,e){function r(t){try{if(!window.localStorage)return!1}catch(t){return!1}var e=window.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}}),Mc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(t,e){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var n;e.exports=T,T.WritableState=w;var i,a={deprecate:Ac()},o=Bl(),s=Vl().Buffer,l=window.Uint8Array||function(){},c=wc(),u=kc().getHighWaterMark,h=Tc().codes,f=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,d=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function b(){}function w(t,e,i){n=n||Sc(),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=u(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new d;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(C,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),C(t,e))}(t,r,n,e,i);else{var a=S(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),n?process.nextTick(A,t,r,a,i):A(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function T(t){var e=this instanceof(n=n||Sc());if(!e&&!i.call(T,this))return new T(t);this._writableState=new w(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function k(t,e,r,n,i,a,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function A(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),C(t,e)}function M(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,a=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,k(t,e,!0,e.length,a,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(k(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),C(t,e)}))}function C(t,e){var r=S(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(E,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}jl()(T,o),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===T&&t&&t._writableState instanceof w}})):i=function(t){return t instanceof this},T.prototype.pipe=function(){_(this,new m)},T.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,o=!i.objectMode&&(n=t,s.isBuffer(n)||n instanceof l);return o&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof e&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ending?function(t,e){var r=new v;_(t,r),process.nextTick(e,r)}(this,r):(o||function(t,e,r,n){var i;return null===r?i=new y:"string"==typeof r||e.objectMode||(i=new f("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,a){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=e.objectMode?1:n.length;e.length+=l;var c=e.length-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new p("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,C(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=c.destroy,T.prototype._undestroy=c.undestroy,T.prototype._destroy=function(t,e){e(t)}}}),Sc=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(t,e){var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=l;var n,i,a,o=zc(),s=Mc();for(jl()(l,o),n=r(s.prototype),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}t.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(t.lastNeed=a-1),a):--n=0?(a>0&&(t.lastNeed=a-2),a):--n=0?(a>0&&(2===a?a=0:t.lastNeed=a-3),a):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}}),Ic=d({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(t,e){var r=Tc().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function t(e,i,a){if("function"==typeof i)return t(e,null,i);i||(i={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i)c.endEmitted?_(t,new x):A(t,c,e,!0);else if(c.ended)_(t,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?A(t,c,e,!1):I(t,c)):A(t,c,e,!1)}else i||(c.reading=!1,I(t,c));return!c.ended&&(c.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(C,t))}function C(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function I(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(L,t,e))}function L(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){n("readable nexttick read 0"),t.read(0)}function D(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function F(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function B(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?F(this):E(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&F(this),null;var i,a=e.needReadable;return n("need readable",a),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&F(this)),null!==i&&this.emit("data",i),i},T.prototype._read=function(t){_(this,new v("_read()"))},T.prototype.pipe=function(t,e){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,e);var o=e&&!1===e.end||t===process.stdout||t===process.stderr?m:l;function s(e,i){n("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),u=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function l(){n("onend"),t.end()}a.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",c);var u=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==B(a.pipes,t))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function f(e){n("onerror",e),m(),t.removeListener("error",f),0===i(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),m()}function d(){n("onfinish"),t.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",f),t.once("close",p),t.once("finish",d),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?E(this):i.reading||process.nextTick(z,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(P,this),r},T.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(P,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(D,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var a in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||(r.objectMode||a&&a.length)&&(e.push(a)||(i=!0,t.pause()))})),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function(e){return function(){return t[e].apply(t,arguments)}}(a));for(var o=0;o0,(function(t){c||(c=t),t&&h.forEach(s),i||(h.forEach(s),u(c))}))}));return e.reduce(l)}}}),Fc=d({"node_modules/stream-browserify/index.js"(t,e){e.exports=n;var r=he().EventEmitter;function n(){r.call(this)}jl()(n,r),n.Readable=zc(),n.Writable=Mc(),n.Duplex=Sc(),n.Transform=Dc(),n.PassThrough=Oc(),n.finished=Ic(),n.pipeline=Rc(),n.Stream=n,n.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(u(),0===r.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",c),t.on("error",c),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}}}),jc=d({"node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}})),l=i[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function c(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return u(r)}var x,T="",k=!1,A=["{","}"];return f(r)&&(k=!0,A=["[","]"]),w(r)&&(T=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(T=" "+RegExp.prototype.toString.call(r)),_(r)&&(T=" "+Date.prototype.toUTCString.call(r)),b(r)&&(T=" "+u(r)),0!==o.length||k&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,T,A)):A[0]+T+A[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=d(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function d(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function b(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=vc(),t.isArray=f,t.isBoolean=p,t.isNull=d,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=_,t.types.isDate=_,t.isError=b,t.types.isNativeError=b,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},t.isBuffer=xc();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(S&&t[S]){var r;if("function"!=typeof(r=t[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,a,o,l;if(void 0===s&&(s=ru()),s("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))l="The ".concat(t," ").concat(i," ").concat(h(e,"type"));else{var c=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";l='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(h(e,"type"))}return l+=". Received type ".concat(r(n))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=jc());var n=l.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(t,e,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r0,"At least one arg needs to be specified");var n="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,i-1).join(", "),n+=", and ".concat(e[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),e.exports.codes=c}}),Nc=d({"node_modules/assert/build/internal/assert/assertion_error.js"(t,e){function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;et.length)&&(r=t.length),t.substring(r-e.length,r)===e}var y="",v="",x="",_="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function T(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function k(t,e,r){var n="",i="",a=0,o="",s=!1,l=T(t),c=l.split("\n"),u=T(e).split("\n"),h=0,f="";if("strictEqual"===r&&"object"===p(t)&&"object"===p(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var d=c[0].length+u[0].length;if(d<=10){if(!("object"===p(t)&&null!==t||"object"===p(e)&&null!==e||0===t&&0===e))return"".concat(b[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&d<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][h]===u[0][h];)h++;h>2&&(f="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",h),"^"),h=0)}}for(var m=c[c.length-1],w=u[u.length-1];m===w&&(h++<2?o="\n ".concat(m).concat(o):n=m,c.pop(),u.pop(),0!==c.length&&0!==u.length);)m=c[c.length-1],w=u[u.length-1];var k=Math.max(c.length,u.length);if(0===k){var A=l.split("\n");if(A.length>30)for(A[26]="".concat(y,"...").concat(_);A.length>27;)A.pop();return"".concat(b.notIdentical,"\n\n").concat(A.join("\n"),"\n")}h>3&&(o="\n".concat(y,"...").concat(_).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var M=0,S=b[r]+"\n".concat(v,"+ actual").concat(_," ").concat(x,"- expected").concat(_),E=" ".concat(y,"...").concat(_," Lines skipped");for(h=0;h1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(_),s=!0):C>3&&(i+="\n ".concat(u[h-2]),M++),i+="\n ".concat(u[h-1]),M++),a=h,n+="\n".concat(x,"-").concat(_," ").concat(u[h]),M++;else if(u.length1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(_),s=!0):C>3&&(i+="\n ".concat(c[h-2]),M++),i+="\n ".concat(c[h-1]),M++),a=h,i+="\n".concat(v,"+").concat(_," ").concat(c[h]),M++;else{var I=u[h],L=c[h],P=L!==I&&(!g(L,",")||L.slice(0,-1)!==I);P&&g(I,",")&&I.slice(0,-1)===L&&(P=!1,L+=","),P?(C>1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(_),s=!0):C>3&&(i+="\n ".concat(c[h-2]),M++),i+="\n ".concat(c[h-1]),M++),a=h,i+="\n".concat(v,"+").concat(_," ").concat(L),n+="\n".concat(x,"-").concat(_," ").concat(I),M+=2):(i+=n,n="",1!==C&&0!==h||(i+="\n ".concat(L),M++))}if(M>20&&h30)for(h[26]="".concat(y,"...").concat(_);h.length>27;)h.pop();e=1===h.length?A.call(this,"".concat(u," ").concat(h[0])):A.call(this,"".concat(u,"\n\n").concat(h.join("\n"),"\n"))}else{var f=T(a),d="",g=b[n];"notDeepEqual"===n||"notEqual"===n?(f="".concat(b[n],"\n\n").concat(f)).length>1024&&(f="".concat(f.slice(0,1021),"...")):(d="".concat(T(l)),f.length>512&&(f="".concat(f.slice(0,509),"...")),d.length>512&&(d="".concat(d.slice(0,509),"...")),"deepEqual"===n||"equal"===n?f="".concat(g,"\n\n").concat(f,"\n\nshould equal\n\n"):d=" ".concat(n," ").concat(d)),e=A.call(this,"".concat(f).concat(d))}return Error.stackTraceLimit=c,e.generatedMessage=!r,Object.defineProperty(s(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=l,e.operator=n,Error.captureStackTrace&&Error.captureStackTrace(s(e),i),e.stack,e.name="AssertionError",o(e)}return l=M,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return d(this,n(n({},e),{},{customInspect:!1,depth:0}))}}])&&i(l.prototype,c),g&&i(l,g),Object.defineProperty(l,"prototype",{writable:!1}),M}(l(Error),d.custom);e.exports=A}}),Uc=d({"node_modules/object-keys/isArguments.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}}}),Vc=d({"node_modules/object-keys/implementation.js"(t,e){var r,n,i,a,o,s,l,c,u,h,f,p;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Uc(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(t){return!1}},r=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),u=e&&"[object String]"===i.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var f=l&&r;if(u&&t.length>0&&!n.call(t,0))for(var d=0;d0)for(var m=0;m2?arguments[2]:{},o=r(e);n&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;st.length)&&(e=t.length);for(var r=0,n=new Array(e);r10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function P(t){return Object.keys(t).filter(L).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function z(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i0)return function(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&!1===isNaN(t))return e.long?s(l=t,a,"day")||s(l,i,"hour")||s(l,n,"minute")||s(l,r,"second")||l+" ms":function(t){return t>=a?Math.round(t/a)+"d":t>=i?Math.round(t/i)+"h":t>=n?Math.round(t/n)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}}),iu=d({"node_modules/stream-parser/node_modules/debug/src/debug.js"(t,e){var r;function n(e){function n(){if(n.enabled){var e=n,i=+new Date,a=i-(r||i);e.diff=a,e.prev=r,e.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(r())}}),ou=d({"node_modules/stream-parser/index.js"(t,e){var r=ru(),n=au()("stream-parser");function i(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function a(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||i(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function s(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function l(t,e,r){this._parserInit||i(this),n("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function c(t,e,r){this._parserInit||i(this),n("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function u(t,e,r,i){if(t._parserBytesLeft-=e.length,n("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return i;var a=t._parserCallback;if(a&&0===t._parserState&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),a){var o=[];e&&o.push(e),r&&o.push(r);var s=a.length>o.length;s&&o.push(f(i));var l=a.apply(t,o);if(!s||i===l)return i}}e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),t._bytes=a,t._skipBytes=o,e&&(t._passthrough=s),e?t._transform=c:t._write=l};var h=f((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return u(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return u(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function f(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}}),su=d({"node_modules/probe-image-size/lib/common.js"(t){var e=Fc().Transform,r=ou();function n(){e.call(this,{readableObjectMode:!0})}function i(t,e,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=t,e&&(this.code=e),r&&(this.statusCode=r)}n.prototype=Object.create(e.prototype),n.prototype.constructor=n,r(n.prototype),t.ParserStream=n,t.sliceEq=function(t,e,r){for(var n=e,i=0;i>4&15,i=15&t[4],a=t[5]>>4&15,s=r(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),a=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),u=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(u=0===t.value?r[u]:e[u=e[u=r[u]]]),"irot"===t.type)for(var n=0;n0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},i.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},i.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},i.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},i.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));default:return null}},i.prototype.scan_ifd=function(t,e,i){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw r("unexpected EOF","EBADDATA");for(var d=[],m=f,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:h,data_offset:f+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=i,e.exports.get_orientation=function(t){var e=0;try{return new i(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}}}),uu=d({"node_modules/probe-image-size/lib/parse_sync/avif.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=lu(),o=cu(),s=r("ftyp");e.exports=function(t){if(n(t,4,s)){var e=a.unbox(t,0);if(e){var r=a.getMimeType(e.data);if(r){for(var l,c=e.end;;){var u=a.unbox(t,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var f={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(f.variants=h.variants),h.orientation&&(f.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=t.length){var p=i(t,h.exif_location.offset),d=t.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(d);m>0&&(f.orientation=m)}return f}}}}}}}}),hu=d({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("BM");e.exports=function(t){if(!(t.length<26)&&n(t,0,a))return{width:i(t,18),height:i(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),fu=d({"node_modules/probe-image-size/lib/parse_sync/gif.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");e.exports=function(t){if(!(t.length<10)&&(n(t,0,a)||n(t,0,o)))return{width:i(t,6),height:i(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),pu=d({"node_modules/probe-image-size/lib/parse_sync/ico.js"(t,e){var r=su().readUInt16LE;e.exports=function(t){var e=r(t,0),n=r(t,2),i=r(t,4);if(0===e&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),du=d({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(t,e){var r=su().readUInt16BE,n=su().str2arr,i=su().sliceEq,a=cu(),o=n("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var n,s,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)n=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;n=r(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&n>=10&&i(t,e,o)&&(s=a.get_orientation(t.slice(e+6,e+n))),n>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=s),c}e+=n}}}}),mu=d({"node_modules/probe-image-size/lib/parse_sync/png.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("‰PNG\r\n\n"),o=r("IHDR");e.exports=function(t){if(!(t.length<24)&&n(t,0,a)&&n(t,12,o))return{width:i(t,16),height:i(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gu=d({"node_modules/probe-image-size/lib/parse_sync/psd.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("8BPS\0");e.exports=function(t){if(!(t.length<22)&&n(t,0,a))return{width:i(t,18),height:i(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),yu=d({"node_modules/probe-image-size/lib/parse_sync/svg.js"(t,e){function r(t){return"number"==typeof t&&isFinite(t)&&t>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(t){return l.test(t)?t.match(l)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||c(t,e+8):"VP8L"===p&&d>=9?r=r||u(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(i=o.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return i>0&&(r.orientation=i),r}}}}}),_u=d({"node_modules/probe-image-size/lib/parsers_sync.js"(t,e){e.exports={avif:uu(),bmp:hu(),gif:fu(),ico:pu(),jpeg:du(),png:mu(),psd:gu(),svg:yu(),tiff:vu(),webp:xu()}}}),bu=d({"node_modules/probe-image-size/sync.js"(t,e){var r=_u();e.exports=function(t){return function(t){for(var e=Object.keys(r),n=0;n0;)g=h.c2p(w+_*M),_--;for(_=0;void 0===v&&_0;)x=f.c2p(T+_*S),_--;gz[0];if(D||O){var R=m+E/2,F=v+C/2;L+="transform:"+i(R+"px",F+"px")+"scale("+(D?-1:1)+","+(O?-1:1)+")"+i(-R+"px",-F+"px")+";"}}I.attr("style",L);var j=new Promise((function(t){if(u._hasZ)t();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===k&&u._canvas.el.height===A&&u._canvas.source===u.source)t();else{var e=document.createElement("canvas");e.width=k,e.height=A;var r=e.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:e,source:u.source},t()},n.setAttribute("src",u.source)}})).then((function(){var t;if(u._hasZ)t=B((function(t,e){var r=b[e][t];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(d)t=u.source;else{var e=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,k,A).data;t=B((function(t,r){var n=4*(r*k+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}I.attr({"xlink:href":t,height:C,width:E,x:m,y:v})}));t._promises.push(j)}function B(t){var e=document.createElement("canvas");e.width=E,e.height=C;var r,i=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return n.constrain(Math.round(h.c2p(w+t*M)-m),0,E)},s=function(t){return n.constrain(Math.round(f.c2p(T+t*S)-v),0,C)},l=o.colormodel[u.colormodel],p=l.colormodel||u.colormodel,d=l.fmt;for(_=0;_0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,f=Math.floor((e-s.x0)/l.dx),p=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[p][f]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),h){var d,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(d=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,_=x.length,b=l._scaler(h),w=v.suffix,T=[];(l.hovertemplate||d)&&(T.push("["+[b[0]+w[0],b[1]+w[1],b[2]+w[2]].join(", ")),4===_&&T.push(", "+b[3]+w[3]),T.push("]"),T=T.join(""),t.extraText=x.toUpperCase()+": "+T),i(l.hovertext)&&i(l.hovertext[p])?y=l.hovertext[p][f]:i(l.text)&&i(l.text[p])&&(y=l.text[p][f]);var k=u.c2p(s.y0+(p+.5)*l.dy),A=s.x0+(f+.5)*l.dx,M=s.y0+(p+.5)*l.dy,S="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(t,{index:[p,f],x0:c.c2p(s.x0+f*l.dx),x1:c.c2p(s.x0+(f+1)*l.dx),y0:k,y1:k,color:b,xVal:A,xLabelVal:A,yVal:M,yLabelVal:M,zLabelVal:S,text:y,hovertemplateLabels:{zLabel:S,colorLabel:T,"color[0]Label":b[0]+w[0],"color[1]Label":b[1]+w[1],"color[2]Label":b[2]+w[2],"color[3]Label":b[3]+w[3]}})]}}}}}),Su=d({"src/traces/image/event_data.js"(t,e){e.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}}}),Eu=d({"src/traces/image/index.js"(t,e){e.exports={attributes:Rl(),supplyDefaults:Fl(),calc:Tu(),plot:ku(),style:Au(),hoverPoints:Mu(),eventData:Su(),moduleType:"trace",name:"image",basePlotModule:Mi(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Cu=d({"lib/image.js"(t,e){e.exports=Eu()}}),Iu=d({"src/traces/pie/attributes.js"(t,e){var r=N(),n=Ta().attributes,i=R(),a=V(),o=Dt().hovertemplateAttrs,s=Dt().texttemplateAttrs,l=O().extendFlat,c=Pt().pattern,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Lu=d({"src/traces/pie/defaults.js"(t,e){var r=T(),n=se(),i=Iu(),a=Ta().defaults,o=Wa().handleText,s=se().coercePattern;function l(t,e){var i=n.isArrayOrTypedArray(t),a=n.isArrayOrTypedArray(e),o=Math.min(i?t.length:1/0,a?e.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(t,e,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(t,e,r,s){function u(r,a){return n.coerce(t,e,i,r,a)}var h=l(u("labels"),u("values")),f=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),f){e._length=f,c(t,e,s,u,!0),u("scalegroup");var p,d=u("text"),m=u("texttemplate");if(m||(p=u("textinfo",n.isArrayOrTypedArray(d)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||p&&"none"!==p){var g=u("textposition");o(t,e,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===p&&u("textposition","none");a(e,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");y||"middle center"!==v||(e.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else e.visible=!1}}}}),Pu=d({"src/traces/pie/layout_attributes.js"(t,e){e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),zu=d({"src/traces/pie/layout_defaults.js"(t,e){var r=se(),n=Pu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("piecolorway",e.colorway),i("extendpiecolors")}}}),Du=d({"src/traces/pie/calc.js"(t,e){var r=T(),n=D(),i=q(),a={};function o(t){return function(e,r){return!!e&&!!(e=n(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function s(t,e){var r,i=JSON.stringify(t),a=e[i];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?y:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u"),name:h.hovertemplate||-1!==f.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:m.castOption(b.bgcolor,t.pts)||t.color,borderColor:m.castOption(b.bordercolor,t.pts),fontFamily:m.castOption(w.family,t.pts),fontSize:m.castOption(w.size,t.pts),fontColor:m.castOption(w.color,t.pts),nameLength:m.castOption(b.namelength,t.pts),textAlign:m.castOption(b.align,t.pts),hovertemplate:m.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,h)],event:r.event})}})),t.on("mouseout",(function(t){var n=e._fullLayout,a=e._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(t.originalEvent=r.event,e.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var n=e._fullLayout,a=e._fullData[c.index];e._dragging||!1===n.hovermode||(e._hoverdata=[g(t,a)],i.click(e,r.event))}))}function _(t,e,r){var n=m.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=m.castOption(t._input.textfont.color,e.pts));var i=m.castOption(t.insidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,o=m.castOption(t.insidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,s=m.castOption(t.insidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,l=m.castOption(t.insidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,c=m.castOption(t.insidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,u=m.castOption(t.insidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,h=m.castOption(t.insidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,f=m.castOption(t.insidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n||a.contrast(e.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:f}}function b(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||p){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||h){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||f)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,_=0,b=0;b=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:A(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:A(a,o/e),rotate:M(i+Math.PI/2)}}function A(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function C(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function I(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),h=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(h+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?h*=2:-1!==a.title.position.indexOf("right")&&(h+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=h/t.titleBox.width,n=L(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function P(t){var e,r=t.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function z(t,e){for(var r=[],n=0;n1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(o){var _=s.castOption(a,e.i,"texttemplate");if(_){var b={label:(n=e).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,e.pts);(y(w)||""===w)&&(b.text=w),e.text=s.texttemplateString(_,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var i=t._context.staticPlot,h=t._fullLayout,d=h._size;p("pie",h),b(e,t),z(e,d);var g=s.makeTraceGroups(h._pielayer,e,"trace").each((function(e){var p=r.select(this),g=e[0],y=g.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),p.attr("stroke-linejoin","round"),p.each((function(){var v=r.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var b=[[[],[]],[[],[]]],T=!1;v.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,b[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,p=r.select(this),d=p.selectAll("path.surface").data([n]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),p.call(x,t,e),y.pull){var v=+m.castOption(y.pull,n.pts)||0;v>0&&(l+=v*n.pxmid[0],c+=v*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var k=y.hole;if(n.v===g.vTotal){var A="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";k?d.attr("d","M"+(l+k*n.px0[0])+","+(c+k*n.px0[1])+L(n.px0,n.pxmid,!1,k)+L(n.pxmid,n.px0,!1,k)+"Z"+A):d.attr("d",A)}else{var M=L(n.px0,n.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(l+k*n.px1[0])+","+(c+k*n.px1[1])+L(n.px1,n.px0,!1,k)+"l"+S*n.px0[0]+","+S*n.px0[1]+M+"Z")}else d.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+M+"Z")}O(t,n,g);var E=m.castOption(y.textposition,n.pts),I=p.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=s.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,i=m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,a=m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,o=m.castOption(t.outsidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,s=m.castOption(t.outsidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,l=m.castOption(t.outsidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,c=m.castOption(t.outsidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,u=m.castOption(t.outsidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,h=m.castOption(t.outsidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:c,lineposition:u,shadow:h}}(y,n,h.font):_(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,p).call(u.convertToTspans,t);var d,v=o.bBox(i.node());if("outside"===E)d=C(v,n);else if(d=w(v,n,g),"auto"===E&&d.scale<1){var x=s.ensureUniformFontSize(t,y.outsidetextfont);i.call(o.font,x),d=C(v=o.bBox(i.node()),n)}var b=d.textPosAngle,k=void 0===b?n.pxmid:D(g.r,b);if(d.targetX=l+k[0]*d.rCenter+(d.x||0),d.targetY=c+k[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var A=d.targetY;n.yLabelMin=A-v.height/2,n.yLabelMid=A,n.yLabelMax=A+v.height/2,n.labelExtraX=0,n.labelExtraY=0,T=!0}d.fontSize=p.size,f(y.type,d,h),e[a].transform=d,s.setTransormAndDisplay(i,d)}))}function L(t,e,r,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var e,n=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(g):I(g,d),n.attr("transform",c(e.x,e.y)+l(Math.min(1,e.scale))+c(e.tx,e.ty))})),T&&function(t,e){var r,n,i,a,o,l,c,u,h,f,p,d,g;function y(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function x(t,r){r||(r={});var i,u,h,p,d=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),x=d-g;if(x*c>0&&(t.labelExtraY=x),s.isArrayOrTypedArray(e.pull))for(u=0;u=(m.castOption(e.pull,h.pts)||0)||((t.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-t.labelExtraY)*c>0&&(t.labelExtraY+=x):(y+t.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-f.indexOf(t)),(p=h.cxFinal+a(h.px0[0],h.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(i),h=t[1-n][r],f=h.concat(u),d=[],p=0;pMath.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(v,y),T&&y.automargin){var A=o.bBox(p.node()),M=y.domain,S=d.w*(M.x[1]-M.x[0]),E=d.h*(M.y[1]-M.y[0]),L=(.5*S-g.r)/d.w,P=(.5*E-g.r)/d.h;n.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-L,xr:M.x[1]+L,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(g.cx-g.r-A.left,0),r:Math.max(A.right-(g.cx+g.r),0),b:Math.max(A.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-A.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:O,transformInsideText:w,determineInsideTextFont:_,positionTitleOutside:I,prerenderTitles:b,layoutAreas:z,attachFxHandlers:x,computeTransform:R}}}),Fu=d({"src/traces/pie/style.js"(t,e){var r=v(),n=wr(),i=Ka().resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),ju=d({"src/traces/pie/base_plot.js"(t){var e=Te();t.name="pie",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Bu=d({"src/traces/pie/index.js"(t,e){e.exports={attributes:Iu(),supplyDefaults:Lu().supplyDefaults,supplyLayoutDefaults:zu(),layoutAttributes:Pu(),calc:Du().calc,crossTraceCalc:Du().crossTraceCalc,plot:Ru().plot,style:Fu(),styleOne:wr(),moduleType:"trace",name:"pie",basePlotModule:ju(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Nu=d({"lib/pie.js"(t,e){e.exports=Bu()}}),Uu=d({"src/traces/sunburst/base_plot.js"(t){var e=Te();t.name="sunburst",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Vu=d({"src/traces/sunburst/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),qu=d({"src/traces/sunburst/attributes.js"(t,e){var r=N(),n=Dt().hovertemplateAttrs,i=Dt().texttemplateAttrs,a=Le(),o=Ta().attributes,s=Iu(),l=Vu(),c=O().extendFlat,u=Pt().pattern;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}}),Hu=d({"src/traces/sunburst/layout_attributes.js"(t,e){e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Gu=d({"src/traces/sunburst/defaults.js"(t,e){var r=se(),n=qu(),i=Ta().defaults,a=Wa().handleText,o=Lu().handleMarkerDefaults,s=Ze(),l=s.hasColorscale,c=s.handleDefaults;e.exports=function(t,e,s,u){function h(i,a){return r.coerce(t,e,n,i,a)}var f=h("labels"),p=h("parents");if(f&&f.length&&p&&p.length){var d=h("values");d&&d.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(t,e,u,h);var m=e._hasColorscale=l(t,"marker","colors")||(t.marker||{}).coloraxis;m&&c(t,e,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(t,e,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(e,u,h),e._length=null}else e.visible=!1}}}),Zu=d({"src/traces/sunburst/layout_defaults.js"(t,e){var r=se(),n=Hu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("sunburstcolorway",e.colorway),i("extendsunburstcolors")}}}),Wu=d({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(t,e){var r;r=function(t){function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),h=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=o);r=f.pop();)if(h&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)f.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function _(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function b(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sf&&(f=s),g=u*u*m,(p=Math.max(f/g,g/h))>d){u-=s;break}d=p}y.push(o={value:u,dice:l1?e:1)},r}(H),W=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,f=o.length,p=t.value;++h1?e:1)},r}(H);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,f=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-h)/(f-h)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=A;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(E(t)).eachAfter(C(n,.5)).eachBefore(I(1)):i.eachBefore(E(S)).eachAfter(C(A,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(I(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(r=e)?null:k(r),i):t;var r},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:M(+t),i):n},i},t.packEnclose=h,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&P(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=k(e),r):t},r.parentId=function(t){return arguments.length?(e=k(t),r):e},r},t.tree=function(){var t=F,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new V(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new V(n[i],i)),r.parent=e;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>h.depth&&(h=t)}));var f=c===u?1:t(c,u)/2,p=f-c.x,d=e/(u.x+f+p),m=r/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=B(s),a=j(a),s&&a;)l=j(l),(o=B(o)).a=e,(i=s.z+h-a.z-c+t(s._,a._))>0&&(N(U(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!B(o)&&(o.t=s,o.m+=h-u),a&&!j(l)&&(l.t=a,l.m+=c-f,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=Z,e=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,c=A;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),i=[0],e&&t.eachBefore(L),t}function h(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,h=e.x1-r,f=e.y1-r;h=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[e],f=n/2+h,p=e+1,d=r-1;p>>1;c[m]l-a){var v=(i*y+o*g)/n;t(e,p,g,i,a,v,l),t(p,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,y,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=P,t.treemapResquarify=W,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:P)(t,e,r,n,i)},t.treemapSquarify=Z,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),Yu=d({"src/traces/sunburst/calc.js"(t){var e=Wu(),r=T(),n=se(),i=Ze().makeColorScaleFuncFromTrace,a=Du().makePullColorFn,o=Du().generateExtendedColors,s=Ze().calc,l=k().ALMOST_EQUAL,c={},u={},h={};function f(t,e,r){var n=0,i=t.children;if(i){for(var a=i.length,o=0;o=0};v?(c=Math.min(y.length,_.length),u=function(t){return M(y[t])&&S(t)},h=function(t){return String(y[t])}):(c=Math.min(x.length,_.length),u=function(t){return M(x[t])&&S(t)},h=function(t){return String(x[t])}),w&&(c=Math.min(c,b.length));for(var E=0;E1){for(var P=n.randstr(),z=0;z>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?vh(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?vh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=nh.exec(t))?new bh(e[1],e[2],e[3],1):(e=ih.exec(t))?new bh(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ah.exec(t))?vh(e[1],e[2],e[3],e[4]):(e=oh.exec(t))?vh(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sh.exec(t))?Eh(e[1],e[2]/100,e[3]/100,1):(e=lh.exec(t))?Eh(e[1],e[2]/100,e[3]/100,e[4]):ch.hasOwnProperty(t)?yh(ch[t]):"transparent"===t?new bh(NaN,NaN,NaN,0):null}function yh(t){return new bh(t>>16&255,t>>8&255,255&t,1)}function vh(t,e,r,n){return n<=0&&(t=e=r=NaN),new bh(t,e,r,n)}function xh(t){return t instanceof hh||(t=gh(t)),t?new bh((t=t.rgb()).r,t.g,t.b,t.opacity):new bh}function _h(t,e,r,n){return 1===arguments.length?xh(t):new bh(t,e,r,null==n?1:n)}function bh(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function wh(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}`}function Th(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}${Sh(255*(isNaN(this.opacity)?1:this.opacity))}`}function kh(){const t=Ah(this.opacity);return`${1===t?"rgb(":"rgba("}${Mh(this.r)}, ${Mh(this.g)}, ${Mh(this.b)}${1===t?")":`, ${t})`}`}function Ah(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Mh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Sh(t){return((t=Mh(t))<16?"0":"")+t.toString(16)}function Eh(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Lh(t,e,r,n)}function Ch(t){if(t instanceof Lh)return new Lh(t.h,t.s,t.l,t.opacity);if(t instanceof hh||(t=gh(t)),!t)return new Lh;if(t instanceof Lh)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(r-n)/s+6*(r0&&l<1?0:o,new Lh(o,s,l,t.opacity)}function Ih(t,e,r,n){return 1===arguments.length?Ch(t):new Lh(t,e,r,null==n?1:n)}function Lh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Ph(t){return(t=(t||0)%360)<0?t+360:t}function zh(t){return Math.max(0,Math.min(1,t||0))}function Dh(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}var Oh,Rh,Fh,jh,Bh,Nh,Uh,Vh,qh,Hh=p({"node_modules/d3-color/src/color.js"(){uh(),Ju=1/(Ku=.7),Qu="\\s*([+-]?\\d+)\\s*",th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,nh=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),ih=new RegExp(`^rgb\\(${eh},${eh},${eh}\\)$`),ah=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${th}\\)$`),oh=new RegExp(`^rgba\\(${eh},${eh},${eh},${th}\\)$`),sh=new RegExp(`^hsl\\(${th},${eh},${eh}\\)$`),lh=new RegExp(`^hsla\\(${th},${eh},${eh},${th}\\)$`),ch={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Xu(hh,gh,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fh,formatHex:fh,formatHex8:ph,formatHsl:dh,formatRgb:mh,toString:mh}),Xu(bh,_h,$u(hh,{brighter(t){return t=null==t?Ju:Math.pow(Ju,t),new bh(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ku:Math.pow(Ku,t),new bh(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new bh(Mh(this.r),Mh(this.g),Mh(this.b),Ah(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wh,formatHex:wh,formatHex8:Th,formatRgb:kh,toString:kh})),Xu(Lh,Ih,$u(hh,{brighter(t){return t=null==t?Ju:Math.pow(Ju,t),new Lh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ku:Math.pow(Ku,t),new Lh(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new bh(Dh(t>=240?t-240:t+120,i,n),Dh(t,i,n),Dh(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Lh(Ph(this.h),zh(this.s),zh(this.l),Ah(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ah(this.opacity);return`${1===t?"hsl(":"hsla("}${Ph(this.h)}, ${100*zh(this.s)}%, ${100*zh(this.l)}%${1===t?")":`, ${t})`}`}}))}}),Gh=p({"node_modules/d3-color/src/math.js"(){Oh=Math.PI/180,Rh=180/Math.PI}});function Zh(t){if(t instanceof Yh)return new Yh(t.l,t.a,t.b,t.opacity);if(t instanceof tf)return ef(t);t instanceof bh||(t=xh(t));var e,r,n=Jh(t.r),i=Jh(t.g),a=Jh(t.b),o=Xh((.2225045*n+.7168786*i+.0606169*a)/jh);return n===i&&i===a?e=r=o:(e=Xh((.4360747*n+.3850649*i+.1430804*a)/Fh),r=Xh((.0139322*n+.0971045*i+.7141733*a)/Bh)),new Yh(116*o-16,500*(e-o),200*(o-r),t.opacity)}function Wh(t,e,r,n){return 1===arguments.length?Zh(t):new Yh(t,e,r,null==n?1:n)}function Yh(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Xh(t){return t>qh?Math.pow(t,1/3):t/Vh+Nh}function $h(t){return t>Uh?t*t*t:Vh*(t-Nh)}function Kh(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Jh(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qh(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof tf)return new tf(t.h,t.c,t.l,t.opacity);if(t instanceof Yh||(t=Zh(t)),0===t.a&&0===t.b)return new tf(NaN,0=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=n()=>t}});function Tf(t,e){return function(r){return t+r*e}}function kf(t,e){var r=e-t;return r?Tf(t,r>180||r<-180?r-360*Math.round(r/360):r):_f(isNaN(t)?e:t)}function Af(t){return 1==(t=+t)?Mf:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):_f(isNaN(e)?r:e)}}function Mf(t,e){var r=e-t;return r?Tf(t,r):_f(isNaN(t)?e:t)}var Sf,Ef,Cf,If=p({"node_modules/d3-interpolate/src/color.js"(){wf()}});function Lf(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;ra&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Uf(r,n)})),a=Gf.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:Uf(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:Uf(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Uf(t,r)},{i:s-2,x:Uf(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(Rp,{interpolate:()=>Xf,interpolateArray:()=>Rf,interpolateBasis:()=>yf,interpolateBasisClosed:()=>xf,interpolateCubehelix:()=>Sp,interpolateCubehelixLong:()=>Ep,interpolateDate:()=>Bf,interpolateDiscrete:()=>Kf,interpolateHcl:()=>Tp,interpolateHclLong:()=>kp,interpolateHsl:()=>yp,interpolateHslLong:()=>vp,interpolateHue:()=>Qf,interpolateLab:()=>wp,interpolateNumber:()=>Uf,interpolateNumberArray:()=>zf,interpolateObject:()=>qf,interpolateRgb:()=>Sf,interpolateRgbBasis:()=>Ef,interpolateRgbBasisClosed:()=>Cf,interpolateRound:()=>ep,interpolateString:()=>Wf,interpolateTransformCss:()=>up,interpolateTransformSvg:()=>hp,interpolateZoom:()=>dp,piecewise:()=>Pp,quantize:()=>Dp});var Fp=p({"node_modules/d3-interpolate/src/index.js"(){$f(),jf(),vf(),bf(),Nf(),Jf(),tp(),Vf(),Of(),Zf(),ip(),Yf(),mp(),xp(),Pf(),bp(),Ap(),Cp(),Lp(),zp(),Op()}}),jp=d({"src/traces/sunburst/fill_one.js"(t,e){var r=Je(),n=q();e.exports=function(t,e,i,a,o){var s=e.data.data,l=s.i,c=o||s.color;if(l>=0){e.i=s.i;var u=i.marker;u.pattern&&u.colors&&u.pattern.shape||(u.color=c,e.color=c),r.pointStyle(t,i,a,e)}else n.fill(t,c)}}}),Bp=d({"src/traces/sunburst/style.js"(t,e){var r=v(),n=q(),i=se(),a=Ka().resizeText,o=jp();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");a(t,e,"sunburst"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),Np=d({"src/traces/sunburst/helpers.js"(t){var e=se(),r=q(),n=fr(),i=_r();function a(t){return t.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,a(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(t,r){var n=e.formatPercent(t,0);return"0%"===n&&(n=i.formatPiePercent(t,r)),n}}}),Up=d({"src/traces/sunburst/fx.js"(t,e){var r=v(),n=Vt(),i=Xe().appendArrayPointValue,a=zr(),o=se(),s=fe(),l=Np(),c=_r().formatPieValue;function u(t,e,r){for(var n=t.data.data,a={curveNumber:e.index,pointNumber:n.i,data:e._input,fullData:e},o=0;o"),name:A||D("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),fontWeight:k("hoverlabel.font.weight"),fontStyle:k("hoverlabel.font.style"),fontVariant:k("hoverlabel.font.variant"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:L,eventData:h};g&&(F.x0=E-n.rInscribed*n.rpx1,F.x1=E+n.rInscribed*n.rpx1,F.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(F.x=E,F.idealAlign=E<0?"left":"right");var j=[];a.loneHover(F,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:j}),h[0].bbox=j[0],d._hasHoverLabel=!0}if(y){var B=t.select("path.surface");f.styleOne(B,n,v,i,{hovered:!0})}d._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,f.eventDataKeys)],event:r.event})}})),t.on("mouseout",(function(e){var n=i._fullLayout,o=i._fullData[d.index],s=r.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,f.eventDataKeys)],event:r.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");f.styleOne(l,s,o,i,{hovered:!1})}})),t.on("click",(function(t){var e=i._fullLayout,o=i._fullData[d.index],c=g&&(l.isHierarchyRoot(t)||l.isLeaf(t)),h=l.getPtId(t),p=l.isEntry(t)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(p),v={points:[u(t,o,f.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+d.type+"click",v);if(!1!==x&&e.hovermode&&(i._hoverdata=[u(t,o,f.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,e._tracePreGUI[o.uid],{level:o.level});var _={data:[{level:y}],traces:[d.index]},b={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(e._hoverlayer.node()),n.call("animate",i,_,b)}}))}}}),Vp=d({"src/traces/sunburst/plot.js"(t){var e=v(),r=Wu(),n=(Fp(),m(Rp)).interpolate,i=Je(),a=se(),o=Me(),s=Ka(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=Ru(),h=_r().getRotationAngle,f=u.computeTransform,p=u.transformInsideText,d=Bp().styleOne,g=Qa().resizeText,y=Up(),x=Vu(),_=Np();function b(s,c,u,m){var g=s._context.staticPlot,v=s._fullLayout,b=!v.uniformtext.mode&&_.hasTransition(m),T=e.select(u).selectAll("g.slice"),k=c[0],A=k.trace,M=k.hierarchy,S=_.findEntryWithLevel(M,A.level),E=_.getMaxDepth(A),C=v._size,I=A.domain,L=C.w*(I.x[1]-I.x[0]),P=C.h*(I.y[1]-I.y[0]),z=.5*Math.min(L,P),D=k.cx=C.l+C.w*(I.x[1]+I.x[0])/2,O=k.cy=C.t+C.h*(1-I.y[0])-P/2;if(!S)return T.remove();var R=null,F={};b&&T.each((function(t){F[_.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&_.isEntry(t)&&(R=t)}));var j=function(t){return r.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),B=S.height+1,N=0,U=E;k.hasMultipleRoots&&_.isHierarchyRoot(S)&&(j=j.slice(1),B-=1,N=1,U+=1),j=j.filter((function(t){return t.y1<=U}));var V=h(A.rotation);V&&j.forEach((function(t){t.x0+=V,t.x1+=V}));var q=Math.min(B,E),H=function(t){return(t-N)/q*z},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},Z=function(t){return a.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,O)},W=function(t){return D+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Y=function(t){return O+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(j,_.getPtId)).enter().append("g").classed("slice",!0),b?T.exit().transition().each((function(){var t=e.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=_.getPtId(t),i=F[r],a=F[_.getPtId(S)];if(a){var o=(t.x1>a.x1?2*Math.PI:0)+V;e=t.rpx1X?2*Math.PI:0)+V;e={x0:o,x1:o}}else e={rpx0:z,rpx1:z},a.extendFlat(e,J(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return n(e,i)}(t);return function(t){return Z(e(t))}})):h.attr("d",Z),u.call(y,S,s,c,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(_.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(d,r,A,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),T=a.ensureUniformFontSize(s,_.determineTextFont(A,r,v.font));w.text(t.formatSliceLabel(r,S,A,c,v)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(o.convertToTspans,s);var M=i.bBox(w.node());r.transform=p(M,r,k),r.transform.targetX=W(r),r.transform.targetY=Y(r);var E=function(t,e){var r=t.transform;return f(r,e),r.fontSize=T.size,l(A.type,r,v),a.getTextTransform(r)};b?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[_.getPtId(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},R)if(t.parent)if(X){var o=t.x1>X?2*Math.PI:0;e.x0=e.x1=o}else a.extendFlat(e,J(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var s=n(e.transform.textPosAngle,t.transform.textPosAngle),c=n(e.rpx1,t.rpx1),u=n(e.x0,t.x0),h=n(e.x1,t.x1),f=n(e.transform.scale,i.scale),p=n(e.transform.rotate,i.rotate),d=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,m=n(e.transform.rCenter,i.rCenter),g=function(t){return m(Math.pow(t,d))};return function(t){var e=c(t),r=u(t),n=h(t),a=g(t),o={pxmid:G(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:a,x:i.x,y:i.y}};return l(A.type,i,v),{transform:{targetX:W(o),targetY:Y(o),scale:f(t),rotate:p(t),rCenter:a}}}}(t);return function(t){return E(e(t),M)}})):w.attr("transform",E(r,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}t.plot=function(t,r,n,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&_.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),e.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){b(t,e,this,n)}))}))):(a.each((function(e){b(t,e,this,n)})),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},t.formatSliceLabel=function(t,e,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!(o||s&&"none"!==s))return"";var l=i.separators,c=n[0],u=t.data.data,h=c.hierarchy,f=_.isHierarchyRoot(t),p=_.getParent(h,t),d=_.getValue(t);if(!o){var m,g=s.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(_.formatValue(u.v,l)),!f){y("current path")&&v.push(_.getPath(t.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var b=x>1;if(x){var w,T=function(t){m=_.formatPercent(w,l),b&&(m+=" of "+t),v.push(m)};y("percent parent")&&!f&&(w=d/_.getValue(p),T("parent")),y("percent entry")&&(w=d/_.getValue(e),T("entry")),y("percent root")&&(w=d/_.getValue(h),T("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("
")}var k=a.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=_.formatValue(u.v,l)),A.currentPath=_.getPath(t.data),f||(A.percentParent=d/_.getValue(p),A.percentParentLabel=_.formatPercent(A.percentParent,l),A.parent=_.getPtLabel(p)),A.percentEntry=d/_.getValue(e),A.percentEntryLabel=_.formatPercent(A.percentEntry,l),A.entry=_.getPtLabel(e),A.percentRoot=d/_.getValue(h),A.percentRootLabel=_.formatPercent(A.percentRoot,l),A.root=_.getPtLabel(h),u.hasOwnProperty("color")&&(A.color=u.color);var M=a.castOption(r,u.i,"text");return(a.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(k,A,i._d3locale,A,r._meta||{})}}}),qp=d({"src/traces/sunburst/index.js"(t,e){e.exports={moduleType:"trace",name:"sunburst",basePlotModule:Uu(),categories:[],animatable:!0,attributes:qu(),layoutAttributes:Hu(),supplyDefaults:Gu(),supplyLayoutDefaults:Zu(),calc:Yu().calc,crossTraceCalc:Yu().crossTraceCalc,plot:Vp().plot,style:Bp().style,colorbar:fi(),meta:{}}}}),Hp=d({"lib/sunburst.js"(t,e){e.exports=qp()}}),Gp=d({"src/traces/treemap/base_plot.js"(t){var e=Te();t.name="treemap",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Zp=d({"src/traces/treemap/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),Wp=d({"src/traces/treemap/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=Le(),a=Ta().attributes,o=Iu(),s=qu(),l=Zp(),c=O().extendFlat,u=Pt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:s.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:c({},o.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}}),Yp=d({"src/traces/treemap/layout_attributes.js"(t,e){e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Xp=d({"src/traces/treemap/defaults.js"(t,e){var r=se(),n=Wp(),i=q(),a=Ta().defaults,o=Wa().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,f,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var x=-1!==e.textposition.indexOf("bottom");l(t,e,f,p),(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?h(t,e,f,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(e.marker.colors||[]).length);var _=2*e.textfont.size;p("marker.pad.t",x?_/4:_),p("marker.pad.l",_/4),p("marker.pad.r",_/4),p("marker.pad.b",x?_:_/4),p("marker.cornerradius"),e._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,f,p),e._length=null}else e.visible=!1}}}),$p=d({"src/traces/treemap/layout_defaults.js"(t,e){var r=se(),n=Yp();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("treemapcolorway",e.colorway),i("extendtreemapcolors")}}}),Kp=d({"src/traces/treemap/calc.js"(t){var e=Yu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("treemap",t)}}}),Jp=d({"src/traces/treemap/flip_tree.js"(t,e){e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o0)for(var b=0;b").join(" ")||"";var m=n.ensureSingle(p,"g","slicetext"),k=n.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),I=n.ensureUniformFontSize(t,c.determineTextFont(L,o,C.font,{onPathbar:!0}));k.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,I).call(a.convertToTspans,t),o.textBB=i.bBox(k.node()),o.transform=b(o,{fontSize:I.size,onPathbar:!0}),o.transform.fontSize=I.size,T?k.transition().attrTween("transform",(function(t){var e=M(t,h,S,[g,y]);return function(t){return w(e(t))}})):k.attr("transform",w(o))}))}}}),rd=d({"src/traces/treemap/plot_one.js"(t,e){var r=v(),n=(Fp(),m(Rp)).interpolate,i=Np(),a=se(),o=qa().TEXTPAD,s=to().toMoveInsideBar,l=Ka().recordMinTextSize,c=Zp(),u=ed();function h(t){return i.isHierarchyRoot(t)?"":i.getPtId(t)}e.exports=function(t,e,f,p,d){var m=t._fullLayout,g=e[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,_=i.findEntryWithLevel(x,y.level),b=r.select(f),w=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!_)return w.remove(),void T.remove();var k=i.isHierarchyRoot(_),A=!m.uniformtext.mode&&i.hasTransition(p),M=i.getMaxDepth(y),S=m._size,E=y.domain,C=S.w*(E.x[1]-E.x[0]),I=S.h*(E.y[1]-E.y[0]),L=C,P=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,D=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?I+z:-(P+z):0,O={x0:L,x1:L,y0:D,y1:D+P},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,j={},B={},N=null,U=function(t,e){return e?j[h(t)]:B[h(t)]},V=function(t,e,r,n){if(e)return j[h(x)]||O;var i=B[y.level]||r;return function(t){return t.data.depth-_.data.depth=(n-=(v?et:et.r)-o)){var p=(r+n)/2;r=p,n=p}var d;ot?i<(d=a-(v?et:et.b))&&d"===tt?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===tt?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),Q(l),Q(h),Q(o),Q(c),Q(u),Q(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(h.x,h.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:st,makeUpdateSliceInterpolator:ct,makeUpdateTextInterpolator:ut,handleSlicesExit:ht,hasTransition:A,strTransform:ft}):w.remove()}}}),nd=d({"src/traces/treemap/draw.js"(t,e){var r=v(),n=Np(),i=Ka().clearMinTextSize,a=Qa().resizeText,o=rd();e.exports=function(t,e,s,l,c){var u,h,f=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+f+"layer"],g=!s;i(f,d),(u=m.selectAll("g.trace."+f).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(f,!0),u.order(),!d.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(e){o(t,e,this,s,p)}))}))):(u.each((function(e){o(t,e,this,s,p)})),d.uniformtext.mode&&a(t,m.selectAll(".trace"),f)),g&&u.exit().remove()}}}),id=d({"src/traces/treemap/draw_descendants.js"(t,e){var r=v(),n=se(),i=Je(),a=Me(),o=Qp(),s=td().styleOne,l=Zp(),c=Np(),u=Up(),h=Vp().formatSliceLabel,f=!1;e.exports=function(t,e,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=!z&&!I.marker.pad.t||z&&!I.marker.pad.b,O=o(p,[g,y],{packing:I.tiling.packing,squarifyratio:I.tiling.squarifyratio,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}).descendants(),R=1/0,F=-1/0;O.forEach((function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(R=Math.min(R,e),F=Math.max(F,e))})),d=d.data(O,c.getPtId),I._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var j=null;if(T&&S){var B=c.getPtId(S);d.each((function(t){null===j&&c.getPtId(t)===B&&(j={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return j||{x0:0,x1:g,y0:0,y1:y}},U=d;return T&&(U=U.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var d=c.isHeader(o,I);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.marker.pad.r),o._hoverY=x(z?o.y1-I.marker.pad.b/2:o.y0+I.marker.pad.t/2);var m=r.select(this),k=n.ensureSingle(m,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?k.transition().attrTween("d",(function(t){var e=A(t,f,N(),[g,y]);return function(t){return _(e(t))}})):k.attr("d",_),m.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),k.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=d?D?"":c.getPtLabel(o)||"":h(o,p,I,e,C)||"";var S=n.ensureSingle(m,"g","slicetext"),O=n.ensureSingle(S,"text","",(function(t){t.attr("data-notex",1)})),R=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font)),F=o._text||" ",j=d&&-1===F.indexOf("
");O.text(F).classed("slicetext",!0).attr("text-anchor",P?"end":L||j?"start":"middle").call(i.font,R).call(a.convertToTspans,t),o.textBB=i.bBox(O.node()),o.transform=b(o,{fontSize:R.size,isHeader:d}),o.transform.fontSize=R.size,T?O.transition().attrTween("transform",(function(t){var e=M(t,f,N(),[g,y]);return function(t){return w(e(t))}})):O.attr("transform",w(o))})),j}}}),ad=d({"src/traces/treemap/plot.js"(t,e){var r=nd(),n=id();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"treemap",drawDescendants:n})}}}),od=d({"src/traces/treemap/index.js"(t,e){e.exports={moduleType:"trace",name:"treemap",basePlotModule:Gp(),categories:[],animatable:!0,attributes:Wp(),layoutAttributes:Yp(),supplyDefaults:Xp(),supplyLayoutDefaults:$p(),calc:Kp().calc,crossTraceCalc:Kp().crossTraceCalc,plot:ad(),style:td().style,colorbar:fi(),meta:{}}}}),sd=d({"lib/treemap.js"(t,e){e.exports=od()}}),ld=d({"src/traces/icicle/base_plot.js"(t){var e=Te();t.name="icicle",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),cd=d({"src/traces/icicle/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=Le(),a=Ta().attributes,o=Iu(),s=qu(),l=Wp(),c=Zp(),u=O().extendFlat,h=Pt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}}),ud=d({"src/traces/icicle/layout_attributes.js"(t,e){e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),hd=d({"src/traces/icicle/defaults.js"(t,e){var r=se(),n=cd(),i=q(),a=Ta().defaults,o=Wa().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,f,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),l(t,e,f,p);var x=e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;x&&h(t,e,f,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",x?1:.7),e._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,f,p),e._length=null}else e.visible=!1}}}),fd=d({"src/traces/icicle/layout_defaults.js"(t,e){var r=se(),n=ud();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("iciclecolorway",e.colorway),i("extendiciclecolors")}}}),pd=d({"src/traces/icicle/calc.js"(t){var e=Yu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("icicle",t)}}}),dd=d({"src/traces/icicle/partition.js"(t,e){var r=Wu(),n=Jp();e.exports=function(t,e,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&n(h,e,{swapXY:s,flipX:a,flipY:o}),h}}}),md=d({"src/traces/icicle/style.js"(t,e){var r=v(),n=q(),i=se(),a=Ka().resizeText,o=jp();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");a(t,e,"icicle"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),gd=d({"src/traces/icicle/draw_descendants.js"(t,e){var r=v(),n=se(),i=Je(),a=Me(),o=dd(),s=md().styleOne,l=Zp(),c=Np(),u=Up(),h=Vp().formatSliceLabel,f=!1;e.exports=function(t,e,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=o(p,[g,y],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}).descendants(),O=1/0,R=-1/0;D.forEach((function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),R=Math.max(R,e))})),d=d.data(D,c.getPtId),I._maxVisibleLayers=isFinite(R)?R-O+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var F=null;if(T&&S){var j=c.getPtId(S);d.each((function(t){null===F&&c.getPtId(t)===j&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return F||{x0:0,x1:g,y0:0,y1:y}},N=d;return T&&(N=N.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.tiling.pad),o._hoverY=x(z?o.y1-I.tiling.pad/2:o.y0+I.tiling.pad/2);var d=r.select(this),m=n.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?m.transition().attrTween("d",(function(t){var e=A(t,f,B(),[g,y],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(t){return _(e(t))}})):m.attr("d",_),d.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),m.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,p,I,e,C)||"";var k=n.ensureSingle(d,"g","slicetext"),S=n.ensureSingle(k,"text","",(function(t){t.attr("data-notex",1)})),D=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font));S.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":L?"start":"middle").call(i.font,D).call(a.convertToTspans,t),o.textBB=i.bBox(S.node()),o.transform=b(o,{fontSize:D.size}),o.transform.fontSize=D.size,T?S.transition().attrTween("transform",(function(t){var e=M(t,f,B(),[g,y]);return function(t){return w(e(t))}})):S.attr("transform",w(o))})),F}}}),yd=d({"src/traces/icicle/plot.js"(t,e){var r=nd(),n=gd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"icicle",drawDescendants:n})}}}),vd=d({"src/traces/icicle/index.js"(t,e){e.exports={moduleType:"trace",name:"icicle",basePlotModule:ld(),categories:[],animatable:!0,attributes:cd(),layoutAttributes:ud(),supplyDefaults:hd(),supplyLayoutDefaults:fd(),calc:pd().calc,crossTraceCalc:pd().crossTraceCalc,plot:yd(),style:md().style,colorbar:fi(),meta:{}}}}),xd=d({"lib/icicle.js"(t,e){e.exports=vd()}}),_d=d({"src/traces/funnelarea/base_plot.js"(t){var e=Te();t.name="funnelarea",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),bd=d({"src/traces/funnelarea/attributes.js"(t,e){var r=Iu(),n=N(),i=Ta().attributes,a=Dt().hovertemplateAttrs,o=Dt().texttemplateAttrs,s=O().extendFlat;e.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),wd=d({"src/traces/funnelarea/layout_attributes.js"(t,e){var r=Pu().hiddenlabels;e.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Td=d({"src/traces/funnelarea/defaults.js"(t,e){var r=se(),n=bd(),i=Ta().defaults,a=Wa().handleText,o=Lu().handleLabelsAndValues,s=Lu().handleMarkerDefaults;e.exports=function(t,e,l,c){function u(i,a){return r.coerce(t,e,n,i,a)}var h=u("labels"),f=u("values"),p=o(h,f),d=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),d){e._length=d,s(t,e,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(t,e,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(e,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else e.visible=!1}}}),kd=d({"src/traces/funnelarea/layout_defaults.js"(t,e){var r=se(),n=wd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",e.colorway),i("extendfunnelareacolors")}}}),Ad=d({"src/traces/funnelarea/calc.js"(t,e){var r=Du();e.exports={calc:function(t,e){return r.calc(t,e)},crossTraceCalc:function(t){r.crossTraceCalc(t,{type:"funnelarea"})}}}}),Md=d({"src/traces/funnelarea/plot.js"(t,e){var r=v(),n=Je(),i=se(),a=i.strScale,o=i.strTranslate,s=Me(),l=to().toMoveInsideBar,c=Ka(),u=c.recordMinTextSize,h=c.clearMinTextSize,f=_r(),p=Ru(),d=p.attachFxHandlers,m=p.determineInsideTextFont,g=p.layoutAreas,y=p.prerenderTitles,x=p.positionTitleOutside,_=p.formatSliceLabel;function b(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}function w(t,e){return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}e.exports=function(t,e){var c=t._context.staticPlot,p=t._fullLayout;h("funnelarea",p),y(e,t),g(e,p._size),i.makeTraceGroups(p._funnelarealayer,e,"trace").each((function(e){var h=r.select(this),g=e[0],y=g.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=e.vTotal,u=c,h=c*l/(1-l)/c,f=[];for(f.push(E()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/u;h+=p,f.push(E())}var d=1/0,m=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var A=f[k+=1][0],M=f[k][1];s.TL=[-A,M],s.TR=[A,M],s.BL=b,s.BR=T,s.pxmid=w(s.TR,s.BR),b=s.TL,T=s.TR}}function S(){var t=Math.sqrt(h);return{x:t,y:-t}}function E(){var t=S();return[t.x,t.y]}}(e),h.each((function(){var h=r.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),x.call(d,t,e);var T="M"+(h+a.TR[0])+","+(v+a.TR[1])+b(a.TR,a.BR)+b(a.BR,a.BL)+b(a.BL,a.TL)+"Z";w.attr("d",T),_(t,a,g);var k=f.castOption(y.textposition,a.pts),A=x.selectAll("g.slicetext").data(a.text&&"none"!==k?[0]:[]);A.enter().append("g").classed("slicetext",!0),A.exit().remove(),A.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),f=i.ensureUniformFontSize(t,m(y,a,p.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,f).call(s.convertToTspans,t);var d,g,x,_=n.bBox(c.node()),b=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(d=l(g,x,b,w,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,u(y.type,d,p),e[o].transform=d,i.setTransormAndDisplay(c,d)}))}}));var v=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),e.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,t);var c=x(g,p._size);e.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Sd=d({"src/traces/funnelarea/style.js"(t,e){var r=v(),n=wr(),i=Ka().resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),Ed=d({"src/traces/funnelarea/index.js"(t,e){e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:_d(),categories:["pie-like","funnelarea","showLegend"],attributes:bd(),layoutAttributes:wd(),supplyDefaults:Td(),supplyLayoutDefaults:kd(),calc:Ad().calc,crossTraceCalc:Ad().crossTraceCalc,plot:Md(),style:Sd(),styleOne:wr(),meta:{}}}}),Cd=d({"lib/funnelarea.js"(t,e){e.exports=Ed()}}),Id=d({"stackgl_modules/index.js"(t,e){!function(){var t={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){function n(t,e){for(var r=0;rp)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,m.prototype),e}function m(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return v(t)}return g(t,e,r)}function g(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!m.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|w(t,e),n=d(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(rt(t,Uint8Array)){var e=new Uint8Array(t);return _(e.buffer,e.byteOffset,e.byteLength)}return x(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(t));if(rt(t,ArrayBuffer)||t&&rt(t.buffer,ArrayBuffer))return _(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(rt(t,SharedArrayBuffer)||t&&rt(t.buffer,SharedArrayBuffer)))return _(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return m.from(n,e,r);var i=function(t){if(m.isBuffer(t)){var e=0|b(t.length),r=d(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||nt(t.length)?d(0):x(t):"Buffer"===t.type&&Array.isArray(t.data)?x(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return m.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(t))}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function v(t){return y(t),d(t<0?0:0|b(t))}function x(t){for(var e=t.length<0?0:0|b(t.length),r=d(e),n=0;n=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|t}function w(t,e){if(m.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||rt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tt(t).length;default:if(i)return n?-1:Q(t).length;e=(""+e).toLowerCase(),i=!0}}function T(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return z(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function k(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),nt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=m.from(e,n)),m.isBuffer(e))return 0===e.length?-1:M(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):M(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;fi&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function z(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},m.byteLength=w,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},f&&(m.prototype[f]=m.prototype.inspect),m.prototype.compare=function(t,e,r,n,i){if(rt(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),l=this.slice(n,i),u=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return C(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,a){if(!m.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function V(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function q(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,4),h.write(t,e,r,n,23,4),r+4}function G(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,8),h.write(t,e,r,n,52,8),r+8}m.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},m.prototype.readBigUInt64LE=at((function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},m.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},m.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},m.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},m.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},m.prototype.readBigInt64LE=at((function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||B(t,4,this.length),h.read(this,t,!0,23,4)},m.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),h.read(this,t,!1,23,4)},m.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),h.read(this,t,!0,52,8)},m.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),h.read(this,t,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigUInt64LE=at((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeBigUInt64BE=at((function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},m.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},m.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},m.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigInt64LE=at((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeBigInt64BE=at((function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},m.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},m.prototype.writeDoubleLE=function(t,e,r){return G(this,t,e,!0,r)},m.prototype.writeDoubleBE=function(t,e,r){return G(this,t,e,!1,r)},m.prototype.copy=function(t,e,r,n){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function X(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new Z.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,a)}function $(t,e){if("number"!=typeof t)throw new Z.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new Z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new Z.ERR_BUFFER_OUT_OF_BOUNDS;throw new Z.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}W("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),W("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(c(e))}),TypeError),W("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function tt(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function et(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function rt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function nt(t){return t!=t}var it=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function at(t){return"undefined"==typeof BigInt?ot:t}function ot(){throw new Error("BigInt not supported")}},9216:function(t){t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(t,e,r){t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),f=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:f},c)};var n=r(7261),i=r(9977),a=r(1811);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r0?o-4:o;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,c=n-i;sc?c:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var i,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},1318:function(t){t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},8697:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},7842:function(t,e,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);t.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,h=0;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(t,e,r){var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(t,e,r){r(6859),t.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},2651:function(t,e,r){var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},6768:function(t,e,r){var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(f=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):c*(f*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(t){function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},8828:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,f=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],_=8191&x,b=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],C=8191&E,I=E>>>13,L=0|o[7],P=8191&L,z=L>>>13,D=0|o[8],O=8191&D,R=D>>>13,F=0|o[9],j=8191&F,B=F>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,Z=0|s[2],W=8191&Z,Y=Z>>>13,X=0|s[3],$=8191&X,K=X>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var yt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,V))+Math.imul(b,U)|0,a=Math.imul(b,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,Y)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Y)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,K)|0;var _t=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;c=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,K)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,tt)|0;var bt=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,nt)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,V))+Math.imul(B,U)|0,a=Math.imul(B,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(z,W)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,ot)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ct)|0,n=n+Math.imul(d,ht)|0,i=(i=i+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var At=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;c=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,G))+Math.imul(B,H)|0,a=Math.imul(B,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(b,lt)|0,a=a+Math.imul(b,ct)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,a=a+Math.imul(v,ft)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(j,W),i=(i=Math.imul(j,Y))+Math.imul(B,W)|0,a=Math.imul(B,Y),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(b,ht)|0,a=a+Math.imul(b,ft)|0;var St=(c+(n=n+Math.imul(y,dt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,dt)|0))<<13)|0;c=((a=a+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,K))+Math.imul(B,$)|0,a=Math.imul(B,K),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(c+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(b,dt)|0))<<13)|0;c=((a=a+Math.imul(b,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(B,Q)|0,a=Math.imul(B,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Ct=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(B,rt)|0,a=Math.imul(B,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(I,ht)|0,a=a+Math.imul(I,ft)|0;var It=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,at),i=(i=Math.imul(j,ot))+Math.imul(B,at)|0,a=Math.imul(B,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(z,ht)|0,a=a+Math.imul(z,ft)|0;var Lt=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,lt),i=(i=Math.imul(j,ct))+Math.imul(B,lt)|0,a=Math.imul(B,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((a=a+Math.imul(z,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(B,ht)|0,a=Math.imul(B,ft);var zt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Dt=(c+(n=Math.imul(j,dt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(B,dt)|0))<<13)|0;return c=((a=Math.imul(B,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=yt,l[2]=vt,l[3]=xt,l[4]=_t,l[5]=bt,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=It,l[15]=Lt,l[16]=Pt,l[17]=zt,l[18]=Dt,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=p),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?p(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):this.negative&t.negative?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;!(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;!(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;!(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;!(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(x,v),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new _;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(!(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,T),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var h,f=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,f,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,f,p,0,c,d,m):o(u,r,n,s,f,p,c,d,m),i.free(d),i.free(m))}i.free(f),i.free(p)}return h}}}function u(t,e){n.push([t,e])}},2455:function(t,e){function r(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=n,p=h*n;fc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=n,p=h*n;f0;){var D=(P-=1)*_,O=w[D],R=w[D+1],F=w[D+2],j=w[D+3],B=w[D+4],N=w[D+5],U=P*b,V=T[U],q=T[U+1],H=1&N,G=!!(16&N),Z=u,W=S,Y=C,X=I;if(H&&(Z=C,W=I,Y=u,X=S),!(2&N&&R>=(F=g(t,O,R,F,Z,W,q))||4&N&&(R=y(t,O,R,F,Z,W,V))>=F)){var $=F-R,K=B-j;if(G){if(t*$*($+K)=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo>>1,f=2*t,p=h,d=s[f*h+e];c=x?(p=v,d=x):y>=b?(p=g,d=y):(p=_,d=b):x>=b?(p=v,d=x):b>=y?(p=g,d=y):(p=_,d=b);for(var w=f*(u-1),T=f*p,k=0;kr&&i[h+e]>c;--u,h-=o){for(var f=h,p=h+o,d=0;df;++f,l+=s)if(i[l+h]===o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lof;++f,l+=s)if(i[l+h]p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lop;++p,l+=s){var d=i[l+h],m=i[l+f];if(dg;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,f=t+e,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,h=r,f=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+f],g=i[c+p];if(!(m>=o||s>=g))if(h===d)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[d];a[d]=a[h],a[h++]=x}}return h}}},4192:function(t){t.exports=function(t,n){n<=4*e?r(0,n-1,t):c(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function l(t,e,r,n){var i=n[t*=2];return i>1,g=m-f,y=m+f,v=p,x=g,_=m,b=y,w=d,T=t+1,k=u-1,A=0;s(v,x,h)&&(A=v,v=x,x=A),s(b,w,h)&&(A=b,b=w,w=A),s(v,_,h)&&(A=v,v=_,_=A),s(x,_,h)&&(A=x,x=_,_=A),s(v,b,h)&&(A=v,v=b,b=A),s(_,b,h)&&(A=_,_=b,b=A),s(x,w,h)&&(A=x,x=w,w=A),s(x,_,h)&&(A=x,x=_,_=A),s(b,w,h)&&(A=b,b=w,w=A);for(var M=h[2*x],S=h[2*x+1],E=h[2*b],C=h[2*b+1],I=2*v,L=2*_,P=2*w,z=2*p,D=2*m,O=2*d,R=0;R<2;++R){var F=h[I+R],j=h[L+R],B=h[P+R];h[z+R]=F,h[D+R]=j,h[O+R]=B}i(g,t,h),i(y,u,h);for(var N=T;N<=k;++N)if(l(N,M,S,h))N!==T&&n(N,T,h),++T;else if(!l(N,E,C,h))for(;;){if(l(k,E,C,h)){l(k,M,S,h)?(a(N,T,k,h),++T,--k):(n(N,k,h),--k);break}if(--k>>1;a(d,S);var E=0,C=0;for(T=0;T=o)m(u,h,C--,I=I-o|0);else if(I>=0)m(l,c,E--,I);else if(I<=-o){I=-I-o|0;for(var L=0;L>>1;a(d,E);var C=0,I=0,L=0;for(k=0;k>1==d[2*k+3]>>1&&(z=2,k+=1),P<0){for(var D=-(P>>1)-1,O=0;O>1)-1,0===z?m(l,c,C--,D):1===z?m(u,h,I--,D):2===z&&m(f,p,L--,D)}},scanBipartite:function(t,e,r,n,i,s,u,h,f,p,y,v){var x=0,_=2*t,b=e,w=e+t,T=1,k=1;n?k=o:T=o;for(var A=i;A>>1;a(d,C);var I=0;for(A=0;A=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(l,c,I++,M);else{var z=v[M],D=_*M,O=y[D+e+1],R=y[D+e+1+t];t:for(var F=0;F>>1;a(d,T);var k=0;for(x=0;x=o)l[k++]=_-o;else{var M=p[_-=1],S=g*_,E=f[S+e+1],C=f[S+e+1+t];t:for(var I=0;I=0;--I)if(l[I]===_){for(D=I+1;D0;){for(var p=r.pop(),d=(u=-1,h=-1,l=o[s=r.pop()],1);d=0||(e.flip(s,p),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,p,u),i(t,e,r,p,u,h))}}},5023:function(t,e,r){var n=r(2478);function i(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-o){c[p]=o,u[p];for(var d=0;d<3;++d){var m=f[3*p+d];m>=0&&0===c[m]&&(h[3*p+d]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var y=function(t,e,r){for(var n=0,i=0;i1&&i(r[f[p-2]],r[f[p-1]],a)>0;)t.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=h.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],_=x[0],b=x[1],w=t[_],T=t[b];if((w[0]-T[0]||w[1]-T[1])<0){var k=_;_=b,b=k}x[0]=_;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,A]):e.push([M,E]),M=E}i?e.push([M,b,A]):e.push([M,b])}return f}(t,e,f,g,r),x=d(t,v);return y(e,x,r),!!x||f.length>0||g.length>0}},3637:function(t,e,r){t.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),f=u(a,h);if(0===o(f))return null;var p=s(t,r),d=u(h,p),m=i(d,f),g=c(a,m);return l(t,g)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){var n=r(3642),i=r(395);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,c,u,h,f,p,d,m;if(t||(t={}),p=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),y=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(t){t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),c=e(n[0],n[1]);return e(l,t[2])-e(c,n[2])||e(l+t[2],o)-e(c+n[2],s);case 4:var u=t[0],h=t[1],f=t[2],p=t[3],d=n[0],m=n[1],g=n[2],y=n[3];return u+h+f+p-(d+m+g+y)||e(u,h,f,p)-e(d,m,g,y,d)||e(u+h,u+f,u+p,h+f,h+p,f+p)-e(d+m,d+g,d+y,m+g,m+y,g+y)||e(u+h+f,u+h+p,u+f+p,h+f+p)-e(d+m+g,d+m+y,d+g+y,m+g+y);default:for(var v=t.slice().sort(r),x=n.slice().sort(r),_=0;_t[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},4750:function(t,e,r){t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+h*r[p]+f*n[p];return a}return c*t+u*e+h*r+f*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},7642:function(t,e,r){var n=r(8954),i=r(1682);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0})):b.filter((function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(u=0;u>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){f=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=a(c[f-1],u[f-1],arguments[f]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],c[f-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(t){function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||p,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function u(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(t,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new e(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new e(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var f=l[h-1];if(s=l[h],1===f._color||1===s._color)break;var p=l[h-2];if(p.left===f)if(f.left===s){if(!(d=p.right)||0!==d._color){p._color=0,p.left=f.right,f._color=1,f.right=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).left===p?m.left=f:m.right=f);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else{if(!(d=p.right)||0!==d._color){f.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=f,s.right=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).left===p?m.left=s:m.right=s);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else if(f.right===s){if(!(d=p.left)||0!==d._color){p._color=0,p.right=f.left,f._color=1,f.left=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).right===p?m.right=f:m.left=f);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;f.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=f,s.left=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).right===p?m.right=s:m.left=s);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new u(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),o.at=function(t){if(t<0)return new u(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new u(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new e(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).left===a?c.left=s:c.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),t[l-1]=o,t[l]=a,l+11&&((c=t[l-2]).right===a?c.right=o:c.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).right===a?c.right=s:c.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).right===a?c.right=o:c.left=o),t[l-1]=o,t[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){t.exports=function(t,e){var r=new p(t);return r.update(e),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(t){return Array.isArray(t)||function(t){return c.isView(t)&&!(t instanceof u)}(t)}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var d=p.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(h(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,f=!1;if("bounds"in t)for(var p=t.bounds,d=0;d<2;++d)for(var m=0;m<3;++m)p[d][m]!==this.bounds[d][m]&&(f=!0),this.bounds[d][m]=p[d][m];if("ticks"in t)for(r=t.ticks,u=!0,this.autoTicks=!1,d=0;d<3;++d)this.tickSpacing[d]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var h=a,f=s,p=o,d=l;c&1<0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var _=[0,0,0],b=[0,0,0],w=[0,0,0];d.draw=function(t){t=t||x;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,p=n[12],d=n[13],m=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*p+i[7]*d+i[11]*m+i[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=h[A];var M=g;for(A=0;A<3;++A)y(g[A],A,this.bounds,u,h);e=this.gl;var S,E,C,I,L,P,z,D,O,R,F,j,B=v;for(A=0;A<3;++A)this.backgroundEnable[A]?B[A]=h[A]:B[A]=0;for(this._background.draw(r,n,i,a,B,this.backgroundColor),this._lines.bind(r,n,i,this),A=0;A<3;++A){var N=[0,0,0];h[A]>0?N[A]=a[1][A]:N[A]=a[0][A];for(var U=0;U<2;++U){var V=(A+1+U)%3,q=(A+1+(1^U))%3;this.gridEnable[V]&&this._lines.drawGrid(V,q,this.bounds,N,this.gridColor[V],this.gridWidth[V]*this.pixelRatio)}for(U=0;U<2;++U)V=(A+1+U)%3,q=(A+1+(1^U))%3,this.zeroEnable[q]&&Math.min(a[0][q],a[1][q])<=0&&Math.max(a[0][q],a[1][q])>=0&&this._lines.drawZero(V,q,this.bounds,N,this.zeroLineColor[q],this.zeroLineWidth[q]*this.pixelRatio)}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var H=f(_,M[A].primalMinor),G=f(b,M[A].mirrorMinor),Z=this.lineTickLength;for(U=0;U<3;++U){var W=k/r[5*U];H[U]*=Z[U]*W,G[U]*=Z[U]*W}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,H,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,G,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}function Y(t){(C=[0,0,0])[t]=1}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),A=0;A<3;++A){var X=M[A].primalMinor,$=M[A].mirrorMinor,K=f(w,M[A].primalOffset);for(U=0;U<3;++U)this.lineTickEnable[A]&&(K[U]+=k*X[U]*Math.max(this.lineTickLength[U],0)/r[5*U]);var J=[0,0,0];if(J[A]=1,this.tickEnable[A]){for(-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,E=1,"auto"===(S=[this.tickAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),C=[0,0,0],P=$,z=void 0,D=void 0,O=void 0,R=void 0,F=void 0,j=void 0,D=((I=A)+2)%3,O=(L=X)[z=(I+1)%3],R=L[D],F=P[z],j=P[D],O>0&&j>0||O>0&&j<0||O<0&&j>0||O<0&&j<0?Y(z):(R>0&&F>0||R>0&&F<0||R<0&&F>0||R<0&&F<0)&&Y(D),U=0;U<3;++U)K[U]+=k*X[U]*this.tickPad[U]/r[5*U];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],K,this.tickColor[A],J,C,S)}if(this.labelEnable[A]){for(E=0,C=[0,0,0],this.labels[A].length>4&&(Y(A),E=1),"auto"===(S=[this.labelAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),U=0;U<3;++U)K[U]+=k*X[U]*this.labelPad[U]/r[5*U];K[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],K,this.labelColor[A],[0,0,0],C,S)}}this._text.unbind()},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[c]=d;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=g}var y=n(t,new Float32Array(e)),v=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],v),_=a(t);return _.attributes.position.location=0,_.attributes.normal.location=1,new o(t,y,x,_)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){t.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var _=0;_<2;++_){u[1]=a[_][1];for(var b=0;b<2;++b)u[0]=a[b][0],f(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(B=R^1<c[j][0]&&(j=B))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(F^R)]=R&F,N[n.log2(R^j)]=R&j;var U=7^j;U===w||U===O?(U=7^F,N[n.log2(j^U)]=U&j):N[n.log2(F^U)]=U&F;var V=g,q=w;for(A=0;A<3;++A)V[A]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){t.exports=function(t,e,r,a,s,l){var u=n(t),h=i(t,[{buffer:u,size:3}]),f=o(t);f.attributes.position.location=0;var p=new c(t,f,u,h);return p.update(e,r,a,s,l),p};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||process.global||{},l=s.__TEXT_CACHE||{};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var u=c.prototype,h=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[e];h||(h=u[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,p=h.positions,d=h.cells,m=0,g=d.length;m=0;--v){var x=p[y[v]];o.push(f*x[0],-f*x[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),f[d]=(o.length/3|0)-h[d],c[d]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},6405:function(t,e,r){var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,f=-1/0,p=null,d=null,m=[],g=1/0,y=!1,v="raw"===t.coneSizemode,x=0;xo&&(o=n.length(b)),x&&!v){var w=2*n.distance(p,_)/(n.length(d)+n.length(b));w?(g=Math.min(g,w),y=!1):y=!0}y||(p=_,d=b),m.push(b)}var T=[s,c,h],k=[l,u,f];e&&(e[0]=T,e[1]=k),0===o&&(o=1);var A=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||(v?1:.5);t.absoluteConeSize&&(M=t.absoluteConeSize*A),a.coneScale=M,x=0;for(var S=0;x=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var f=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),u=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),h=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=t.LINEAR_MIPMAP_LINEAR,h.magFilter=t.LINEAR;var p=i(t),d=i(t),m=i(t),g=i(t),y=i(t),v=new f(t,h,l,u,p,d,y,m,g,a(t,[{buffer:p,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),r.traceType||"cone");return v.update(e),v}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],a=0;a0&&((p=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,p),o+=2+h(i,p,m,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&h>0&&p&&(f=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,f,h,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?d?t.depth=f(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=f(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},5714:function(t,e,r){t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new y(e,r,o,s,l,d);return m.update(t),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,f=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function y(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],f=t.position||t.positions;if(f){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],_[r],b[r]),h[1][r]=Math.max(h[1][r],_[r],b[r])}Array.isArray(p[0])?(y=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],v=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):y=v=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(_,b),g){for(r=0;r<2;++r)i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],T,-x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],s,-x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[f,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),f=r(7765),p=r(1888),d=r(840),m=r(7626),g=d.meshShader,y=d.wireShader,v=d.pointShader,x=d.pickShader,_=d.pointPickShader,b=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,T,k,A,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=b,this.pointUVs=T,this.pointSizes=k,this.pointIds=_,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;aMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),f=r(4040),p=r(799),d=r(9216)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var v=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,_=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),b=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=i(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],C=[],I=[],L=[],P=!0,z=!0,D=new Array(16),O=new Array(16),R={view:null,projection:D,model:O,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),j=t.cameraObject||n(e,T),B={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:j,axes:A,axesPixels:null,spikes:S,bounds:v,objects:E,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},N=[r.drawingBufferWidth/B.pixelRatio|0,r.drawingBufferHeight/B.pixelRatio|0];function U(){if(!B._stopped&&B.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*B.pixelRatio),a=0|Math.ceil(n*B.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",P=!0}}}function V(){for(var t=E.length,e=L.length,n=0;n0&&0===I[e-1];)I.pop(),L.pop().dispose()}function q(){if(B.contextLost)return!0;r.isContextLost()&&(B.contextLost=!0,B.mouseListener.enabled=!1,B.selection.object=null,B.oncontextloss&&B.oncontextloss())}B.autoResize&&U(),window.addEventListener("resize",U),B.update=function(t){B._stopped||(t=t||{},P=!0,z=!0)},B.add=function(t){B._stopped||(t.axes=A,E.push(t),C.push(-1),P=!0,z=!0,V())},B.remove=function(t){if(!B._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),P=!0,z=!0,V())}},B.dispose=function(){if(!B._stopped&&(B._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",q),B.mouseListener.enabled=!1,!B.contextLost)){A.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*h+l*m,t[3]=s*f+l*g,t}},5964:function(t){t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){var n=r(4359);t.exports=function(t,e,r){var a=[e.style,e.weight,e.variant,e.family].join("_"),o=i[a];if(o||(o=i[a]={}),t in o)return o[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var c,u,h=n(t,s);if(r&&1!==r){for(c=0;c max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},f={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return y(t,h)},e.createOrtho=function(t){return y(t,f)},e.createProject=function(t){return y(t,p)},e.createPickPerspective=function(t){return y(t,d)},e.createPickOrtho=function(t){return y(t,m)},e.createPickProject=function(t){return y(t,g)}},8418:function(t,e,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=ArrayBuffer,p=DataView;function d(t){return Array.isArray(t)||function(t){return f.isView(t)&&!(t instanceof p)}(t)}function m(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function g(t,e,r,n){return m(n,n),m(n,n),m(n,n)}function y(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t||t>1?1:t}function x(t,e,r,n,i,a,o,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),f=i(e),p=i(e),d=i(e),m=a(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:f,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new x(e,r,n,o,h,f,p,d,m,s,c,u);return g.update(t),g};var _=x.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},_.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var b=[0,0],w=[0,0,0],T=[0,0,0],k=[0,0,0,1],A=[0,0,0,1],M=h.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]];function C(t){return t[0]=t[1]=t[2]=0,t}function I(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function L(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function P(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,f=r.projection||h,p=e.axesBounds,d=function(t){for(var e=E,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=f,l.screenSize=b,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=d,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var y=M,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=p[0][m]:y[12+m]=p[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,_=(m+2)%3,P=C(w),z=C(T);P[x]=1,z[_]=1;var D=g(0,0,0,I(k,P)),O=g(0,0,0,I(A,z));if(Math.abs(D[1])>Math.abs(O[1])){var R=D;D=O,O=R,R=P,P=z,z=R;var F=x;x=_,_=F}D[0]<0&&(P[x]=-1),O[1]>0&&(z[_]=-1);var j=0,B=0;for(v=0;v<4;++v)j+=Math.pow(c[4*x+v],2),B+=Math.pow(c[4*_+v],2);P[x]/=Math.sqrt(j),z[_]/=Math.sqrt(B),l.axes[0]=P,l.axes[1]=z,l.fragClipBounds[0]=L(S,d[0],m,-1e8),l.fragClipBounds[1]=L(S,d[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var z=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&P(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,b[0]=2/s.drawingBufferWidth,b[1]=2/s.drawingBufferHeight,l.screenSize=b,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=z,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function O(t,e,r,i){var a;a=d(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(d(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(d(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){d(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n0){var z=0,D=_,R=[0,0,0,1],F=[0,0,0,1],j=d(p)&&d(p[0]),B=d(y)&&d(y[0]);t:for(n=0;n0?1-S[0][0]:W<0?1+S[1][0]:1,Y*=Y>0?1-S[0][1]:Y<0?1+S[1][1]:1],$=A.cells||[],K=A.positions||[];for(k=0;k<$.length;++k)for(var J=$[k],Q=0;Q<3;++Q){for(var tt=0;tt<3;++tt)C[3*z+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*z+tt]=R[tt];P[z]=x;var et=K[J[Q]];L[2*z]=q*(G*et[0]-Z*et[1]+X[0]),L[2*z+1]=q*(Z*et[0]+G*et[1]+X[1]),z+=1}for($=M.edges,K=M.positions,k=0;k<$.length;++k)for(J=$[k],Q=0;Q<2;++Q){for(tt=0;tt<3;++tt)C[3*D+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*D+tt]=F[tt];P[D]=x,et=K[J[Q]],L[2*D]=q*(G*et[0]-Z*et[1]+X[0]),L[2*D+1]=q*(Z*et[0]+G*et[1]+X[1]),D+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=_,this.lineVertexCount=b,this.pointBuffer.update(C),this.colorBuffer.update(I),this.glyphBuffer.update(L),this.idBuffer.update(P),o.free(C),o.free(I),o.free(L),o.free(P)},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(t,e,r){t.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A=0;)M+=1;b[v]=M}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,_,b);for(var t=0;t=0){if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(t,e,p[0],i,d,a,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d;if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);l(t,e,p,i,d,a,h)}}}return a};var n=r(8866);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+y+"fv"](s[h],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](s[h],f);break;case"v":t["uniform"+y+"fv"](s[h],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(t,e,n){if("object"==typeof n){var c=h(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(u=n,function(t,e,r){return t.getUniform(e.program,r[u])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var u}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(f[T],p[T],p[k],p[k],f[k],f[T]),h.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=f;f=p,p=M;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(t,r,a,o)})),h=[],f=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nh-1||v>f-1||x>p-1)return n.create();var _,b,w,T,k,A,M=a[0][d],S=a[0][y],E=a[1][m],C=a[1][v],I=a[2][g],L=(o-M)/(S-M),P=(c-E)/(C-E),z=(u-I)/(a[2][x]-I);switch(isFinite(L)||(L=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,y=h-1-y),r.reversedY&&(m=f-1-m,v=f-1-v),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,A=x,w=m*p,T=v*p,_=d*p*f,b=y*p*f;break;case 4:k=g,A=x,_=d*p,b=y*p,w=m*p*h,T=v*p*h;break;case 3:w=m,T=v,k=g*f,A=x*f,_=d*f*p,b=y*f*p;break;case 2:w=m,T=v,_=d*f,b=y*f,k=g*f*h,A=x*f*h;break;case 1:_=d,b=y,k=g*h,A=x*h,w=m*h*p,T=v*h*p;break;default:_=d,b=y,w=m*h,T=v*h,k=g*h*f,A=x*h*f}var D=i[_+w+k],O=i[_+w+A],R=i[_+T+k],F=i[_+T+A],j=i[b+w+k],B=i[b+w+A],N=i[b+T+k],U=i[b+T+A],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,D,j,L),n.lerp(q,O,B,L),n.lerp(H,R,N,L),n.lerp(G,F,U,L);var Z=n.create(),W=n.create();n.lerp(Z,V,H,P),n.lerp(W,q,G,P);var Y=n.create();return n.lerp(Y,Z,W,z),Y}(e,t,p)},x=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=v(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=v(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=v(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},_=[],b=e[0][0],w=e[0][1],T=e[0][2],k=e[1][0],A=e[1][1],M=e[1][2],S=10*n.distance(e[0],e[1])/i,E=S*S,C=1,I=0,L=r.length;L>1&&(C=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lI&&(I=N),j.push(N),_.push({points:D,velocities:O,divergences:j});for(var U=0;U<100*i&&D.lengthk||gA||yM));){U++;var V=n.clone(R),q=n.squaredLength(V);if(0===q)break;q>E&&n.scale(V,V,S/Math.sqrt(q)),n.add(V,V,z),R=v(V),n.squaredDistance(F,V)-E>-1e-4*E&&(D.push(V),F=V,O.push(R),B=x(V,R),N=n.length(B),isFinite(N)&&N>I&&(I=N),j.push(N)),z=V}}var H=o(_,t.colormap,I,C);return h?H.tubeScale=h:(0===I&&(I=1),H.tubeScale=.5*u*C/I),H};var u=r(6740),h=r(6405).createMesh;t.exports.createTubeMesh=function(t,e){return h(t,e,{shaders:u,traceType:"streamtube"})}},990:function(t,e,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){t.exports=function(t){var e=t.gl,r=v(e),n=_(e),s=x(e),l=b(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(e),f=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,S,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,f,p,d,[0,0,0]),y={levels:[[],[],[]]};for(var T in t)y[T]=t[T];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),f=r(3711),p=r(6760),d=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,_=y.createPickShader,b=y.createPickContourShader,w=40,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function E(t,e,r,n,i,a,o,l,c,u,f,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:S,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var I=[0,0,0],L={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||I,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},D=T.slice(),O=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||T,n.view=t.view||T,n.projection=t.projection||T,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=O,n.vertexColor=this.vertexColor;var s=D;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(h.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var p=i+u,d=s+f,g=h*(f?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(p,d)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]Math.abs(b-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=j(t.contourWidth,Number)),"showContour"in t&&(this.showContour=j(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=j(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=N(t.contourColor)),"contourProject"in t&&(this.contourProject=j(t.contourProject,(function(t){return j(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=N(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=j(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=j(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=h(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=h(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)J.pop();U-=1}continue t}J.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var _t=s.mallocFloat(J.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var h,p,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var y=e.size;if(l)h=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var v=[o[2],o[2]*o[0],1];p=a.malloc(y,r);var x=n(p,o,v,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):u(x,e),h=p.subarray(0,y)}var _=m(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,c,h),l||a.free(p),new f(t,_,o[0],o[1],g,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function f(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=f.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new f(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,h){var f=h.dtype,p=h.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=d(p,h.stride.slice());if("float32"===f?m=t.FLOAT:"float64"===f?(m=t.FLOAT,y=!1,f="float32"):"uint8"===f?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,y=!1,f="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],h=n(h.data,p,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var _;_=l===t.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var b=n(_,p,[p[2],p[2]*p[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(b,h):i.assign(b,h),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,_.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,_.subarray(0,v)),l===t.FLOAT?a.freeFloat32(_):a.freeUint8(_)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},1433:function(t){t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return B(r),L+=r.length,(S=S.slice(r.length)).length}}function W(){return/[^a-fA-F0-9]/.test(e)?(B(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function Y(){return"."===e||/[eE]/.test(e)?(S.push(e),M=m,r=e,k+1):"x"===e&&1===S.length&&"0"===S[0]?(M=b,S.push(e),r=e,k+1):/[^\d]/.test(e)?(B(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function X(){return"f"===e&&(S.push(e),r=e,k+=1),/[eE]/.test(e)?(S.push(e),r=e,k+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(B(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function $(){if(/[^\d\w_]/.test(e)){var t=S.join("");return M=j[t]?v:F[t]?y:g,B(S.join("")),M=l,k}return S.push(e),r=e,k+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,f=2,p=3,d=4,m=5,g=6,y=7,v=8,x=9,_=10,b=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}},8954:function(t,e,r){t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),f=h.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var y=new a(d,new Array(i+1),!0);f[u]=y,p[u]=y}for(p[i+1]=h,u=0;u<=i;++u){d=f[u].vertices;var v=f[u].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)v[m]=h;else for(var _=0;_<=i;++_)f[_].vertices.indexOf(x)<0&&(v[m]=f[_])}}var b=new c(i,o,p),w=!!e;for(u=i+1;u0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var p=this.orient();if(a[u]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var p=(e=h.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,_=0;_<=n;++_)v[_]<0?(x=_,l[_]=t):l[_]=i[v[_]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var A=b.indexOf(e);if(!(A<0))for(b[A]=k,T[m]=y,w[g]=-1,T[g]=e,d[g]=k,k.flip(),_=0;_<=n;++_){var M=w[_];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var I=w[C];I<0||C===_||(S[E++]=I)}f.push(new o(S,k,_))}}}}}for(f.sort(s),g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},3352:function(t,e,r){var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function f(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):f(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?h(this.rightPoints,t,r):f(this.leftPoints,r)};var v=y.prototype;v.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},v.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},v.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},v.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(t){t.exports=!0},7163:function(t){function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},5219:function(t){t.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,t))return!1;if(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var v,x,_,b,w,T,k,A=u[3],M=u[7],S=u[11],E=u[12],C=u[13],I=u[14],L=u[15];if(0!==A||0!==M||0!==S){if(f[0]=A,f[1]=M,f[2]=S,f[3]=L,!s(h,h))return!1;l(h,h),v=g,_=h,b=(x=f)[0],w=x[1],T=x[2],k=x[3],v[0]=_[0]*b+_[4]*w+_[8]*T+_[12]*k,v[1]=_[1]*b+_[5]*w+_[9]*T+_[13]*k,v[2]=_[2]*b+_[6]*w+_[10]*T+_[14]*k,v[3]=_[3]*b+_[7]*w+_[11]*T+_[15]*k}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=E,e[1]=C,e[2]=I,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(p,u),r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,p[1],p[2]),c.dot(p[0],d)<0)for(var P=0;P<3;P++)r[P]*=-1,p[P][0]*=-1,p[P][1]*=-1,p[P][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(y[0]=-y[0]),p[0][2]>p[2][0]&&(y[1]=-y[1]),p[1][0]>p[0][1]&&(y[2]=-y[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var f=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!f||!p||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},1811:function(t,e,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),f=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)f[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&f[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=f[c];else i(o,f,d,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,_=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*_}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i0;--p)r[h++]=s[p];return r};var n=r(3250)[3]},351:function(t,e,r){t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function f(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",f),t.addEventListener("keydown",f),t.addEventListener("keypress",f),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",f),t.removeEventListener("keydown",f),t.removeEventListener("keypress",f),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(t,e){function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var s=t.getters||[],l=new Array(a),c=0;c=0?l[c]=!0:l[c]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|d,k=m-d*u|0,A=0,M=0,S=0,E=2*u|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-u,F=0|u,j=0,B=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(A=0;A0){if(M=1,C[L++]=r(f[g],o,s,l),g+=T,u>0)for(A=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],j=C[L+R],U=C[L+B],P===O&&P===j&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,O,j,U,o,s,l),V=I[L]=S++),L+=1,g+=T,A=2;A0)for(A=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],j=C[L+R],U=C[L+B],P===O&&P===j&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,O,j,U,o,s,l),V=I[L]=S++,U!==j&&e(I[L+R],V,_,w,j,U,o,s,l)),L+=1,g+=T,A=2;A0){if(A=1,C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),j=C[L+R],O=C[L+z],U=C[L+B],P===j&&P===O&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,j,O,U,o,s,l),V=I[L]=S++),L+=1,g+=T,M=2;M0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),j=C[L+R],O=C[L+z],U=C[L+B],P===j&&P===O&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,j,O,U,o,s,l),V=I[L]=S++,U!==j&&e(I[L+R],V,w,v,U,j,o,s,l)),L+=1,g+=T,M=2;M2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=u[e])return a;for(var r=t.length,n=[h,f],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return u[e]=a,a}(r)(t,e)}},4317:function(t){function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var _=0|t[1];_>0;){_<64?(c=_,_=0):(c=64,_-=64),n=y+x*h+_*f,o=v+x*d+_*m;var b=0,w=0,T=0,k=p,A=h-u*p,M=f-l*h,S=g,E=d-u*g,C=m-l*d;for(T=0;T0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*u+g*c,o=d+m*f+g*h;var y=0,v=0,x=u,_=c-l*u,b=f,w=h-l*f;for(v=0;v0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var _=0|t[1];_>0;){_<64?(l=_,_=0):(l=64,_-=64),n=g+v*f+x*u+_*h,o=y+v*m+x*p+_*d;var b=0,w=0,T=0,k=f,A=u-c*f,M=h-s*u,S=m,E=p-c*m,C=d-s*p;for(T=0;Tr;){y=0,v=m-o;e:for(g=0;g_)break e;v+=h,y+=f}for(y=m,v=m-o,g=0;g>1,H=q-N,G=q+N,Z=U,W=H,Y=q,X=G,$=V,K=i+1,J=a-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);A=l*Z,M=l*W,B=s;t:for(k=0;k0){g=Z,Z=W,W=g;break t}if(rt<0)break t;B+=p}A=l*X,M=l*$,B=s;t:for(k=0;k0){g=X,X=$,$=g;break t}if(rt<0)break t;B+=p}A=l*Z,M=l*Y,B=s;t:for(k=0;k0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;B+=p}A=l*W,M=l*Y,B=s;t:for(k=0;k0){g=W,W=Y,Y=g;break t}if(rt<0)break t;B+=p}A=l*Z,M=l*X,B=s;t:for(k=0;k0){g=Z,Z=X,X=g;break t}if(rt<0)break t;B+=p}A=l*Y,M=l*X,B=s;t:for(k=0;k0){g=Y,Y=X,X=g;break t}if(rt<0)break t;B+=p}A=l*W,M=l*$,B=s;t:for(k=0;k0){g=W,W=$,$=g;break t}if(rt<0)break t;B+=p}A=l*W,M=l*Y,B=s;t:for(k=0;k0){g=W,W=Y,Y=g;break t}if(rt<0)break t;B+=p}A=l*X,M=l*$,B=s;t:for(k=0;k0){g=X,X=$,$=g;break t}if(rt<0)break t;B+=p}for(A=l*Z,M=l*W,S=l*Y,E=l*X,C=l*$,I=l*U,L=l*q,P=l*V,j=0,B=s,k=0;k0)){if(rt<0){for(A=l*_,M=l*K,S=l*J,B=s,k=0;k0)for(;;){for(b=s+J*l,j=0,k=0;k0)){for(b=s+J*l,j=0,k=0;kV){t:for(;;){for(b=s+K*l,j=0,B=s,k=0;k1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},446:function(t,e,r){var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},9618:function(t,e,r){var n=r(7163),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,f=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(u+=s*(i-1),i=f(-i/h)):i=f(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(u+=l*(a-1),a=f(-a/h)):a=f(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(o-1),o=f(-o/h)):o=f(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=h*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=f*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,f,p,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],f=this.stride[3],p=this.offset,d=0,m=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(p+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof e&&((d=0|e)<0?(p+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(p+=h*(s-1),s=m(-s/d)):s=m(s/d),h*=d),"number"==typeof i&&((d=0|i)<0?(p+=f*(l-1),l=m(-l/d)):l=m(l/d),f*=d),new n(this.data,a,o,s,l,c,u,h,f,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c,u,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],f=this.shape[4],p=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),f-=s),new n(this.data,l,c,u,h,f,p,d,m,g,y,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof t&&((y=0|t)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"==typeof e&&((y=0|e)<0?(g+=f*(s-1),s=v(-s/y)):s=v(s/y),f*=y),"number"==typeof r&&((y=0|r)<0?(g+=p*(l-1),l=v(-l/y)):l=v(l/y),p*=y),"number"==typeof i&&((y=0|i)<0?(g+=d*(c-1),c=v(-c/y)):c=v(c/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,f,p,d,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===a)for(a=0,s=0;s>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var _=i[c],b=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;_[x]+=b*(y[w]*m[T]-y[T]*m[w])}}}for(o=0;oa)for(b=1/Math.sqrt(k),x=0;x<3;++x)_[x]*=b;else for(x=0;x<3;++x)_[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0,c=0;c<3;++c)f[c]*=p;i[o]=f}return i}},4081:function(t){t.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,c);h=Math.sqrt(2*f-u+1),e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},9977:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var f=h.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=l(u-=a*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*f,_=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*f);m/=_,g/=_,y/=_;var b=u*e+a*r,w=h*e+o*r,T=f*e+s*r;this.center.move(t,b,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],f=i[9],p=i[2],d=i[6],m=i[10],g=e*a+r*u,y=e*o+r*h,v=e*s+r*f,x=-(d*v-m*y),_=-(m*g-p*v),b=-(p*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(_,2)-Math.pow(b,2))),T=c(x,_,b,w);T>1e-6?(x/=T,_/=T,b/=T,w/=T):(x=_=b=0,w=1);var k=this.computedRotation,A=k[0],M=k[1],S=k[2],E=k[3],C=A*w+E*x+M*b-S*_,I=M*w+E*_+S*x-A*b,L=S*w+E*b+A*_-M*x,P=E*w-A*x-M*_-S*b;if(n){x=p,_=d,b=m;var z=Math.sin(n)/l(x,_,b);x*=z,_*=z,b*=z,P=P*(w=Math.cos(e))-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_-(L=L*w+P*b+C*_-I*x)*b}var D=c(C,I,L,P);D>1e-6?(C/=D,I/=D,L/=D,P/=D):(C=I=L=0,P=1),this.rotation.set(t,C,I,L,P)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},f.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){var n=r(3233);t.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=a[h][r],p=0;p0&&(o=d,s=m,l=h)}return i||o&&u(o,l),s}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],c=t,f=o[1],p=h(l,c,!0);if(n(e[l],e[c],e[f],e[p])<0)break;o.push(t),s=h(l,c)}return o}for(o=0;o0;){a[0][o].length;var m=f(o,p);(l=m)[1]===l[l.length-1]?d.push.apply(d,m):(d.length>0&&c.push(d),d=m)}d.length>0&&c.push(d)}return c};var n=r(3140)},5609:function(t,e,r){t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[p=o.pop()]=!1;var c=r[p];for(s=0;s0}))).length,g=new Array(m),y=new Array(m);for(p=0;p0;){var j=R.pop(),B=E[j];l(B,(function(t,e){return t-e}));var N,U=B.length,V=F[j];for(0===V&&(N=[q=d[j]]),p=0;p=0||(F[H]=1^V,R.push(H),0===V&&(O(q=d[H])||(q.reverse(),N.push(q))))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),v)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r=c?(k=1,v=c+2*f+d):v=f*(k=-f/c)+d):(k=0,p>=0?(A=0,v=d):-p>=h?(A=1,v=h+2*p+d):v=p*(A=-p/h)+d);else if(A<0)A=0,f>=0?(k=0,v=d):-f>=c?(k=1,v=c+2*f+d):v=f*(k=-f/c)+d;else{var M=1/T;v=(k*=M)*(c*k+u*(A*=M)+2*f)+A*(u*k+h*A+2*p)+d}else k<0?(_=h+p)>(x=u+f)?(b=_-x)>=(w=c-2*u+h)?(k=1,A=0,v=c+2*f+d):v=(k=b/w)*(c*k+u*(A=1-k)+2*f)+A*(u*k+h*A+2*p)+d:(k=0,_<=0?(A=1,v=h+2*p+d):p>=0?(A=0,v=d):v=p*(A=-p/h)+d):A<0?(_=c+f)>(x=u+p)?(b=_-x)>=(w=c-2*u+h)?(A=1,k=0,v=h+2*p+d):v=(k=1-(A=b/w))*(c*k+u*A+2*f)+A*(u*k+h*A+2*p)+d:(A=0,_<=0?(k=1,v=c+2*f+d):f>=0?(k=0,v=d):v=f*(k=-f/c)+d):(b=h+p-u-f)<=0?(k=0,A=1,v=h+2*p+d):b>=(w=c-2*u+h)?(k=1,A=0,v=c+2*f+d):v=(k=b/w)*(c*k+u*(A=1-k)+2*f)+A*(u*k+h*A+2*p)+d;var S=1-k-A;for(l=0;l0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||void 0===e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],p=r[2]-n[2],d=a*c,m=o*l,g=o*s,y=i*c,v=i*l,x=a*s,_=u*(d-m)+h*(g-y)+p*(v-x),b=7771561172376103e-31*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(v)+Math.abs(x))*Math.abs(p));return _>b||-_>b?_:f(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(l+=1)=n?(i=h,(l+=1)>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){var n=r(3105),i=r(4623);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var f=0;f>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},e.skeleton=h,e.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=y(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=v(t);if(!(r>=0&&e0){var t=k[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,_(t),b(),c[r]=e,_((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],m(e)),A[r]>=0&&w(A[r],m(r))}}var k=[],A=new Array(a);for(h=0;h>1;h>=0;--h)x(h);for(;;){var S=b();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&I.push([n,i])}})),i.unique(i.normalize(I)),{positions:E,edges:I}};var n=r(3250),i=r(2014)},1303:function(t,e,r){t.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f=h.length)return i;p=h[f]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},5202:function(t,e,r){var n=r(1944),i=r(8210);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(t,e,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,c,u,h,f,p=1,d=t.length,m="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?f+r+l:"0"===c?f+l+r:l+f+r)}return m}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()},3711:function(t,e,r){t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*f)/(r-n),e-.25-.25*(i+r-2*f)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*f)/(n-r),e-.25-.25*(a+n-2*f)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*f)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*f)/(i-a),e-.75-.25*(-i-r+2*f)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*f)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*f)/(i-a),e-.75-.25*(a+n-2*f)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*f)/(a-i),e-.75-.25*(-a-n+2*f)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*f)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*f)/(a-i),e-.75-.25*(i+r-2*f)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*f)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*f)/(r-n),e-.25-.25*(-a-n+2*f)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*f)/(n-r),e-.25-.25*(-i-r+2*f)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},665:function(t,e,r){var n=r(3202);t.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},7261:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||h(r),i=t.radius||1,a=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var p=t.eye,d=[p[0]-e[0],p[1]-e[1],p[2]-e[2]];o(n,d,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(d[0],d[1],d[2]);var m=l(r,d)/i,g=l(n,d)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new f(t.zoomMin,t.zoomMax,e,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t){return Math.min(1,Math.max(-1,t))}function h(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function f(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),v=Math.cos(m),x=Math.sin(m),_=this.computedCenter,b=g*v,w=y*v,T=x,k=-g*x,A=-y*x,M=v,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=b*r[a]+w*f[a]+T*e[a];E[4*a+1]=k*r[a]+A*f[a]+M*e[a],E[4*a+2]=C,E[4*a+3]=0}var I=E[1],L=E[5],P=E[9],z=E[2],D=E[6],O=E[10],R=L*O-P*D,F=P*z-I*O,j=I*D-L*z,B=c(R,F,j);for(R/=B,F/=B,j/=B,E[0]=R,E[4]=F,E[8]=j,a=0;a<3;++a)S[a]=_[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*S[N];E[12+a]=-u}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,d),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=c(u-=a*p,h-=o*p,f-=s*p),m=(u/=d)*e+a*r,g=(h/=d)*e+o*r,y=(f/=d)*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),m=Math.max(f,p,d);f===m?(s=s<0?-1:1,l=h=0):d===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=e[o],_=e[o+4],b=e[o+8],w=x*s+_*l+b*h,T=c(x-=s*w,_-=l*w,b-=h*w),k=l*(b/=T)-h*(_/=T),A=h*(x/=T)-s*b,M=s*_-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,H,G,Z),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,_,b),2===a){var E=e[1],C=e[5],I=e[9],L=E*x+C*_+I*b,P=E*k+C*A+I*M;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,L)}else{var z=e[2],D=e[6],O=e[10],R=z*s+D*l+O*h,F=z*x+D*_+O*b,j=z*k+D*A+O*M;y=Math.asin(u(R)),v=Math.atan2(j,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var B=e[2],N=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Z=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-B*W,G-N*W,Z-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,m=d[0],g=d[1],y=d[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(x=c(m=a*f-o*h,g=o*l-i*f,y=i*h-a*l))<1e-6)){m/=x,g/=x,y/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var _=a*y-o*g,b=o*m-i*y,w=i*g-a*m,T=c(_,b,w),k=i*l+a*h+o*f,A=m*l+g*h+y*f,M=(_/=T)*l+(b/=T)*h+(w/=T)*f,S=Math.asin(u(k)),E=Math.atan2(M,A),C=this.angle._state,I=C[C.length-1],L=C[C.length-2];I%=2*Math.PI;var P=Math.abs(I+2*Math.PI-E),z=Math.abs(I-E),D=Math.abs(I-2*Math.PI-E);P0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function y(t){return new Int8Array(p(t),0,t)}function v(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function _(t){return new Float32Array(p(4*t),0,t)}function b(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){f(t.buffer)},e.freeArrayBuffer=f,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return x(t);case"float":case"float32":return _(t);case"double":case"float64":return b(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=d,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=v,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=_,e.mallocFloat64=e.mallocDouble=b,e.mallocUint8Clamped=w,e.mallocBigUint64=T,e.mallocBigInt64=k,e.mallocDataView=A,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}},1755:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",b(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(T=0;T-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,l-s),n=n.replace("?px ",F())),A+=.25*C*(l-s)}if(!0===o.superscripts){var c=t.indexOf(d),h=r.indexOf(d),p=c>-1?parseInt(t[1+c]):0,m=h>-1?parseInt(r[1+h]):0;p!==m&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,m-p),n=n.replace("?px ",F())),A-=.25*C*(m-p)}if(!0===o.bolds){var g=t.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(f)>-1,_=r.indexOf(f)>-1;!x&&_&&(n="italic "+n),x&&!_&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===d||e[0]===y,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(e[0]);-1===f?n[h]+=e:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=c+o,m=r.substr(p,u-p).indexOf(i);c=-1!==m?m:u+s}return n}function _(t,e,r,i){var c=function(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,i),u=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i}))},has___:{value:x((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof m||_();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:x((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:x((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:x(t)},delete___:{value:x((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:x((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function _(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){var e,r,n,i=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u=0!=p>=0&&i.push(l[0]+.5+.5*(f+p)/(f-p)),n+=h,++l[0]}}};t.exports=(e={funcName:"zeroCrossings"},r=i.bind(void 0,e),n={},function(t,e,i){var a=t.dtype,o=t.order,s=[a,o.join()].join(),l=n[s];return l||(n[s]=l=r([a,o])),l(t.shape.slice(0),t.data,t.stride,0|t.offset,e,i)})},781:function(t,e,r){t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var i=n(1964);e.exports=i}()}}),Ld=d({"node_modules/color-name/index.js"(t,e){e.exports={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]}}}),Pd=d({"node_modules/color-rgba/node_modules/color-parse/index.js"(t,e){var r=Ld();e.exports=function(t){var e,i,a=[],o=1;if("string"==typeof t)if(t=t.toLowerCase(),r[t])a=r[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==n[t])return n[t]}return parseFloat(t)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(a=[t[0],t[1],t[2]],i="rgb",o=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(i="rgb",a=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",a=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),o=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(o/=100)):(i="rgb",a=[t>>>16,(65280&t)>>>8,255&t]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),zd=d({"node_modules/color-space/rgb.js"(t,e){e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Dd=d({"node_modules/color-space/hsl.js"(t,e){var r=zd();e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},r.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),Od=d({"node_modules/clamp/index.js"(t,e){e.exports=function(t,e,r){return er?r:t:te?e:t}}}),Rd=d({"node_modules/color-rgba/index.js"(t,e){var r=Pd(),n=Dd(),i=Od();e.exports=function(t){var e,a=r(t);return a.space?((e=Array(3))[0]=i(a.values[0],0,255),e[1]=i(a.values[1],0,255),e[2]=i(a.values[2],0,255),"h"===a.space[0]&&(e=n.rgb(e)),e.push(i(a.alpha,0,1)),e):[]}}}),Fd=d({"node_modules/dtype/index.js"(t,e){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),jd=d({"node_modules/color-normalize/index.js"(t,e){var r=Rd(),n=Od(),i=Fd();e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var a=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=r(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=null!=t[3]?t[3]:255,o&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(o?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=null!=t[3]?t[3]:1):(a[0]=n(Math.floor(255*t[0]),0,255),a[1]=n(Math.floor(255*t[1]),0,255),a[2]=n(Math.floor(255*t[2]),0,255),a[3]=null==t[3]?255:n(Math.floor(255*t[3]),0,255)),a)}}}),Bd=d({"src/lib/str2rgbarray.js"(t,e){var r=jd();e.exports=function(t){return t?r(t):[0,0,0,1]}}}),Nd=d({"src/lib/gl_format_color.js"(t,e){var r=T(),n=D(),i=jd(),a=Ze(),o=V().defaultLine,s=S().isArrayOrTypedArray,l=i(o);function c(t,e){var r=t;return r[3]*=e,r}function u(t){if(r(t))return l;var e=i(t);return e.length?e:l}function h(t){return r(t)?t:1}e.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var o,f,p,d,m,g=s(n),y=s(e),v=a.extractOpts(t),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(t):u,f=g?function(t,e){return void 0===t[e]?l:i(o(t[e]))}:u,p=y?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||y)for(var _=0;_0){var f=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=f),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,f)}}else o[s]=[-l[0]*n,l[1]*n]}return o}e.exports=function(t,e,r){var i=[n(t.x,t.error_x,e[0],r.xaxis),n(t.y,t.error_y,e[1],r.yaxis),n(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function b(t){return f[t]}function w(t,e,r,n,i){var a=null;if(s.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n=0&&h("surfacecolor",p||d);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(t,e,p||d||c,{axis:"z"}),v(t,e,p||d||c,{axis:"y",inherit:"z"}),v(t,e,p||d||c,{axis:"x",inherit:"z"})}else e.visible=!1}}}),Wd=d({"src/traces/scatter3d/calc.js"(t,e){var r=ni(),n=ri();e.exports=function(t,e){var i=[{x:!1,y:!1,trace:e,t:{}}];return r(i,e),n(t,e),i}}}),Yd=d({"node_modules/get-canvas-context/index.js"(t,e){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o/g," "));l[c]=p,u.tickmode=h}}for(e.ticks=l,c=0;c<3;++c)for(a[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!l&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},T.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),h=null,d=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(k.valueLabel=f.hoverLabelText(e._mockAxis,e._mockAxis.d2l(d.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+k.valueLabel),d.textLabel&&E.push(d.textLabel),_=E.join("
")):_=d.textLabel;var C={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};p.appendArrayPointValue(C,w,T),t._module.eventData&&(C=w._module.eventData(C,d,w,{},T));var I={points:[C]};if(e.fullSceneLayout.hovermode){var L=[];p.loneHover({trace:w,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:_,name:h.name,color:p.castHoverOption(w,T,"bgcolor")||h.color,borderColor:p.castHoverOption(w,T,"bordercolor"),fontFamily:p.castHoverOption(w,T,"font.family"),fontSize:p.castHoverOption(w,T,"font.size"),fontColor:p.castHoverOption(w,T,"font.color"),nameLength:p.castHoverOption(w,T,"namelength"),textAlign:p.castHoverOption(w,T,"align"),hovertemplate:u.castOption(w,T,"hovertemplate"),hovertemplateLabels:u.extendFlat({},C,k),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}d.distance<5&&(d.buttons||b)?r.emit("plotly_click",I):r.emit("plotly_hover",I),this.oldEventData=I}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var A=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=A[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],h=e["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var f,p=0;p<(h||l.length);p++)if(u.isArrayOrTypedArray(l[p]))for(var d=0;dy[1][o])y[0][o]=-1,y[1][o]=1;else{var P=y[1][o]-y[0][o];y[0][o]-=P/32,y[1][o]+=P/32}if(b=[y[0][o],y[1][o]],b=_(b,l),y[0][o]=b[0],y[1][o]=b[1],l.isReversed()){var z=y[0][o];y[0][o]=y[1][o],y[1][o]=z}}else b=l.range,y[0][o]=l.r2l(b[0]),y[1][o]=l.r2l(b[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),v[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var D=u.aspectmode;if("cube"===D)g=[1,1,1];else if("manual"===D){var O=u.aspectratio;g=[O.x,O.y,O.z]}else{if("auto"!==D&&"data"!==D)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(o=0;o<3;++o){var F=x[c=(l=u[A[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/p[o]}g="data"===D||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=g[0],u.aspectratio.y=h.aspectratio.y=g[1],u.aspectratio.z=h.aspectratio.z=g[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var j=u.domain||null,B=e._size||null;if(j&&B){var N=n.container.style;N.position="absolute",N.left=B.l+j.x[0]*B.w+"px",N.top=B.t+(1-j.y[1])*B.h+"px",N.width=B.w*(j.x[1]-j.x[0])+"px",N.height=B.h*(j.y[1]-j.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},T.getCamera=function(){var t,e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),{up:{x:(t=e.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},T.setViewport=function(t){var e,r=this,n=t.camera;r.camera.lookAt.apply(this,[[(e=n).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),r.glplot.setAspectratio(t.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},T.isCameraChanged=function(t){var e,r,n,i,a,o,s=this.getCamera(),l=u.nestedProperty(t,this.id+".camera").get(),c=!1;if(void 0===l)c=!0;else{for(var h=0;h<3;h++)for(var f=0;f<3;f++)if(e=s,i=f,a=void 0,o=void 0,o=["x","y","z"],!(r=l)[(a=["up","center","eye"])[n=h]]||e[a[n]][o[i]]!==r[a[n]][o[i]]){c=!0;break}(!l.projection||s.projection&&s.projection.type!==l.projection.type)&&(c=!0)}return c},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=u.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},T.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(t),f=s.isAspectChanged(t),p=h||f;if(p){var d={};h&&(e=s.getCamera(),n=(r=u.nestedProperty(t,s.id+".camera")).get(),d[s.id+".camera"]=n),f&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(t,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,d),h&&(r.set(e),u.nestedProperty(l,s.id+".camera").set(e)),f&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},T.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var f=r.id+".camera.up",p={x:0,y:0,z:1},d={};d[f]=p;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,d),o.up=p,u.nestedProperty(m,f).set(p)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},T.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(r),e.glplot.redraw();var n=e.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(r),l},T.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[A[t]];f.setConvert(e,this.fullLayout),e.setScale=u.noop}},T.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(t._mockAxis,e)},e.exports=w}}),em=d({"src/plots/gl3d/layout/attributes.js"(t,e){e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),rm=d({"src/plots/gl3d/layout/axis_attributes.js"(t,e){var r=q(),n=Ce(),i=O().extendFlat,a=Lt().overrideAll;e.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),nm=d({"src/plots/gl3d/layout/layout_attributes.js"(t,e){var r=rm(),n=Ta().attributes,i=O().extendFlat,a=se().counterRegex;function o(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),im=d({"src/plots/gl3d/layout/axis_defaults.js"(t,e){var r=D().mix,n=se(),i=ge(),a=rm(),o=xi(),s=wi(),l=["xaxis","yaxis","zaxis"],c=13600/187;e.exports=function(t,e,u){var h,f;function p(t,e){return n.coerce(h,f,a,t,e)}for(var d=0;d.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}e.exports=function(t,e,n){var i=e._basePlotModules.length>1;a(t,e,n,{type:c,attributes:s,handleDefaults:u,fullLayout:e,font:e.font,fullData:n,getDfltFromLayout:function(e){if(!i)return r.validate(t[e],s[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}}}),om=d({"src/plots/gl3d/index.js"(t){var e=Lt().overrideAll,r=j(),n=tm(),i=be().getSubplotData,a=se(),o=ke(),s="gl3d",l="scene";t.name=s,t.attr=l,t.idRoot=l,t.idRegex=t.attrRegex=a.counterRegex("scene"),t.attributes=em(),t.layoutAttributes=nm(),t.baseLayoutAttrOverrides=e({hoverlabel:r.hoverlabel},"plot","nested"),t.supplyLayoutDefaults=am(),t.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=e._subplots[s],o=0;o0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;a_;)r--,r/=g(r),++r1?n:1},f.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,i=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/e,0,0,0,1/r,0,0,0,1],f=0;f0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];es&&(this.minValues[e]=s),this.maxValues[e]l&&(e.isomin=null,e.isomax=null);var c=o("x"),u=o("y"),h=o("z"),f=o("value");c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length?(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach((function(t){o(t+"hoverformat");var e="caps."+t;o(e+".show")&&o(e+".fill");var r="slices."+t;o(r+".show")&&(o(r+".fill"),o(r+".locations"))})),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){o(t)})),a(t,e,i,o,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,n,a){o(t,e,0,a,(function(n,a){return r.coerce(t,e,i,n,a)}))},supplyIsoDefaults:o}}}),vm=d({"src/traces/streamtube/calc.js"(t,e){var r=se(),n=Ge();function i(t){var e,n,i,o,s,l,c,u,h,f,p,d,m=t._x,g=t._y,y=t._z,v=t._len,x=-1/0,_=1/0,b=-1/0,w=1/0,T=-1/0,k=1/0,A="";for(v&&(c=m[0],h=g[0],p=y[0]),v>1&&(u=m[v-1],f=g[v-1],d=y[v-1]),e=0;eu?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var C=function(){v=0,M=[],S=[],E=[]};(!v||v0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){I();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:C(d,m,y);f[p]=x>-1?x:P(d,m,y,R(e,v))}i=f[0],a=f[1],o=f[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function j(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function N(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return N(e[0][3])&&N(e[1][3])&&N(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=j(f,u,n,i),d=j(f,h,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,h,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=j(h,u,n,i),d=j(f,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(t,e,r,n){var i=!1,a=U(e),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]];if(m)i=F(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=j(f,c,r,n),d=j(f,u,r,n),g=j(f,h,r,n);i=F(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(h,c,r,n),d=j(h,u,r,n),g=j(f,u,r,n),y=j(f,c,r,n);m?(i=F(t,[c,y,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(u,c,r,n),d=j(h,c,r,n),g=j(f,c,r,n);m?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,g],[-1,-1,-1])||i,s=!0}}))),i}function H(t,e,r,n,i,a,o,s,l,c,u){var h=!1;return d&&(O(t,"A")&&(h=q(null,[e,r,n,a],c,u)||h),O(t,"B")&&(h=q(null,[r,n,i,l],c,u)||h),O(t,"C")&&(h=q(null,[r,a,o,l],c,u)||h),O(t,"D")&&(h=q(null,[n,a,s,l],c,u)||h),O(t,"E")&&(h=q(null,[r,n,a,l],c,u)||h)),m&&(h=q(t,[r,n,a,l],c,u)||h),h}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Z(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,h=!1,f=function(){h=V(t,[s,l,c],[-1,-1,-1],i,a)||h,h=V(t,[c,u,s],[-1,-1,-1],i,a)||h},p=o[0],d=o[1],m=o[2];return p&&(s=z(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=z(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=z(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=z(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),f()),d&&(s=z(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=z(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=z(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=z(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),f()),m&&(s=z(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],m),l=z(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],m),c=z(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],m),u=z(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],m),f()),h}function Y(t,e,r,n,i,a,o,s,l,c,u,h){var f=t;return h?(d&&"even"===t&&(f=null),H(f,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(f=null),H(f,l,s,o,a,i,n,r,e,c,u))}function X(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(T-M)?[A,T]:[T,M];Q(r,C[0],C[1])}}var I=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(h.push(d.id),"x"===r?f.push([d.distRatio,0,0]):"y"===r?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=nt(1,"x"===r?_-1:"y"===r?b-1:w-1);h.length>0&&(n[a]="x"===r?tt(e,h,o,s,f,n[a]):"y"===r?et(e,h,o,s,f,n[a]):rt(e,h,o,s,f,n[a]),a++),u.length>0&&(n[a]="x"===r?X(e,u,o,s,n[a]):"y"===r?$(e,u,o,s,n[a]):K(e,u,o,s,n[a]),a++)}var m=t.caps[r];m.show&&m.fill&&(D(m.fill),n[a]="x"===r?X(e,[0,_-1],o,s,n[a]):"y"===r?$(e,[0,b-1],o,s,n[a]):K(e,[0,w-1],o,s,n[a]),a++)}})),0===g&&L(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}}),wm=d({"src/traces/isosurface/index.js"(t,e){e.exports={attributes:gm(),supplyDefaults:ym().supplyDefaults,calc:xm(),colorbar:{min:"cmin",max:"cmax"},plot:bm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:om(),categories:["gl3d","showLegend"],meta:{}}}}),Tm=d({"lib/isosurface.js"(t,e){e.exports=wm()}}),km=d({"src/traces/volume/attributes.js"(t,e){var r=Le(),n=gm(),i=cm(),a=N(),o=O().extendFlat,s=Lt().overrideAll,l=e.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),Am=d({"src/traces/volume/defaults.js"(t,e){var r=se(),n=km(),i=ym().supplyIsoDefaults,a=um().opacityscaleDefaults;e.exports=function(t,e,o,s){function l(i,a){return r.coerce(t,e,n,i,a)}i(t,e,o,s,l),a(t,e,s,l)}}}),Mm=d({"src/traces/volume/convert.js"(t,e){var r=Id().gl_mesh3d,n=Nd().parseColorScale,i=se().isArrayOrTypedArray,a=Bd(),o=Ze().extractOpts,s=_m(),l=bm().findNearestOnAxis,c=bm().generateIsoMeshes;function u(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=t.index=h+s*u+s*o*c;t.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[f]?t.textLabel=p[f]:p&&(t.textLabel=p),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=c(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},u=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(t),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),Sm=d({"src/traces/volume/index.js"(t,e){e.exports={attributes:km(),supplyDefaults:Am(),calc:xm(),colorbar:{min:"cmin",max:"cmax"},plot:Mm(),moduleType:"trace",name:"volume",basePlotModule:om(),categories:["gl3d","showLegend"],meta:{}}}}),Em=d({"lib/volume.js"(t,e){e.exports=Sm()}}),Cm=d({"src/traces/mesh3d/defaults.js"(t,e){var r=Vt(),n=se(),i=Ve(),a=mm();e.exports=function(t,e,o,s){function l(r,i){return n.coerce(t,e,a,r,i)}function c(t){var e=t.map((function(t){var e=l(t);return e&&n.isArrayOrTypedArray(e)?e:null}));return e.every((function(t){return t&&t.length===e[0].length}))&&e}c(["x","y","z"])?(c(["i","j","k"]),(!e.i||e.j&&e.k)&&(!e.j||e.k&&e.i)&&(!e.k||e.i&&e.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach((function(t){l(t)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in t?(l("intensity"),l("intensitymode"),i(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),e._length=null):e.visible=!1):e.visible=!1}}}),Im=d({"src/traces/mesh3d/calc.js"(t,e){var r=Ge();e.exports=function(t,e){e.intensity&&r(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}}}),Lm=d({"src/traces/mesh3d/convert.js"(t,e){var r=Id().gl_mesh3d,n=Id().delaunay_triangulate,i=Id().alpha_shape,a=Id().convex_hull,o=Nd().parseColorScale,s=se().isArrayOrTypedArray,l=Bd(),c=Ze().extractOpts,u=_m();function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var s,h=t.x.length,f=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;s=u(m(t.i),m(t.j),m(t.k))}else s=0===t.alphahull?a(f):t.alphahull>0?i(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),i=[],a=e.length,o=0;o2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function f(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var n=t.fullSceneLayout,c=t.dataScale,u=e._len,p={};function d(t,e){var r=n[e],a=c[l[e]];return i.simpleMap(t,(function(t){return r.d2l(t)*a}))}if(p.vectors=s(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(p.meshgrid=[m,g,y],p.gridFill=e._gridFill,e._slen)p.startingPositions=s(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),_=h(y),b=new Array(x.length*_.length),w=0,T=0;To&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}function c(t){t.forEach(l)}function u(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":c(t.arcs)}}return u(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function c(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be ≥2");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(e),f=t.objects,p={};function d(t){return h(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in f)p[c]=m(f[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=h(t[0],0);++r0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},t.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},t.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r0?t>180?t-360:t:t<-180?t+360:t},t.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},t.convertArea=function(t,e="meters",r="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");const i=n[e];if(!i)throw new Error("invalid original units");const a=n[r];if(!a)throw new Error("invalid final units");return t/i*a},t.convertLength=function(t,e="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return f(p(t,e),r)},t.degreesToRadians=function(t){return t%360*Math.PI/180},t.earthRadius=e,t.factors=r,t.feature=i,t.featureCollection=l,t.geometry=function(t,e,r={}){switch(t){case"Point":return a(e).geometry;case"LineString":return s(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return c(e).geometry;case"MultiPolygon":return h(e).geometry;default:throw new Error(t+" is invalid")}},t.geometryCollection=function(t,e,r={}){return i({type:"GeometryCollection",geometries:t},e,r)},t.isNumber=m,t.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},t.lengthToDegrees=function(t,e){return d(p(t,e))},t.lengthToRadians=p,t.lineString=s,t.lineStrings=function(t,e,r={}){return l(t.map((t=>s(t,e))),r)},t.multiLineString=c,t.multiPoint=u,t.multiPolygon=h,t.point=a,t.points=function(t,e,r={}){return l(t.map((t=>a(t,e))),r)},t.polygon=o,t.polygons=function(t,e,r={}){return l(t.map((t=>o(t,e))),r)},t.radiansToDegrees=d,t.radiansToLength=f,t.round=function(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const r=Math.pow(10,e||0);return Math.round(t*r)/r},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((t=>{if(!m(t))throw new Error("bbox must only contain numbers")}))},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}}),eg=d({"node_modules/@turf/meta/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=tg();function r(t,e,n){if(null!==t)for(var i,a,o,s,l,c,u,h,f=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;vc||p>u||d>h)return l=r,c=i,u=p,h=d,void(o=0);var m=e.lineString.call(void 0,[l,r],t.properties);if(!1===n(m,i,a,d,o))return!1;o++,l=r}))&&void 0}}}))}function l(t,r){if(!t)throw new Error("geojson is required");o(t,(function(t,n,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===r(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;st+function(t){let e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e0){e+=Math.abs(s(t[0]));for(let r=1;r=e?(n+2)%e:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;t.area=n,t.default=l}}),ng=d({"node_modules/@turf/centroid/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=tg(),r=eg();function n(t,n={}){let i=0,a=0,o=0;return r.coordEach.call(void 0,t,(function(t){i+=t[0],a+=t[1],o++}),!0),e.point.call(void 0,[i/o,a/o],n.properties)}var i=n;t.centroid=n,t.default=i}}),ig=d({"node_modules/@turf/bbox/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=eg();function r(t,r={}){if(null!=t.bbox&&!0!==r.recompute)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return e.coordEach.call(void 0,t,(t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r0?h.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;so&&(o=c,e=l)}else e=r;return a(e).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=t,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o")}function p(t){return t+"°"}}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}}}),cg=d({"src/traces/scattergeo/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t}}}),ug=d({"src/traces/scattergeo/select.js"(t,e){var r=We(),n=k().BADNUM;e.exports=function(t,e){var i,a,o,s,l,c=t.cd,u=t.xaxis,h=t.yaxis,f=[],p=c[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(!1===e)for(l=0;le?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function b(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function k(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function A(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,M),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;ah;)f.pop(),--p;var d,m=new Array(p+1);for(a=0;a<=p;++a)(d=m[a]=[]).x0=a>0?f[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s0?1:t<0?-1:0},k=Math.sqrt,A=Math.tan;function M(t){return t>1?0:t<-1?l:Math.acos(t)}function S(t){return t>1?c:t<-1?-c:Math.asin(t)}function E(t){return(t=w(t/2))*t}function C(){}function I(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var L={Feature:function(t,e){I(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=y(e=(e*=p)/2+u),o=w(e),s=N*o,l=B*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),j=t,B=a,N=o}function Y(t){return[g(t[1],t[0]),S(t[2])]}function X(t){var e=t[0],r=t[1],n=y(r);return[n*y(e),n*w(e),w(r)]}function $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function K(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function J(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=k(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,rt,nt,it,at,ot,st,lt,ct,ut,ht,ft,pt,dt,mt,gt,yt,vt,xt,_t,bt,wt,Tt,kt,At,Mt,St=r(),Et={point:Ct,lineStart:Lt,lineEnd:Pt,polygonStart:function(){Et.point=zt,Et.lineStart=Dt,Et.lineEnd=Ot,St.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),Et.point=Ct,Et.lineStart=Lt,Et.lineEnd=Pt,U<0?(et=-(nt=180),rt=-(it=90)):St>o?it=90:St<-o&&(rt=-90),ut[0]=et,ut[1]=nt},sphere:function(){et=-(nt=180),rt=-(it=90)}};function Ct(t,e){ct.push(ut=[et=t,nt=t]),eit&&(it=e)}function It(t,e){var r=X([t*p,e*p]);if(lt){var n=K(lt,r),i=K([n[1],-n[0],0],n);tt(i),i=Y(i);var a,o=t-at,s=o>0?1:-1,l=i[0]*f*s,c=d(o)>180;c^(s*atit&&(it=a):c^(s*at<(l=(l+360)%360-180)&&lit&&(it=e)),c?tRt(et,nt)&&(nt=t):Rt(t,nt)>Rt(et,nt)&&(et=t):nt>=et?(tnt&&(nt=t)):t>at?Rt(et,t)>Rt(et,nt)&&(nt=t):Rt(t,nt)>Rt(et,nt)&&(et=t)}else ct.push(ut=[et=t,nt=t]);eit&&(it=e),lt=r,at=t}function Lt(){Et.point=It}function Pt(){ut[0]=et,ut[1]=nt,Et.point=Ct,lt=null}function zt(t,e){if(lt){var r=t-at;St.add(d(r)>180?r+(r>0?360:-360):r)}else ot=t,st=e;q.point(t,e),It(t,e)}function Dt(){q.lineStart()}function Ot(){zt(ot,st),q.lineEnd(),d(St)>o&&(et=-(nt=180)),ut[0]=et,ut[1]=nt,lt=null}function Rt(t,e){return(e-=t)<0?e+360:e}function Ft(t,e){return t[0]-e[0]}function jt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:el?t+Math.round(-t/h)*h:t,e]}function Qt(t,e,r){return(t%=h)?e||r?Kt(ee(t),re(e,r)):ee(t):e||r?re(e,r):Jt}function te(t){return function(e,r){return[(e+=t)>l?e-h:e<-l?e+h:e,r]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function re(t,e){var r=y(t),n=w(t),i=y(e),a=w(e);function o(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),S(u*i+l*a)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),S(u*r-s*n)]},o}function ne(t){function e(e){return(e=t(e[0]*p,e[1]*p))[0]*=f,e[1]*=f,e}return t=Qt(t[0]*p,t[1]*p,t.length>2?t[2]*p:0),e.invert=function(e){return(e=t.invert(e[0]*p,e[1]*p))[0]*=f,e[1]*=f,e},e}function ie(t,e,r,n,i,a){if(r){var o=y(e),s=w(e),l=n*r;null==i?(i=e+n*h,a=e-l/2):(i=ae(o,i),a=ae(o,a),(n>0?ia)&&(i+=n*h));for(var c,u=i;n>0?u>a:u1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function se(t,e){return d(t[0]-e[0])=0;--a)i.point((u=c[a])[0],u[1]);else n(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function ue(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,D=z*P,O=D>l,R=T*I;if(he.add(g(R*z*w(D),k*L+R*y(D))),s+=O?P+z*h:P,O^_>=r^E>=r){var F=K(X(x),X(M));tt(F);var j=K(a,F);tt(j);var B=(O^P>=0?-1:1)*S(j[2]);(n>B||n===B&&(F[0]||F[1]))&&(f+=O^P>=0?1:-1)}}return(s<-o||s0){for(f||(a.polygonStart(),f=!0),a.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(me))}return p}}function me(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-c-o:c-t[1])-((e=e.x)[0]<0?e[1]-c-o:c-e[1])}var ye=de((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,s){var u=a>0?l:-l,h=d(a-r);d(h-l)0?c:-c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&h>=l&&(d(r-i)o?m((w(e)*(a=y(n))*w(r)-w(n)*(i=y(e))*w(t))/(i*a*s)):(e+n)/2}(r,n,a,s),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=s),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(d(t[0]-e[0])>o){var a=t[0]0,i=d(e)>o;function a(t,r){return y(t)*y(r)>e}function s(t,r,n){var i=[1,0,0],a=K(X(t),X(r)),s=$(a,a),c=a[0],u=s-c*c;if(!u)return!n&&t;var h=e*s/u,f=-e*c/u,p=K(i,a),m=Q(i,h);J(m,Q(a,f));var g=p,y=$(m,g),v=$(g,g),x=y*y-v*($(m,m)-1);if(!(x<0)){var _=k(x),b=Q(g,(-y-_)/v);if(J(b,m),b=Y(b),!n)return b;var w,T=t[0],A=r[0],M=t[1],S=r[1];A0^b[1]<(d(b[0]-T)l^(T<=b[0]&&b[0]<=A)){var I=Q(g,(-y+_)/v);return J(I,m),[b,Y(I)]}}}function c(e,r){var i=n?t:l-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return de(a,(function(t){var e,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(f,p){var d,m=[f,p],g=a(f,p),y=n?g?0:c(f,p):g?c(f+(f<0?l:-l),p):0;if(!e&&(u=o=g)&&t.lineStart(),g!==o&&(!(d=s(e,m))||se(e,d)||se(m,d))&&(m[2]=1),g!==o)h=0,g?(t.lineStart(),d=s(m,e),t.point(d[0],d[1])):(d=s(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^g){var v;y&r||!(v=s(m,e,!0))||(h=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&se(e,m)||t.point(m[0],m[1]),e=m,o=g,r=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return h|(u&&o)<<1}}}),(function(e,n,i,a){ie(a,t,r,i,e,n)}),n?[0,-t]:[-l,t-l])}var xe=1e9,_e=-xe;function be(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,h=0;if(null==e||(c=l(e,o))!==(h=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(e,i){return d(e[0]-t)0?0:3:d(e[0]-n)0?2:1:d(e[1]-r)0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(o){var l,u,h,f,p,d,m,g,y,v,x,_=o,b=oe(),w={point:T,lineStart:function(){w.point=k,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(k(f,p),d&&y&&b.rejoin(),l.push(b.result())),w.point=T,y&&_.lineEnd()},polygonStart:function(){_=b,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ri&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ce(l,c,r,s,o),o.polygonEnd()),_=o,l=u=h=null}};function T(t,e){a(t,e)&&_.point(t,e)}function k(e,o){var s=a(e,o);if(u&&h.push([e,o]),v)f=e,p=o,d=s,v=!1,s&&(_.lineStart(),_.point(e,o));else if(s&&y)_.point(e,o);else{var l=[m=Math.max(_e,Math.min(xe,m)),g=Math.max(_e,Math.min(xe,g))],c=[e=Math.max(_e,Math.min(xe,e)),o=Math.max(_e,Math.min(xe,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,c,t,r,n,i)?s&&(_.lineStart(),_.point(e,o),x=!1):(y||(_.lineStart(),_.point(l[0],l[1])),_.point(c[0],c[1]),s||_.lineEnd(),x=!1)}m=e,g=o,y=s}return w}}var we,Te,ke,Ae=r(),Me={sphere:C,point:C,lineStart:function(){Me.point=Ee,Me.lineEnd=Se},lineEnd:C,polygonStart:C,polygonEnd:C};function Se(){Me.point=Me.lineEnd=C}function Ee(t,e){we=t*=p,Te=w(e*=p),ke=y(e),Me.point=Ce}function Ce(t,e){t*=p;var r=w(e*=p),n=y(e),i=d(t-we),a=y(i),o=n*w(i),s=ke*r-Te*n*a,l=Te*r+ke*n*a;Ae.add(g(k(o*o+s*s),l)),we=t,Te=r,ke=n}function Ie(t){return Ae.reset(),O(t,Me),+Ae}var Le=[null,null],Pe={type:"LineString",coordinates:Le};function ze(t,e){return Le[0]=t,Le[1]=e,Ie(Pe)}var De={Feature:function(t,e){return Re(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=ze(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))o})).map(u)).concat(e.range(v(s/g)*g,a,g).filter((function(t){return d(t%x)>o})).map(h))}return b.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(p(l).slice(1),f(n).reverse().slice(1),p(c).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),b.precision(_)):[[i,c],[n,l]]},b.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),b.precision(_)):[[r,s],[t,a]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],b):[y,x]},b.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],b):[m,g]},b.precision=function(e){return arguments.length?(_=+e,u=Ve(s,a,90),h=qe(r,t,_),f=Ve(c,l,90),p=qe(i,n,_),b):_},b.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Ge(t){return t}var Ze,We,Ye,Xe,$e=r(),Ke=r(),Je={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Je.lineStart=Qe,Je.lineEnd=rr},polygonEnd:function(){Je.lineStart=Je.lineEnd=Je.point=C,$e.add(d(Ke)),Ke.reset()},result:function(){var t=$e/2;return $e.reset(),t}};function Qe(){Je.point=tr}function tr(t,e){Je.point=er,Ze=Ye=t,We=Xe=e}function er(t,e){Ke.add(Xe*t-Ye*e),Ye=t,Xe=e}function rr(){er(Ze,We)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(t,e){tcr&&(cr=t),eur&&(ur=e)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var t=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),t}},fr=0,pr=0,dr=0,mr=0,gr=0,yr=0,vr=0,xr=0,_r=0,br={point:wr,lineStart:Tr,lineEnd:Mr,polygonStart:function(){br.lineStart=Sr,br.lineEnd=Er},polygonEnd:function(){br.point=wr,br.lineStart=Tr,br.lineEnd=Mr},result:function(){var t=_r?[vr/_r,xr/_r]:yr?[mr/yr,gr/yr]:dr?[fr/dr,pr/dr]:[NaN,NaN];return fr=pr=dr=mr=gr=yr=vr=xr=_r=0,t}};function wr(t,e){fr+=t,pr+=e,++dr}function Tr(){br.point=kr}function kr(t,e){br.point=Ar,wr(ar=t,or=e)}function Ar(t,e){var r=t-ar,n=e-or,i=k(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,wr(ar=t,or=e)}function Mr(){br.point=wr}function Sr(){br.point=Cr}function Er(){Ir(nr,ir)}function Cr(t,e){br.point=Ir,wr(nr=ar=t,ir=or=e)}function Ir(t,e){var r=t-ar,n=e-or,i=k(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,vr+=(i=or*t-ar*e)*(ar+t),xr+=i*(or+e),_r+=3*i,wr(ar=t,or=e)}function Lr(t){this._context=t}Lr.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,h)}},result:C};var Pr,zr,Dr,Or,Rr,Fr=r(),jr={point:C,lineStart:function(){jr.point=Br},lineEnd:function(){Pr&&Nr(zr,Dr),jr.point=C},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var t=+Fr;return Fr.reset(),t}};function Br(t,e){jr.point=Nr,zr=Or=t,Dr=Rr=e}function Nr(t,e){Or-=t,Rr-=e,Fr.add(k(Or*Or+Rr*Rr)),Or=t,Rr=e}function Ur(){this._string=[]}function Vr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function qr(t){return function(e){var r=new Hr;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Hr(){}function Gr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),O(r,t.stream(hr)),e(hr.result()),null!=n&&t.clipExtent(n),t}function Zr(t,e,r){return Gr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function Wr(t,e,r){return Zr(t,[[0,0],e],r)}function Yr(t,e,r){return Gr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Xr(t,e,r){return Gr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Hr.prototype={constructor:Hr,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var $r=y(30*p);function Kr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,h,f,p,m,y,v,x){var _=u-n,b=h-i,w=_*_+b*b;if(w>4*e&&v--){var T=s+p,A=l+m,M=c+y,E=k(T*T+A*A+M*M),C=S(M/=E),I=d(d(M)-1)e||d((_*D+b*O)/w-.5)>.3||s*p+l*m+c*y<$r)&&(r(n,i,a,s,l,c,P,z,I,T/=E,A/=E,M,v,x),x.point(P,z),r(P,z,I,T,A,M,u,h,f,p,m,y,v,x))}}return function(e){var n,i,a,o,s,l,c,u,h,f,p,d,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){u=NaN,m.point=v,e.lineStart()}function v(n,i){var a=X([n,i]),o=t(n,i);r(u,h,c,f,p,d,u=o[0],h=o[1],c=n,f=a[0],p=a[1],d=a[2],16,e),e.point(u,h)}function x(){m.point=g,e.lineEnd()}function _(){y(),m.point=b,m.lineEnd=w}function b(t,e){v(n=t,e),i=u,a=h,o=f,s=p,l=d,m.point=v}function w(){r(u,h,c,f,p,d,i,a,n,o,s,l,16,e),m.lineEnd=x,x()}return m}}(t,e):function(t){return qr({point:function(e,r){e=t(e,r),this.stream.point(e[0],e[1])}})}(t)}var Jr=qr({point:function(t,e){this.stream.point(t*p,e*p)}});function Qr(t,e,r,n,i){function a(a,o){return[e+t*(a*=n),r-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*n,(r-o)/t*i]},a}function tn(t,e,r,n,i,a){var o=y(a),s=w(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*r-o*e)/t,p=(s*e+o*r)/t;function d(t,a){return[l*(t*=n)-c*(a*=i)+e,r-c*t-l*a]}return d.invert=function(t,e){return[n*(u*t-h*e+f),i*(p-h*t-u*e)]},d}function en(t){return rn((function(){return t}))()}function rn(t){var e,r,n,i,a,o,s,l,c,u,h=150,d=480,m=250,g=0,y=0,v=0,x=0,_=0,b=0,w=1,T=1,A=null,M=ye,S=null,E=Ge,C=.5;function I(t){return l(t[0]*p,t[1]*p)}function L(t){return(t=l.invert(t[0],t[1]))&&[t[0]*f,t[1]*f]}function P(){var t=tn(h,0,0,w,T,b).apply(null,e(g,y)),n=(b?tn:Qr)(h,d-t[0],m-t[1],w,T,b);return r=Qt(v,x,_),s=Kt(e,n),l=Kt(r,s),o=Kr(s,C),z()}function z(){return c=u=null,I}return I.stream=function(t){return c&&u===t?c:c=Jr(function(t){return qr({point:function(e,r){var n=t(e,r);return this.stream.point(n[0],n[1])}})}(r)(M(o(E(u=t)))))},I.preclip=function(t){return arguments.length?(M=t,A=void 0,z()):M},I.postclip=function(t){return arguments.length?(E=t,S=n=i=a=null,z()):E},I.clipAngle=function(t){return arguments.length?(M=+t?ve(A=t*p):(A=null,ye),z()):A*f},I.clipExtent=function(t){return arguments.length?(E=null==t?(S=n=i=a=null,Ge):be(S=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),z()):null==S?null:[[S,n],[i,a]]},I.scale=function(t){return arguments.length?(h=+t,P()):h},I.translate=function(t){return arguments.length?(d=+t[0],m=+t[1],P()):[d,m]},I.center=function(t){return arguments.length?(g=t[0]%360*p,y=t[1]%360*p,P()):[g*f,y*f]},I.rotate=function(t){return arguments.length?(v=t[0]%360*p,x=t[1]%360*p,_=t.length>2?t[2]%360*p:0,P()):[v*f,x*f,_*f]},I.angle=function(t){return arguments.length?(b=t%360*p,P()):b*f},I.reflectX=function(t){return arguments.length?(w=t?-1:1,P()):w<0},I.reflectY=function(t){return arguments.length?(T=t?-1:1,P()):T<0},I.precision=function(t){return arguments.length?(o=Kr(s,C=t*t),z()):k(C)},I.fitExtent=function(t,e){return Zr(I,t,e)},I.fitSize=function(t,e){return Wr(I,t,e)},I.fitWidth=function(t,e){return Yr(I,t,e)},I.fitHeight=function(t,e){return Xr(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&L,P()}}function nn(t){var e=0,r=l/3,n=rn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*p,r=t[1]*p):[e*f,r*f]},i}function an(t,e){var r=w(t),n=(r+w(e))/2;if(d(n)0?e<-c+o&&(e=-c+o):e>c-o&&(e=c-o);var r=i/b(dn(e),n);return[r*w(n*t),i-r*y(n*t)]}return a.invert=function(t,e){var r=i-e,a=T(n)*k(t*t+r*r),o=g(t,d(r))*T(r);return r*n<0&&(o-=l*T(t)*T(r)),[o/n,2*m(b(i/a,1/n))-c]},a}function gn(t,e){return[t,e]}function yn(t,e){var r=y(t),n=t===e?w(t):(r-y(e))/(e-t),i=r/n+t;if(d(n)o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Mn.invert=cn(S),Sn.invert=cn((function(t){return 2*m(t)})),En.invert=function(t,e){return[-e,2*m(x(t))-c]},t.geoAlbers=sn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function h(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,h}return h.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},h.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++rRt(n[0],n[1])&&(n[1]=i[1]),Rt(i[0],n[1])>Rt(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Rt(n[1],i[0]))>o&&(o=s,et=i[0],nt=n[1])}return ct=ut=null,et===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,rt],[nt,it]]},t.geoCentroid=function(t){ht=ft=pt=dt=mt=gt=yt=vt=xt=_t=bt=0,O(t,Bt);var e=xt,r=_t,n=bt,i=e*e+r*r+n*n;return i2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=En,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?o(t,hg()):(i=[t,r(882)],void 0===(a="function"==typeof(n=o)?n.apply(t,i):n)||(e.exports=a))}}),pg=d({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(t,e){var o;o=function(t,e,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,f=Math.pow,p=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,_=x/2,b=x/4,w=Math.SQRT1_2,T=I(2),k=I(x),A=2*x,M=180/x,S=x/180;function E(t){return t>1?_:t<-1?-_:Math.asin(t)}function C(t){return t>1?0:t<-1?x:Math.acos(t)}function I(t){return t>0?Math.sqrt(t):0}function L(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function z(t){var e=g(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=I(e*e+i*i),u=-t/2,h=50;if(!l)return[0,0];do{var f=u/2,p=o(f),d=m(f),g=d/p,v=-c(n(p));u-=s=(2/g*v-r*g-l)/(-v/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(e*x,l*o(u)),E(i*x/l)]},i}function D(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(C(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function O(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,h=0,f=50;do{var p=o(u),d=m(u),g=o(h),v=m(h),x=1+g,_=x*d-t,b=l+v*r-x*e*p-c,w=x*p/2,T=-d*v,k=e*x*d/2,A=r*g+e*p*v,M=T*k-A*w,S=(b*T-_*A)/M/2,E=(_*k-b*w)/M;n(E)>2&&(E/=2),u-=S,h-=E}while((n(S)>y||n(E)>y)&&--f>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function R(t,e){var r=g(e/2),n=I(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}D.invert=function(t,e){if(!(t*t+4*e*e>x*x+y)){var r=t,i=e,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),f=o(i),p=m(2*i),d=h*h,g=f*f,v=c*c,_=1-g*u*u,b=_?C(f*u)*I(s=1/_):s=0,w=2*b*f*c-t,T=b*h-e,k=s*(g*v+b*f*u*d),A=s*(.5*l*p-2*b*h*c),M=.25*s*(p*c-b*h*g*l),S=s*(d*u+b*v*f),E=A*M-S*k;if(!E)break;var L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]}},R.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=I((r-I(r*r-4*e*e))/2),s=E(i)/3,l=i?function(t){return c(t+I(t*t-1))}(n(e/i))/3:function(t){return c(t+I(t*t+1))}(n(t))/3,u=o(s),h=P(l),f=h*h-u*u;return[2*d(t)*a(L(l)*u,.25-f),2*d(e)*a(h*m(s),.25+f)]};var F=I(8),j=c(1+T);function B(t,e){var r=n(e);return r_){var l=a(s[1],s[0]),c=I(s[0]*s[0]+s[1]*s[1]),u=r*p((l-_)/r)+_,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=I(t*t+n*n);if(s>_){var l=a(n,t),c=r*p((l-_)/r)+_,u=l>c?-1:1,h=s*o(c-l),f=1/g(u*C((h-x)/I(x*(x-2*h)+s*s)));l=c+2*i((f+u*I(f*f-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function U(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function V(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function q(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+y))&&(o=a+y),r-=i=-1e-6*(a-e)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;hl)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=t(o+g,s),x=t(o,s+y),_=(v[0]-f[0])/g,b=(v[1]-f[1])/g,w=(x[0]-f[0])/y,T=(x[1]-f[1])/y,k=T*_-b*w,A=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-p*T)*A,s+=u=(p*b-d*_)*A,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=H(e),e}function Z(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>y&&--a>0);return e/2}function W(t,e,r){function n(n,i){return[t*n*o(i=Z(r,i)),e*m(i)]}return n.invert=function(n,i){return i=E(i/e),[n/(t*o(i)),E((2*i+m(2*i))/r)]},n}B.invert=function(t,e){if((a=n(e))v&&--u>0);return[t/(o(l)*(F-1/m(l))),d(e)*l]},V.invert=function(t,e){var r=2*E(e/2);return[t*o(r/2)/o(r),r]};var Y=W(T/_,T,x),X=2.00276,$=1.11072;function K(t,e){var r=Z(x,e);return[X*t/(1/o(e)+$/o(r)),(e+T*m(r))/X]}function J(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*S):r*M},i}function Q(t,e){return[t*o(e),e]}function tt(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i?r*o(n)/i:i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=I(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function et(t){function e(e,r){var n=_-r,i=n?e*t*m(n)/n:n;return[n*m(i)/t,_-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=_-r,o=I(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,_-o]},e}K.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-T*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*T*o(s))}while(n(r)>y&&--l>0);return i=a-T*m(s),[t*(1/o(i)+$/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var rt=W(1,4/x,x);function nt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=C(r*s+e*i*u);else{var h=m(t/2),f=m(l/2);c=2*E(I(h*h+e*i*f*f))}return n(c)>y?[c,a(i*m(l),e*s-r*i*u)]:[0,0]}function it(t,e,r){return C((t*t+e*e-r*r)/(2*t*e))}function at(t){return t-2*x*l((t+x)/(2*x))}function ot(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=nt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=it(i[0].v[0],i[2].v[0],i[1].v[0]),c=it(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=nt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=at(s[r][1]-l.v[1])}var f=h.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=it(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=u-d,f[0]+=s[r][0]*o(d),f[1]+=s[r][0]*m(d)):(f[0]+=s[r][0]*o(d),f[1]-=s[r][0]*m(d))}return f[0]/=3,f[1]/=3,f}}function st(t){return t[0]*=S,t[1]*=S,t}function lt(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=ot(st(o(t)),st(o(r)),st(o(n)));s.invert=H(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function ct(t,e){var r=I(1-m(e));return[2/k*t*r,k*(1-r)]}function ut(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(I(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,E(t?e*g(t)/t:e)]},r}ct.invert=function(t,e){var r=(r=e/k-1)*r;return[r>0?t*I(x/r)/2:0,E(1-r)]};var ht=I(3);function ft(t,e){return[ht*t*(2*o(2*e/3)-1)/k,ht*k*m(e/3)]}function pt(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,E(r*e)]},r}function dt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function mt(t,e){var r=I(8/(3*x));return[r*t*(1-n(e)/x),r*e]}function gt(t,e){var r=I(4-3*m(n(e)));return[2/I(6*x)*t*r,d(e)*I(2*x/3)*(2-r)]}function yt(t,e){var r=I(x*(4+x));return[2/r*t*(1+I(1-4*e*e/(x*x))),4/r*e]}function vt(t,e){var r=(2+_)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/I(x*(4+x))*t*(1+o(e)),2*I(x/(4+x))*m(e)]}function xt(t,e){return[t*(1+o(e))/I(2+x),2*e/I(2+x)]}function _t(t,e){for(var r=(1+_)*m(e),i=0,a=1/0;i<10&&n(a)>y;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=I(2+x),[t*(1+o(e))/r,2*e/r]}ft.invert=function(t,e){var r=3*E(e/(ht*k));return[k*t/(ht*(2*o(2*r/3)-1)),r]},mt.invert=function(t,e){var r=I(8/(3*x)),i=e/r;return[t/(r*(1-n(i)/x)),i]},gt.invert=function(t,e){var r=2-n(e)/I(2*x/3);return[t*I(6*x)/(2*r),d(e)*E((4-r*r)/3)]},yt.invert=function(t,e){var r=I(x*(4+x))/2;return[t*r/(1+I(1-e*e*(4+x)/(4*x))),e*r/2]},vt.invert=function(t,e){var r=e*I((4+x)/x)/2,n=E(r),i=o(n);return[t/(2/I(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+_))]},xt.invert=function(t,e){var r=I(2+x),n=e*r/2;return[r*t/(1+o(n)),n]},_t.invert=function(t,e){var r=1+_,n=I(r/2);return[2*t*n/(1+o(e*=n)),E((e+m(e))/r)]};var bt=3+2*T;function wt(t,e){var r=m(t/=2),n=o(t),a=I(o(e)),s=o(e/=2),l=m(e)/(s+T*n*a),u=I(2/(1+l*l)),h=I((T*s+(n+r)*a)/(T*s+(n-r)*a));return[bt*(u*(h-1/h)-2*c(h)),bt*(u*l*(h+1/h)-2*i(l))]}wt.invert=function(t,e){if(!(r=R.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var f=a/2,p=s/2,d=m(f),g=o(f),v=m(p),x=o(p),b=o(s),k=I(b),A=v/(x+T*g*k),M=A*A,S=I(2/(1+M)),E=(T*x+(g+d)*k)/(T*x+(g-d)*k),C=I(E),L=C-1/C,P=C+1/C,z=S*L-2*c(C)-t,D=S*A*P-2*i(A)-e,O=v&&w*k*d*M/v,F=(T*g*x+k)/(2*(x+T*g*k)*(x+T*g*k)*k),j=-.5*A*S*S*S,B=j*O,N=j*F,U=(U=2*x+T*k*(g-d))*U*C,V=(T*g*x*k+b)/U,q=-T*d*v/(k*U),H=L*B-2*V/C+S*(V+V/E),G=L*N-2*q/C+S*(q+q/E),Z=A*P*B-2*O/(1+M)+S*P*O+S*A*(V-V/E),W=A*P*N-2*F/(1+M)+S*P*F+S*A*(q-q/E),Y=G*Z-W*H;if(!Y)break;var X=(D*G-z*W)/Y,$=(z*Z-D*H)/Y;a-=X,s=u(-_,h(_,s-$))}while((n(X)>y||n($)>y)&&--l>0);return n(n(s)-_)s){var d=I(f),g=a(h,u),v=i*p(g/i),b=g-v,w=t*o(b),T=(t*m(b)-b*m(w))/(_-w),k=It(b,T),A=(x-t)/Lt(k,w,x);u=d;var M,S=50;do{u-=M=(t+Lt(k,w,u)*A-d)/(k(u)*A)}while(n(M)>y&&--S>0);h=b*m(u),u<_&&(h-=T*(u-_));var E=m(v),C=o(v);c[0]=u*C-h*E,c[1]=u*E+h*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=I(c),h=a(l,r),f=i*p(h/i),d=h-f;r=u*o(d),l=u*m(d);for(var g=r-_,y=m(r),b=l/y,w=r<_?1/0:0,T=10;;){var k=t*m(b),A=t*o(b),M=m(A),S=_-A,E=(k-b*M)/S,C=It(b,E);if(n(w)y||n(p)>y)&&--v>0);return[d,g]},u}kt.invert=function(t,e){var r=e/(1+Tt);return[t&&t/(Tt*I(1-r*r)),2*i(r)]},At.invert=function(t,e){var r=i(e/k),n=o(r),a=2*r;return[t*k/2/(o(a)*n*n),a]};var zt=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Dt=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ot=Pt(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Rt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Rt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>y&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var Ft=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function jt(t){var e=t(_,0)[0]-t(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*x,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function Bt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),e=E(l),n(t-_)>y&&(t%=_);var h=function(t,e){if(e===_)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,f=E(1/I(c)),p=h+s*c*f,d=(1-a)/p,g=I(d),v=d*c,b=I(v),w=g*h;if(0===t)return[0,-(w+s*b)];var T,k=o(e),A=1/k,M=2*a*k,S=(-3*s+f*u)*M,C=(-p*k-(1-a)*S)/(p*p),L=-A*M,P=-A*(s*c*C+d*u*M),z=-2*A*(h*(.5*C/g)-2*s*g*M),D=4*t/x;if(t>.222*x||e.175*x){if(r=(w+s*I(v*(1+l)-w*w))/(1+l),t>x/4)return[r,r];var O=r,R=.5*r;r=.5*(R+O),i=50;do{var F=r*(z+L*I(v-r*r))+P*E(r/b)-D;if(!F)break;F<0?R=r:O=r,r=.5*(R+O)}while(n(O-R)>y&&--i>0)}else{r=y,i=25;do{var j=r*r,B=I(v-j),N=z+L*B,U=r*N+P*E(r/b)-D;r-=T=B?U/(N+(P-L*j)/B):0}while(n(T)>y&&--i>0)}return[r,-w-s*I(v-r*r)]}(t>x/4?_-t:t,e);return t>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Nt(t,e){var r,a,l,c,u,h;if(e=.999999)return r=(1-e)/4,l=1/(a=P(t)),[(c=((h=s(2*(h=t)))-1)/(h+1))+r*((u=a*L(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-_+r*(u-t)/a];var f=[1,0,0,0,0,0,0,0,0],p=[I(e),0,0,0,0,0,0,0,0],d=0;for(a=I(1-e),u=1;n(p[d]/f[d])>y&&d<8;)r=f[d++],p[d]=(r-a)/2,f[d]=(r+a)/2,a=I(r*a),u*=2;l=u*f[d]*t;do{l=(E(c=p[d]*m(a=l)/f[d])+l)/2}while(--d);return[m(l),c=o(l),c/o(l-a),l]}function Ut(t,e){if(!e)return t;if(1===e)return c(g(t/2+b));for(var r=1,a=I(1-e),o=I(e),s=0;n(o)>y;s++){if(t%x){var l=i(a*g(t)/r);l<0&&(l+=x),t+=l+~~(t/x)*x}else t+=t;o=(r+a)/2,a=I(r*a),o=((r=o)-a)/2}return t/(f(2,s)*r)}function Vt(t,e){var r=(T-1)/(T+1),l=I(1-r*r),u=Ut(_,l*l),h=c(g(x/4+n(e)/2)),f=s(-1*h)/I(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?_:-_)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(f*o(-1*t),f*m(-1*t)),y=function(t,e,r){var a=n(t),o=L(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+I(c*c-(r-1)*l*4))/2;return[Ut(i(1/I(u)),r)*d(t),Ut(i(I((u/l-1)/r)),1-r)*d(e)]}return[0,Ut(i(o),1-r)*d(e)]}(p[0],p[1],l*l);return[-y[1],(e>=0?1:-1)*(.5*u-y[0])]}function qt(t){var e=m(t),r=o(t),i=Ht(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),c=o(a),u=o(t),h=C(e*l+r*c*u),f=m(h),p=n(f)>y?h/f:1;return[p*r*m(t),(n(t)>_?p:-p)*(e*c-r*l*u)]}return i.invert=Ht(-t),s.invert=function(t,r){var n=I(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*e,f=I(c*c+u*u-h*h),p=a(c*h+u*f,u*h-c*f),d=(n>_?-1:1)*a(t*s,n*o(p)*l+r*m(p)*s);return i.invert(d,p)},s}function Ht(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,c=m(n);return[a(l,s*r-c*e),E(c*r+s*e)]}}Bt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=I(a),u=E(1/I(1+l)),h=1-l+a*(1+l)*u,f=(1-c)/h,p=I(f),d=f*(1+l),m=p*(1-l),g=I(d-t*t),y=e+m+a*g;if(n(i-r)0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var _=E(c),b=o(_),w=1/b,T=2*c*b,k=(-h*b-(-3*a+u*(1+3*l))*T*(1-c))/(h*h),A=.5*k/p,M=(1-l)*A-2*a*p*T;return[x/4*(t*(-2*w*M+-w*T*g)+-w*(a*(1+l)*k+f*(1+3*l)*T)*E(t/I(d))),_]}(c?l:s,c?s:l),h=u[0],f=u[1],p=o(f);return c&&(h=-_-h),[r*(a(m(h)*p,-m(f))+x),i*E(o(h)*p)]},Vt.invert=function(t,e){var r,n,o,l,u,h,f=(T-1)/(T+1),p=I(1-f*f),d=Ut(_,p*p),m=(n=-t,o=p*p,(r=.5*d-e)?(l=Nt(r,o),n?(h=(u=Nt(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/h,l[1]*l[2]*u[0]*u[1]/h],[l[1]*u[1]/h,-l[0]*l[2]*u[0]*u[2]/h],[l[2]*u[1]*u[2]/h,-o*l[0]*l[1]*u[0]/h]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=Nt(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),g=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(m[0],m[1]);return[a(g[1],g[0])/-1,2*i(s(-.5*c(f*g[0]*g[0]+f*g[1]*g[1])))-_]};var Gt=E(1-1/3)*M,Zt=pt(0);function Wt(t){var e=Gt*S,r=ct(x,e)[0]-ct(-x,e)[0],i=Zt(0,e)[1],a=ct(0,e)[1],o=k-a,s=A/t,c=4/A,f=i+o*o*4/A;function p(p,d){var m,g=n(d);if(g>e){var y=h(t-1,u(0,l((p+x)/s)));(m=ct(p+=x*(t-1)/t-y*s,g))[0]=m[0]*A/r-A*(t-1)/(2*t)+y*A/t,m[1]=i+4*(m[1]-a)*o/A,d<0&&(m[1]=-m[1])}else m=Zt(p,d);return m[0]*=c,m[1]/=f,m}return p.invert=function(e,p){e/=c;var d=n(p*=f);if(d>i){var m=h(t-1,u(0,l((e+x)/s)));e=(e+x*(t-1)/t-m*s)*r/A;var g=ct.invert(e,.25*(d-i)*A/o+a);return g[0]-=x*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Zt.invert(e,p)},p}function Yt(t,e){return[t,1&e?89.999999:Gt]}function Xt(t,e){return[t,1&e?-89.999999:-Gt]}function $t(t){return[.999999*t[0],t[1]]}function Kt(t){var e,r=1+t,i=E(m(1/r)),s=2*I(x/(e=x+4*i*r)),l=.5*s*(r+I(t*(2+t))),c=t*t,u=r*r;function h(h,f){var p,d,g=1-m(f);if(g&&g<2){var y,b=_-f,w=25;do{var T=m(b),k=o(b),A=i+a(T,r-k),M=1+u-2*r*k;b-=y=(b-c*i-r*T+M*A-.5*g*e)/(2*r*T*A)}while(n(y)>v&&--w>0);p=s*I(M),d=h*A/x}else p=s*(t+g),d=h*i/x;return[p*m(d),l-p*o(d)]}return h.invert=function(t,n){var o=t*t+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),f=C(h),p=m(f),d=i+a(p,r-h);return[E(t/I(o))*x/d,E(1-2*(f-c*i-r*p+(1+u-2*r*h)*d)/e)]},h}var Jt=.7109889596207567,Qt=.0528035274542;function te(t,e){return e>-Jt?((t=Y(t,e))[1]+=Qt,t):Q(t,e)}function ee(t,e){return n(e)>Jt?((t=Y(t,e))[1]-=e>0?Qt:-Qt,t):Q(t,e)}function re(t,e,r,n){var i=I(4*x/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=I(n*m(r)*I((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return I(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function u(t){return l(t)*m(t)}var h=function(t,e){var n=r*q(c,s*m(e)/r,e/x);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/x*o(n),u/a*m(n)]};return h.invert=function(t,e){var n=q(u,e*a/i);return[t*x/(o(n)*i*a*l(n)),E(r*c(n/r)/s)]},0===r&&(i=I(n/x),(h=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,E(e*i)]}),h}function ne(t,e,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,f,p,d,m,g,y,v,x,_;if(f=t(e+.25*(h=r-e)),p=t(r-.25*h),isNaN(f))u.nanEncountered=!0;else{if(!isNaN(p))return _=((g=(d=h*(n+4*f+i)/12)+(m=h*(i+4*p+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+_):Math.abs(_)t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var p=2*h(1)/x*o/r,g=function(t,e){var r=h(n(m(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=p)<1&&(r=d(e)*E(a(n(e))*o)),[t/i(n(e)),r]},g}function oe(t,e){return n(t[0]-e[0])a[o][2][0];++o);var l=t(e-a[o][1][0],r);return l[0]+=t(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):t.invert&&(s.invert=function(e,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(se([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(e),n=e.map((function(t){return t.map((function(t){return[[t[0][0]*S,t[0][1]*S],[t[1][0]*S,t[1][1]*S],[t[2][0]*S,t[2][1]*S]]}))})),o=n.map((function(e){return e.map((function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))}))},null!=n&&l.lobes(n),l}te.invert=function(t,e){return e>-Jt?Y.invert(t,e-Qt):Q.invert(t,e)},ee.invert=function(t,e){return n(e)>Jt?Y.invert(t,e+(e>0?Qt:-Qt)):Q.invert(t,e)};var ce=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ue=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],he=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],pe=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],de=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function me(t,e){return[3/A*t*I(x*x/3-e*e),e]}function ge(t){function e(e,r){if(n(n(r)-_)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=f((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,E((l-1)/(l+1))]},e}me.invert=function(t,e){return[A/3*t/I(x*x/3-e*e),e]};var ye=x/T;function ve(t,e){return[t*(1+I(o(e)))/2,e/(o(e/2)*o(t/6))]}function xe(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function _e(t,e){return[m(t)/o(e),g(e)*o(t)]}function be(t){var e=o(t),r=g(b+t/2);function i(i,a){var o=a-t,s=n(o)=0;)f=(h=t[u])[0]+l*(i=f)-c*p,p=h[1]+l*p+c*i;return[f=l*(i=f)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,f=e,p=t[f],d=p[0],g=p[1],y=0,v=0;--f>=0;)y=d+c*(h=y)-u*v,v=g+c*v+u*h,d=(p=t[f])[0]+c*(h=d)-u*g,g=p[1]+c*g+u*h;var x,_,b=(y=d+c*(h=y)-u*v)*y+(v=g+c*v+u*h)*v;c-=x=((d=c*(h=d)-u*g-r)*y+(g=c*g+u*h-s)*v)/b,u-=_=(g*y-d*v)/b}while(n(x)+n(_)>1e-12&&--l>0);if(l){var w=I(c*c+u*u),T=2*i(.5*w),k=m(T);return[a(c*k,w*o(T)),w?E(u*k/w):0]}},r}ve.invert=function(t,e){var r=n(t),i=n(e),a=y,s=_;iy||n(_)>y)&&--a>0);return a&&[r,i]},_e.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?w*I((i-I(i*i-4*r))/r):1/I(n);return[E(t*a),d(e)*C(a)]},we.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*x]};var ke=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Ae=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Me=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Se=[[.9245,0],[0,0],[.01943,0]],Ee=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ce(t,r){var n=e.geoProjection(Te(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Ie=I(6),Le=I(7);function Pe(t,e){var r=E(7*m(e)/(3*Ie));return[Ie*t*(2*o(2*r/3)-1)/Le,9*m(r/3)/Le]}function ze(t,e){for(var r,i=(1+w)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)v&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Re.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var Fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function je(t,e){var r=m(e),i=o(e),a=d(t);if(0===t||n(e)===_)return[0,e];if(0===e)return[t,0];if(n(t)===_)return[t*i,_*r];var s=x/(2*t)-2*t/x,l=2*e/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,f=1+u/h,p=1+h/u,g=(s*r/c-s/2)/f,y=(h*r/u+c/2)/p,v=y*y-(h*r*r/u+c*r-1)/p;return[_*(g+I(g*g+i*i/f)*a),_*(y+I(v<0?0:v)*d(-e*s)*a)]}je.invert=function(t,e){var r=(t/=_)*t,n=r+(e/=_)*e,i=x*x;return[t?(n-1+I((1-n)*(1-n)+4*r))/(2*t)*_:0,q((function(t){return n*(x*m(t)-2*t)*x+4*t*t*(e-m(t))+2*x*t-i*e}),0)]};var Be=1.0148,Ne=.23185,Ue=-.14499,Ve=.02406,qe=Be,He=5*Ne,Ge=1.790857183;function Ze(t,e){var r=e*e;return[t,e*(Be+r*r*(Ne+r*(Ue+Ve*r)))]}function We(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Ye(n.map(r.project),n.map(e.project));e.transform=r.transform?Xe(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;oGe?e=Ge:e<-1.790857183&&(e=-1.790857183);var r,i=e;do{var a=i*i;i-=r=(i*(Be+a*a*(Ne+a*(Ue+Ve*a)))-e)/(qe+a*a*(He+a*(.21654*a-1.01493)))}while(n(r)>y);return[t,i]},We.invert=function(t,e){if(n(e)y&&--s>0);return l=g(a),[(n(e)n^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),dr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function vr(t){var r=t(_,0)[0]-t(-_,0)[0];function i(e,i){var a=n(e)<_,o=t(a?e:e>0?e-x:e+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*w,o=(i-e)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var f=t.invert(a,o);return s||(f[0]+=a>0?x:-x),f}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function xr(){return vr(Vt).scale(111.48)}function _r(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)y&&--u>0);var d=r*(h=g(c)),v=g(n(a)0?_:-_)*(f+o*(d-c)/2+o*o*(d-2*f+c)/2)]}function Tr(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=I(n),o=(t-I(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*I(1-o*o)),i?E(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}br.forEach((function(t){t[1]*=1.0144})),wr.invert=function(t,e){var r=e/_,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=br[o][1],c=br[o+1][1],f=br[h(19,o+2)][1],p=f-s,d=f-2*c+s,m=2*(n(r)-c)/p,g=d/p,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(e>=0?5:-5)*(y+a);var x,b=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=br[o][1],c=br[o+1][1],f=br[h(19,o+2)][1],i-=(x=(e>=0?_:-_)*(c+y*(f-s)/2+y*y*(f-2*c+s)/2)-e)*M}while(n(x)>v&&--b>0);break}}while(--o>=0);var w=br[o][0],T=br[o+1][0],k=br[h(19,o+2)][0];return[t/(T+y*(k-w)/2+y*y*(k-2*T+w)/2),i*S]};var kr=-180,Ar=-179.9999,Mr=179.9999,Sr=-89.9999,Er=89.9999;function Cr(t){return t.length>0}function Ir(t){return-90===t||90===t?[0,t]:[kr,(e=t,Math.floor(1e4*e)/1e4)];var e}function Lr(t){var e=t[0],r=t[1],n=!1;return e<=Ar?(e=kr,n=!0):e>=Mr&&(e=180,n=!0),r<=Sr?(r=-90,n=!0):r>=Er&&(r=90,n=!0),n?[e,r]:t}function Pr(t){return t.map(Lr)}function zr(t,e,r){for(var n=0,i=t.length;n=Mr||u<=Sr||u>=Er){a[o]=Lr(l);for(var h=o+1;hAr&&pSr&&d=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(h-1)}),a[0]=Ir(a[0][1]),o=-1,s=a.length}}}}function Dr(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e0?x-l:l)*M],u=e.geoProjection(t(s)).rotate(c),h=e.geoRotation(c),f=u.center;return delete u.rotate,u.center=function(t){return arguments.length?f(h(t)):h.invert(f())},u.clipAngle(90)}function Br(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Nr(t,e){return jr(Br,t,e)}function Ur(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(e,a){var s=C(o(a)*o(e-r)),l=C(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*I(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,h=o(I(u+(i=t+r)*i)),f=o(I(u+(i=t+n)*i));return[a(c=h-f,i=(h+f)*s),(e<0?-1:1)*C(I(i*i+c*c)*l)]},c}function Vr(t,e){return jr(Ur,t,e)}function qr(t,e){if(n(e)y&&--l>0);return[d(t)*(I(a*a+4)+a)*x/4,_*s]};var Xr=4*x+3*I(3),$r=2*I(2*x*I(3)/Xr),Kr=W($r*I(3)/x,$r,Xr/6);function Jr(t,e){return[t*I(1-3*e*e/(x*x)),e]}function Qr(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=I(1-n*n))-s*i,-s*r-l*i]}function tn(t,e){var r=D(t,e);return[(r[0]+t/_)/2,(r[1]+e)/2]}Jr.invert=function(t,e){return[t/I(1-3*e*e/(x*x)),e]},Qr.invert=function(t,e){var r=(t*t+e*e)/-2,n=I(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=I(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},tn.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,f=l*l,p=m(r),d=o(r/2),g=m(r/2),v=g*g,x=1-f*d*d,b=x?C(l*d)*I(s=1/x):s=0,w=.5*(2*b*l*g+r/_)-t,T=.5*(b*c+i)-e,k=.5*s*(f*v+b*l*d*h)+.5/_,A=s*(p*u/4-b*c*g),M=.125*s*(u*g-b*c*f*p),S=.5*s*(h*d+b*v*l)+.5,E=A*M-S*k,L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=_,r=e.geoProjectionMutator(z),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*S):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=z,t.geoAitoff=function(){return e.geoProjection(D).scale(152.63)},t.geoAitoffRaw=D,t.geoArmadillo=function(){var t=20*S,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(O),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*S)>=0?1:-1)*t),i(t)):t*M},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)u.point(e,r*-a(o(e*S/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=O,t.geoAugust=function(){return e.geoProjection(R).scale(66.1603)},t.geoAugustRaw=R,t.geoBaker=function(){return e.geoProjection(B).scale(112.314)},t.geoBakerRaw=B,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=.01,l=-o(s*S),c=m(s*S);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),u=i(e),h=(n.rotate([0,0]),i(e));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var e=0,r=360/t,n=2*x/t,i=90-180/t,u=_;e=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=qt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Wt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){var n,i;e.geoStream((n=180/t,i=[].concat(r.range(-180,180+n/2,n).map(Yt),r.range(180,-180-n/2,-n).map(Xt)),{type:"Polygon",coordinates:[180===n?i.map($t):i]}),l)},s},i.scale(239.75)},t.geoHealpixRaw=Wt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Kt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Kt,t.geoHomolosine=function(){return e.geoProjection(ee).scale(152.63)},t.geoHomolosineRaw=ee,t.geoHufnagel=function(){var t=1,r=0,n=45*S,i=2,a=e.geoProjectionMutator(re),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*S,i):n*M},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=re,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ae),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ae,t.geoInterrupt=le,t.geoInterruptedBoggs=function(){return le(K,ce).scale(160.857)},t.geoInterruptedHomolosine=function(){return le(ee,ue).scale(152.63)},t.geoInterruptedMollweide=function(){return le(Y,he).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return le(Y,fe).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return le(te,pe,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return le(Q,de).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(me).scale(158.837)},t.geoKavrayskiy7Raw=me,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(ge),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=ge,t.geoLarrivee=function(){return e.geoProjection(ve).scale(97.2672)},t.geoLarriveeRaw=ve,t.geoLaskowski=function(){return e.geoProjection(xe).scale(139.98)},t.geoLaskowskiRaw=xe,t.geoLittrow=function(){return e.geoProjection(_e).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=_e,t.geoLoximuthal=function(){return J(be).parallel(40).scale(158.837)},t.geoLoximuthalRaw=be,t.geoMiller=function(){return e.geoProjection(we).scale(108.318)},t.geoMillerRaw=we,t.geoModifiedStereographic=Ce,t.geoModifiedStereographicRaw=Te,t.geoModifiedStereographicAlaska=function(){return Ce(ke,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ce(Ae,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ce(Me,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ce(Se,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ce(Ee,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Y).scale(169.529)},t.geoMollweideRaw=Y,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Pe).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Pe,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(ze).scale(188.209)},t.geoMtFlatPolarQuarticRaw=ze,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(De).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=De,t.geoNaturalEarth2=function(){return e.geoProjection(Oe).scale(175.295)},t.geoNaturalEarth2Raw=Oe,t.geoNellHammer=function(){return e.geoProjection(Re).scale(152.63)},t.geoNellHammerRaw=Re,t.geoInterruptedQuarticAuthalic=function(){return le(U(1/0),Fe).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(je).scale(127.267)},t.geoNicolosiRaw=je,t.geoPatterson=function(){return e.geoProjection(Ze).scale(139.319)},t.geoPattersonRaw=Ze,t.geoPolyconic=function(){return e.geoProjection(We).scale(103.74)},t.geoPolyconicRaw=We,t.geoPolyhedral=Je,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Je(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Je(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=vr,t.geoRectangularPolyconic=function(){return J(_r).scale(131.215)},t.geoRectangularPolyconicRaw=_r,t.geoRobinson=function(){return e.geoProjection(wr).scale(152.63)},t.geoRobinsonRaw=wr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(Tr),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*S):r*M},i.scale(432.147).clipAngle(C(1/t)*M-1e-6)},t.geoSatelliteRaw=Tr,t.geoSinuMollweide=function(){return e.geoProjection(te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=te,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return Or(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(Or)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Rr(t)}},t.geoTimes=function(){return e.geoProjection(Fr).scale(146.153)},t.geoTimesRaw=Fr,t.geoTwoPointAzimuthal=Nr,t.geoTwoPointAzimuthalRaw=Br,t.geoTwoPointAzimuthalUsa=function(){return Nr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Vr,t.geoTwoPointEquidistantRaw=Ur,t.geoTwoPointEquidistantUsa=function(){return Vr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(qr).scale(79.4183)},t.geoVanDerGrintenRaw=qr,t.geoVanDerGrinten2=function(){return e.geoProjection(Hr).scale(79.4183)},t.geoVanDerGrinten2Raw=Hr,t.geoVanDerGrinten3=function(){return e.geoProjection(Gr).scale(79.4183)},t.geoVanDerGrinten3Raw=Gr,t.geoVanDerGrinten4=function(){return e.geoProjection(Zr).scale(127.16)},t.geoVanDerGrinten4Raw=Zr,t.geoWagner=Yr,t.geoWagner7=function(){return Yr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=Wr,t.geoWagner4=function(){return e.geoProjection(Kr).scale(176.84)},t.geoWagner4Raw=Kr,t.geoWagner6=function(){return e.geoProjection(Jr).scale(152.63)},t.geoWagner6Raw=Jr,t.geoWiechel=function(){return e.geoProjection(Qr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=Qr,t.geoWinkel3=function(){return e.geoProjection(tn).scale(158.837)},t.geoWinkel3Raw=tn,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?o(t,fg(),hg()):(i=[t,r(915),r(882)],void 0===(a="function"==typeof(n=o)?n.apply(t,i):n)||(e.exports=a))}}),dg=d({"src/plots/geo/zoom.js"(t,e){var r=v(),n=se(),i=Vt(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var a=t.id,o=t.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},f={};function p(t,e){h[a+"."+t]=n.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,t);r.get()!==e&&(r.set(e),n.nestedProperty(l,t).set(e),f[a+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function h(t,e){var n=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){e.scale(r.event.scale).translate(r.event.translate),t.render(!0);var n=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(t,e,i)})),n}function f(t,e){var n,i,a,o,h,f,p,d,m,g=c(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=e.rotate(),a=e.translate(),o=i,h=y(n)})).on("zoom",(function(){if(f=r.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(n))return g.scale(e.scale()),void g.translate(e.translate());e.scale(r.event.scale),e.translate([a[0],r.event.translate[1]]),h?y(f)&&(d=y(f),p=[o[0]+(d[0]-h[0]),i[1],i[2]],e.rotate(p),o=p):h=y(n=f),m=!0,t.render(!0);var s=e.rotate(),l=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(t,e,v)})),g}function p(t,e){var n,i={r:e.rotate(),k:e.scale()},h=c(0,e),f=function(t){for(var e=0,n=arguments.length,i=[];++ed?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/d)*o-p,i=Math.sqrt(d*d-h*h));var g=180-a-2*p,v=(Math.atan2(f,u)-Math.atan2(c,i))*o,x=(Math.atan2(f,u)-Math.atan2(c,-i))*o,_=m(r[0],r[1],a,v),b=m(r[0],r[1],g,x);return _<=b?[a,v,r[2]]:[g,x,r[2]]}(T,n,E);isFinite(k[0])&&isFinite(k[1])&&isFinite(k[2])||(k=E),e.rotate(k),E=k}}else n=d(e,M=_);f.of(this,arguments)({type:"zoom"})})),A=f.of(this,arguments),p++||A({type:"zoomstart"})})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=f.of(this,arguments),--p||n({type:"zoomend"}),u(t,e,v)})).on("zoom.redraw",(function(){t.render(!0);var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,f,"on")}function d(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function m(t,e,r,n){var i=g(r-t),a=g(n-e);return Math.sqrt(i*i+a*a)}function g(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function x(t,e){for(var r=0,n=0,i=t.length;n0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),p.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,s=e[this.id],c=e._size,u=s.domain,h=s.projection,f=s.lonaxis,p=s.lataxis,d=f._ax,g=p._ax,y=this.projection=function(t){var e=t.projection,r=e.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],f=function(t){return t?c:[]},p=0;pu*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(t){return c.getPath().bounds(t)},c.precision(w.precision),t._isSatellite&&c.tilt(e.tilt).distance(e.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},_=h.rotation||{},b=f.range||[],T=p.range||[];if(s.fitbounds){d._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],d.range=m(r,d),g.range=m(r,g);var k=(d.range[0]+d.range[1])/2,A=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:k,lat:A};else if(s._isClipped){x={lon:k,lat:A},_={lon:k,lat:A,roll:_.roll};var M=h.type,S=w.lonaxisSpan[M]/2||180,C=w.lataxisSpan[M]/2||90;b=[k-S,k+S],T=[A-C,A+C]}else x={lon:k,lat:A},_={lon:k,lat:_.lat,roll:_.roll}}y.center([x.lon-_.lon,x.lat-_.lat]).rotate([-_.lon,-_.lat,_.roll]).parallels(h.parallels);var I=E(b,T);y.fitExtent(v,I);var L=this.bounds=y.getBounds(I),P=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var D=y.getBounds(E(d.range,g.range)),O=Math.min((L[1][0]-L[0][0])/(D[1][0]-D[0][0]),(L[1][1]-L[0][1])/(D[1][1]-D[0][1]));isFinite(O)?y.scale(O*P):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*P);var R=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var F=y([x.lon,x.lat]),j=y.translate();y.translate([j[0]-(F[0]-j[0]),j[1]-(F[1]-j[1])])}},S.updateBaseLayers=function(t,e){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var f=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=n.framework.selectAll(".layer").data(f,String);p.exit().each((function(t){delete a[t],delete o[t],r.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=r.select(this);"bg"===t?n.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=1e-6,s=2.5,l=e[t],c=w.scopeDefaults[e.scope];"lonaxis"===t?(n=c.lonaxisRange,i=c.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=c.lataxisRange,i=c.lonaxisRange,a=function(t,e){return[e,t]});var u={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};d.setConvert(u,r);var h=d.calcTicks(u);e.isScoped||"lonaxis"!==t||h.pop();for(var f=h.length,p=new Array(f),m=0;m-1&&_(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&f.click(i,r.event))}))}function h(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,n=e._fullLayout,i="clip"+n._uid+t.id;t.clipDef=n._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=r.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(t.mockAxis,n)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?c(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}}}),gg=d({"src/plots/geo/layout_attributes.js"(t,e){var r=V(),n=Ta().attributes,i=Pt().dash,a=Xm(),o=Lt().overrideAll,s=Zt(),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(e.exports=o({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),yg=d({"src/plots/geo/layout_defaults.js"(t,e){var r=se(),n=qs(),i=be().getSubplotData,a=Xm(),o=gg(),s=a.axesNames;function l(t,e,n,o){var l=i(o.fullData,"geo",o.id).map((function(t){return t.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],f=n("projection.type",h.projType),p=e._isAlbersUsa="albers usa"===f;p&&(u=e.scope="usa");var d=e._isScoped="world"!==u,m=e._isSatellite="satellite"===f,g=e._isConic=-1!==f.indexOf("conic")||"albers"===f,y=e._isClipped=!!a.lonaxisSpan[f];if(!1===t.visible){var v=r.extendDeep({},e._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),e._template=v}for(var x=n("visible"),_=0;_0&&L<0&&(L+=360);var P,z,D,O=(I+L)/2;if(!p){var R=d?h.projRotate:[O,0,0];P=n("projection.rotation.lon",R[0]),n("projection.rotation.lat",R[1]),n("projection.rotation.roll",R[2]),n("showcoastlines",!d&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}p?(z=-96.6,D=38.7):(z=d?O:P,D=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",D),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",d&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),d||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),vg=d({"src/plots/geo/index.js"(t,e){var r=be().getSubplotCalcData,n=se().counterRegex,i=mg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},e.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:gg(),supplyLayoutDefaults:yg(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,o=e._subplots[a],s=0;s")}}(t,h,o),[t]}}}),Sg=d({"src/traces/choropleth/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}}}),Eg=d({"src/traces/choropleth/select.js"(t,e){e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[];if(!1===e)for(r=0;r=Math.min(P,z)&&w<=Math.max(P,z)?0:1/0}if(h=Math.min(D,O)&&T<=Math.max(D,O)?0:1/0}d=Math.sqrt(h*h+f*f),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=_[o=i[u]],c=b[o],h=v.c2p(l)-w,f=x.c2p(c)-T,(p=Math.sqrt(h*h+f*f))100},t.isDotSymbol=function(t){return"string"==typeof t?e.DOT_RE.test(t):t>200}}}),Og=d({"src/traces/scattergl/defaults.js"(t,e){var r=se(),n=Vt(),i=Dg(),a=zg(),o=_n(),s=We(),l=qn(),c=Hn(),u=Zn(),h=Wn(),f=$n(),p=Xn();e.exports=function(t,e,d,m){function g(n,i){return r.coerce(t,e,a,n,i)}var y=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=s.isBubble(t),x=l(t,e,m,g);if(x){c(t,e,m,g),g("xhoverformat"),g("yhoverformat");var _=x>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,n,i,a){return s(t,e,n,i,a,r)},gt:function(t,e,r,i,a){return s(t,e,r,i,a,n)},lt:function(t,e,r,n,a){return s(t,e,r,n,a,i)},le:function(t,e,r,n,i){return s(t,e,r,n,i,a)},eq:function(t,e,r,n,i){return s(t,e,r,n,i,o)}}}}),jg=d({"node_modules/pick-by-alias/index.js"(t,e){e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=r(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}}}),Ng=d({"node_modules/array-bounds/index.js"(t,e){e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;ni&&(i=t[o]),t[o]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(u(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(let t=0;tn||s>1073741824){for(let t=0;tr+i||b>c||T=A)return;if(o===s)return;let h=y[a];void 0===s&&(s=h.length);for(let e=o;e=l&&n<=d&&i>=u&&i<=m&&M.push(r)}let f=v[a],p=f[4*o+0],x=f[4*o+1],_=f[4*o+2],w=f[4*o+3],S=function(t,e){let r=null,n=0;for(;null===r;)if(r=t[4*e+n],n++,n>t.length)return null;return r}(f,o+1),E=.5*i,C=a+1;e(r,n,E,C,p,x||_||w||S),e(r,n+E,E,C,x,_||w||S),e(r+E,n,E,C,_,w||S),e(r+E,n+E,E,C,w,S)}(0,0,1,0,0,1),M},d;function w(t,e,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};t.default=function(t){var e=t.px,s=t.py,l=t.cx,c=t.cy,u=t.rx,h=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===h)return[];var x=Math.sin(p*n/360),_=Math.cos(p*n/360),b=_*(e-l)/2+x*(s-c)/2,w=-x*(e-l)/2+_*(s-c)/2;if(0===b&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var T=Math.pow(b,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);T>1&&(u*=Math.sqrt(T),h*=Math.sqrt(T));var k=function(t,e,r,i,a,s,l,c,u,h,f,p){var d=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(f,2),y=Math.pow(p,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*a/s*p,_=v*-s/a*f,b=h*x-u*_+(t+r)/2,w=u*x+h*_+(e+i)/2,T=(f-x)/a,k=(p-_)/s,A=(-f-x)/a,M=(-p-_)/s,S=o(1,0,T,k),E=o(T,k,A,M);return 0===c&&E>0&&(E-=n),1===c&&E<0&&(E+=n),[b,w,S,E]}(e,s,l,c,u,h,m,y,x,_,b,w),A=r(k,4),M=A[0],S=A[1],E=A[2],C=A[3],I=Math.abs(C)/(n/4);Math.abs(1-I)<1e-7&&(I=1);var L=Math.max(Math.ceil(I),1);C/=L;for(var P=0;P4?(o=g[g.length-4],s=g[g.length-3]):(o=f,s=p),a.push(g)}return a};var r=Yg();function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),$g=d({"node_modules/is-svg-path/index.js"(t,e){e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}}}),Kg=d({"node_modules/svg-path-bounds/index.js"(t,e){var r=$e(),n=Wg(),i=Xg(),a=$g(),o=ru();e.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t&&(o(a(t),"String is not an SVG path."),t=r(t)),o(Array.isArray(t),"Argument should be a string or an array of path segments."),t=n(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],s=0,l=t.length;se[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}}}),Jg=d({"node_modules/normalize-svg-path/index.js"(t,e){var r=Math.PI,n=l(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(t,e,i,a,l,c,u,h,f,p){if(p)T=p[0],k=p[1],b=p[2],w=p[3];else{var d=s(t,e,-l);t=d.x,e=d.y;var m=(t-(h=(d=s(h,f,-l)).x))/2,g=(e-(f=d.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,_=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));_==1/0&&(_=1);var b=_*i*g/a+(t+h)/2,w=_*-a*m/i+(e+f)/2,T=Math.asin(((e-w)/a).toFixed(9)),k=Math.asin(((f-w)/a).toFixed(9));(T=tk&&(T-=2*r),!u&&k>T&&(k-=2*r)}if(Math.abs(k-T)>n){var A=k,M=h,S=f;k=T+n*(u&&k>T?1:-1);var E=o(h=b+i*Math.cos(k),f=w+a*Math.sin(k),i,a,l,0,u,M,S,[k,A,b,w])}var C=Math.tan((k-T)/4),I=4/3*i*C,L=4/3*a*C,P=[2*t-(t+I*Math.sin(T)),2*e-(e-L*Math.cos(T)),h+I*Math.sin(k),f-L*Math.cos(k),h,f];if(p)return P;E&&(P=P.concat(E));for(var z=0;z7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=p,_=d;"C"!=e&&"S"!=e||(x+=x-n,_+=_-s),y=["C",x,_,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(h=2*p-h,f=2*d-f):(h=p,f=d),y=a(p,d,h,f,y[1],y[2]);break;case"Q":h=y[1],f=y[2],y=a(p,d,y[1],y[2],y[3],y[4]);break;case"L":y=i(p,d,y[1],y[2]);break;case"H":y=i(p,d,y[1],d);break;case"V":y=i(p,d,p,y[1]);break;case"Z":y=i(p,d,c,u)}e=v,p=y[y.length-2],d=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=p,s=d),r.push(y)}return r}}}),Qg=d({"node_modules/draw-svg-path/index.js"(t,e){var r=Wg(),n=Jg(),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),n(r(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}}}),ty=d({"node_modules/bitmap-sdf/index.js"(t,e){var r=Od();e.exports=function(t,e){e||(e={});var a,o,s,l,c,u,h,f,p,d,m,g=null==e.cutoff?.25:e.cutoff,y=null==e.radius?8:e.radius,v=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");a=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/a/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(f=t).getContext("2d"),a=f.width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t,a=(f=t.canvas).width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,a=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),d=0,m=c.length;d0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return r=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var n=t.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(t);c.fill(y),p&&c.stroke(y)}else{var v=i(t);a(c,v),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}}}),ry=d({"src/traces/scattergl/convert.js"(t,e){var r=T(),n=ey(),i=jd(),a=Vt(),o=se(),s=o.isArrayOrTypedArray,l=Je(),c=ve(),u=Nd().formatColor,h=We(),f=Ye(),p=Dg(),d=Pg(),m=H().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Xe().appendArrayPointValue;function v(t,e){var n,i=t._fullLayout,a=e._length,l=e.textfont,c=e.textposition,u=s(c)?c:[c],h=l.color,f=l.size,p=l.family,d=l.weight,m=l.style,g=l.variant,v={},_=t._context.plotGlPixelRatio,b=e.texttemplate;if(b){v.text=[];var w=i._d3locale,T=Array.isArray(b),k=T?Math.min(b.length,a):a,A=T?function(t){return b[t]}:function(){return b};for(n=0;n500?"bold":"normal":t}function _(t,e){var r,n,a=e._length,o=e.marker,l={},c=s(o.symbol),h=s(o.angle),d=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=p.isOpenSymbol(o.symbol)),c||d||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,_=o.angle,b=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var T=w;for(w=Array(a),r=0;rd.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var f=n[0],p=n[1];for(i=0;i1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[d],v=g[m],x=f?f/.8+1:0,_=-v*x-.5*v;o.offset[i]=[y*x/p,_/p]}}return o}}}}),ny=d({"src/traces/scattergl/scene_update.js"(t,e){var r=se();e.exports=function(t,e){var n=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((n=e._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(t){var e=r.repeat(t,n.count);if(n.fill2d&&n.fill2d.update(e),n.scatter2d&&n.scatter2d.update(e),n.line2d&&n.line2d.update(e),n.error2d&&n.error2d.update(e.concat(e)),n.select2d&&n.select2d.update(e),n.glText)for(var i=0;i=m,w=2*_,T={},k=y.makeCalcdata(e,"x"),A=v.makeCalcdata(e,"y"),M=o(e,y,"x",k),S=o(e,v,"y",A),E=M.vals,C=S.vals;e._x=E,e._y=C,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=A,e._yStarts=S.starts,e._yEnds=S.ends);var I=new Array(w),L=new Array(_);for(a=0;a<_;a++)I[2*a]=E[a]===d?NaN:E[a],I[2*a+1]=C[a]===d?NaN:C[a],L[a]=a;if("log"===y.type)for(a=0;a1&&n.extendFlat(s.line,f.linePositions(t,r,i)),s.errorX||s.errorY){var l=f.errorBarPositions(t,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},f.textPosition(t,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},f.textPosition(t,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},f.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,I,E,C),D=p(t,x);return u(s,e),b?z.marker&&(P=z.marker.sizeAvg||Math.max(z.marker.size,3)):P=l(e,_),c(t,e,y,v,E,C,P),z.errorX&&g(e,y,z.errorX),z.errorY&&g(e,v,z.errorY),z.fill&&!D.fill2d&&(D.fill2d=!0),z.marker&&!D.scatter2d&&(D.scatter2d=!0),z.line&&!D.line2d&&(D.line2d=!0),!z.errorX&&!z.errorY||D.error2d||(D.error2d=!0),z.text&&!D.glText&&(D.glText=!0),z.marker&&(z.marker.snap=_),D.lineOptions.push(z.line),D.errorXOptions.push(z.errorX),D.errorYOptions.push(z.errorY),D.fillOptions.push(z.fill),D.markerOptions.push(z.marker),D.markerSelectedOptions.push(z.markerSel),D.markerUnselectedOptions.push(z.markerUnsel),D.textOptions.push(z.text),D.textSelectedOptions.push(z.textSel),D.textUnselectedOptions.push(z.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),T._scene=D,T.index=D.count,T.x=E,T.y=C,T.positions=I,D.count++,[{x:!1,y:!1,t:T,trace:e}]}}}),ay=d({"src/traces/scattergl/edit_style.js"(t,e){var r=se(),n=q(),i=H().DESELECTDIM;e.exports={styleTextSelection:function(t){var e,a,o=t[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],f=c.unselectBatch[u],p=c.textOptions[u],d=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},p);if(h.length||f.length){var y=d.color,v=m.color,x=p.color,_=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),e=0;e>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),cy=d({"node_modules/object-assign/index.js"(t,e){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var a,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;lt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(c)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var f={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(f):e.elements=o.elements(f)}var p=g.float32(t);return i({data:p,usage:"dynamic"}),a({data:g.fract32(t,p),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i80*r){i=s=t[0],o=l=t[1];for(var x=r;xs&&(s=c),f>l&&(l=f);p=0!==(p=Math.max(s-i,l-o))?32767/p:0}return a(y,v,r,i,o,p,0),v}function n(t,e,r,n,i){var a,o;if(i===S(t,e,r,n)>0)for(a=e;a=e;a-=n)o=k(a,t[a],t[a+1],o);return o&&v(o,o.next)&&(A(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,u,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=p(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,u,h);for(var d,m,g=t;t.prev!==t.next;)if(d=t.prev,m=t.next,h?s(t,n,u,h):o(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),A(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?a(t=l(i(t),e,r),e,r,n,u,h,2):2===f&&c(t,e,r,n,u,h):a(i(t),e,r,n,u,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,d=n.next;d!==e;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&m(i,s,a,l,o,c,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function s(t,e,r,n){var i=t.prev,a=t,o=t.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,d=sl?s>c?s:c:l>c?l:c,x=u>h?u>f?u:f:h>f?h:f,_=p(d,g,e,r,n),b=p(v,x,e,r,n),w=t.prevZ,T=t.nextZ;w&&w.z>=_&&T&&T.z<=b;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,f,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;w&&w.z>=_;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=b;){if(T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,f,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(e.push(a.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),A(n),A(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,o,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,e,r,n,o,s,0),void a(u,e,r,n,o,s,0)}c=c.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x=n.x&&n.x>=u&&i!==n.x&&m(ar.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var n=T(r,t);return i(n,n.next),i(r,r.next)}function f(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var i=b(y(t,e,r)),a=b(y(t,e,n)),o=b(y(r,n,t)),s=b(y(r,n,e));return i!==a&&o!==s||!(0!==i||!_(t,r,e))||!(0!==a||!_(t,n,e))||!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function b(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function k(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,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 S(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}}}),gy=d({"node_modules/array-normalize/index.js"(t,e){var r=Ng();e.exports=function(t,e,n){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==n&&(n=r(t,e));for(var i=0;i-1}}}),Vy=d({"node_modules/es5-ext/string/#/contains/index.js"(t,e){e.exports=Ny()()?String.prototype.contains:Uy()}}),qy=d({"node_modules/d/index.js"(t,e){var r=Ey(),n=Py(),i=jy(),a=By(),o=Vy(),s=e.exports=function(t,e){var n,s,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=o.call(t,"c"),s=o.call(t,"e"),l=o.call(t,"w")):(n=l=!0,s=!1),u={value:e,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(t,e,s){var l,c,u,h;return"string"!=typeof t?(u=s,s=e,e=t,t=null):u=arguments[3],r(e)?n(e)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=e,e=s=void 0):e=void 0,r(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),h={get:e,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),Hy=d({"node_modules/es5-ext/function/is-arguments.js"(t,e){var r=Object.prototype.toString,n=r.call(function(){return arguments}());e.exports=function(t){return r.call(t)===n}}}),Gy=d({"node_modules/es5-ext/string/is-string.js"(t,e){var r=Object.prototype.toString,n=r.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===n)||!1}}}),Zy=d({"node_modules/ext/global-this/is-implemented.js"(t,e){e.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),Wy=d({"node_modules/ext/global-this/implementation.js"(t,e){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),Yy=d({"node_modules/ext/global-this/index.js"(t,e){e.exports=Zy()()?globalThis:Wy()}}),Xy=d({"node_modules/es6-symbol/is-implemented.js"(t,e){var r=Yy(),n={object:!0,symbol:!0};e.exports=function(){var t,e=r.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof e.iterator]&&!!n[typeof e.toPrimitive]&&!!n[typeof e.toStringTag]}}}),$y=d({"node_modules/es6-symbol/is-symbol.js"(t,e){e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}}}),Ky=d({"node_modules/es6-symbol/validate-symbol.js"(t,e){var r=$y();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}}}),Jy=d({"node_modules/es6-symbol/lib/private/generate-name.js"(t,e){var r=qy(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);e.exports=function(t){for(var e,n,s=0;o[t+(s||"")];)++s;return o[t+=s||""]=!0,i(a,e="@@"+t,r.gs(null,(function(t){n||(n=!0,i(this,e,r(t)),n=!1)}))),e}}}),Qy=d({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(t,e){var r=qy(),n=Yy().Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:r("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:r("",n&&n.iterator||t("iterator")),match:r("",n&&n.match||t("match")),replace:r("",n&&n.replace||t("replace")),search:r("",n&&n.search||t("search")),species:r("",n&&n.species||t("species")),split:r("",n&&n.split||t("split")),toPrimitive:r("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:r("",n&&n.toStringTag||t("toStringTag")),unscopables:r("",n&&n.unscopables||t("unscopables"))})}}}),tv=d({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(t,e){var r=qy(),n=Ky(),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:r((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:r((function(t){var e;for(e in n(t),i)if(i[e]===t)return e}))})}}}),ev=d({"node_modules/es6-symbol/polyfill.js"(t,e){var r,n,i,a=qy(),o=Ky(),s=Yy().Symbol,l=Jy(),c=Qy(),u=tv(),h=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof s)try{String(s()),i=!0}catch(t){}else s=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?s(e):(r=h(n.prototype),e=void 0===e?"":String(e),f(r,{__description__:a("",e),__name__:a("",l(e))}))},c(r),u(r),f(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),f(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),p(r.prototype,r.toPrimitive,a("",(function(){var t=o(this);return"symbol"==typeof t?t:t.toString()}))),p(r.prototype,r.toStringTag,a("c","Symbol")),p(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),p(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),rv=d({"node_modules/es6-symbol/index.js"(t,e){e.exports=Xy()()?Yy().Symbol:ev()}}),nv=d({"node_modules/es5-ext/array/#/clear.js"(t,e){var r=wy();e.exports=function(){return r(this).length=0,this}}}),iv=d({"node_modules/es5-ext/object/valid-callable.js"(t,e){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}}),av=d({"node_modules/type/string/coerce.js"(t,e){var r=Ey(),n=Cy(),i=Object.prototype.toString;e.exports=function(t){if(!r(t))return null;if(n(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}}}),ov=d({"node_modules/type/lib/safe-to-string.js"(t,e){e.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(t){return null}}}}}),sv=d({"node_modules/type/lib/to-short-string.js"(t,e){var r=ov(),n=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=r(t);return null===e?"":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(n,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),lv=d({"node_modules/type/lib/resolve-exception.js"(t,e){var r=Ey(),n=Cy(),i=av(),a=sv(),o=function(t,e){return t.replace("%v",a(e))};e.exports=function(t,e,a){if(!n(a))throw new TypeError(o(e,t));if(!r(t)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=e),new TypeError(o(s,t))}}}),cv=d({"node_modules/type/value/ensure.js"(t,e){var r=lv(),n=Ey();e.exports=function(t){return n(t)?t:r(t,"Cannot use %v",arguments[1])}}}),uv=d({"node_modules/type/plain-function/ensure.js"(t,e){var r=lv(),n=Py();e.exports=function(t){return n(t)?t:r(t,"%v is not a plain function",arguments[1])}}}),hv=d({"node_modules/es5-ext/array/from/is-implemented.js"(t,e){e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}}}),fv=d({"node_modules/es5-ext/function/is-function.js"(t,e){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&n(r.call(t))}}}),pv=d({"node_modules/es5-ext/math/sign/is-implemented.js"(t,e){e.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}}}),dv=d({"node_modules/es5-ext/math/sign/shim.js"(t,e){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}}}),mv=d({"node_modules/es5-ext/math/sign/index.js"(t,e){e.exports=pv()()?Math.sign:dv()}}),gv=d({"node_modules/es5-ext/number/to-integer.js"(t,e){var r=mv(),n=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*i(n(t)):t}}}),yv=d({"node_modules/es5-ext/number/to-pos-integer.js"(t,e){var r=gv(),n=Math.max;e.exports=function(t){return n(0,r(t))}}}),vv=d({"node_modules/es5-ext/array/from/shim.js"(t,e){var r=rv().iterator,n=Hy(),i=fv(),a=yv(),o=iv(),s=wy(),l=xy(),c=Gy(),u=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(t){var e,d,m,g,y,v,x,_,b,w,T=arguments[1],k=arguments[2];if(t=Object(s(t)),l(T)&&o(T),this&&this!==Array&&i(this))e=this;else{if(!T){if(n(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(u(t)){for(g=new Array(y=t.length),d=0;d=55296&&v<=56319&&(w+=t[++d]),w=T?h.call(T,k,w,m):w,e?(f.value=w,p(g,m,f)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),d=0;d=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):u(this,"__redo__",s("c",[t])))})),_onDelete:s((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Mv=d({"node_modules/es6-iterator/array.js"(t,e){var r,n=Ay(),i=Vy(),a=qy(),o=rv(),s=Av(),l=Object.defineProperty;r=e.exports=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",l(this,"__kind__",a("",e))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Sv=d({"node_modules/es6-iterator/string.js"(t,e){var r,n=Ay(),i=qy(),a=rv(),o=Av(),s=Object.defineProperty;r=e.exports=function(t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t=String(t),o.call(this,t),s(this,"__length__",i("",t.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),Ev=d({"node_modules/es6-iterator/is-iterable.js"(t,e){var r=Hy(),n=xy(),i=Gy(),a=rv().iterator,o=Array.isArray;e.exports=function(t){return!(!n(t)||!o(t)&&!i(t)&&!r(t)&&"function"!=typeof t[a])}}}),Cv=d({"node_modules/es6-iterator/valid-iterable.js"(t,e){var r=Ev();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not iterable");return t}}}),Iv=d({"node_modules/es6-iterator/get.js"(t,e){var r=Hy(),n=Gy(),i=Mv(),a=Sv(),o=Cv(),s=rv().iterator;e.exports=function(t){return"function"==typeof o(t)[s]?t[s]():r(t)?new i(t):n(t)?new a(t):new i(t)}}}),Lv=d({"node_modules/es6-iterator/for-of.js"(t,e){var r=Hy(),n=iv(),i=Gy(),a=Iv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;e.exports=function(t,e){var c,u,h,f,p,d,m,g,y=arguments[2];if(o(t)||r(t)?c="array":i(t)?c="string":t=a(t),n(e),h=function(){f=!0},"array"!==c)if("string"!==c)for(u=t.next();!u.done;){if(s.call(e,y,u.value,h),f)return;u=t.next()}else for(d=t.length,p=0;p=55296&&g<=56319&&(m+=t[++p]),s.call(e,y,m,h),!f);++p);else l.call(t,(function(t){return s.call(e,y,t,h),f}))}}}),Pv=d({"node_modules/es6-weak-map/is-native-implemented.js"(t,e){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),zv=d({"node_modules/es6-weak-map/polyfill.js"(t,e){var r,n=xy(),i=Ay(),a=My(),o=wy(),s=Sy(),l=qy(),c=Iv(),u=Lv(),h=rv().toStringTag,f=Pv(),p=Array.isArray,d=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;e.exports=r=function(){var t,e=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return t=f&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(e)&&(p(e)||(e=c(e))),d(t,"__weakMapData__",l("c","$weakMap$"+s())),e?(u(e,(function(e){o(e),t.set(e[0],e[1])})),t):t},f&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(t){return!!m.call(a(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:l((function(t){if(m.call(a(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:l((function(t){return m.call(a(t),this.__weakMapData__)})),set:l((function(t,e){return d(a(t),this.__weakMapData__,l("c",e)),this})),toString:l((function(){return"[object WeakMap]"}))}),d(r.prototype,h,l("c","WeakMap"))}}),Dv=d({"node_modules/es6-weak-map/index.js"(t,e){e.exports=yy()()?WeakMap:zv()}}),Ov=d({"node_modules/array-find-index/index.js"(t,e){e.exports=function(t,e,r){if("function"==typeof Array.prototype.findIndex)return t.findIndex(e,r);if("function"!=typeof e)throw new TypeError("predicate must be a function");var n=Object(t),i=n.length;if(0===i)return-1;for(var a=0;a"round"===e.join?2:1,miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight],depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(t,e)=>!e.overlay},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:(t,e)=>e.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},d.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},d.prototype.render=function(...t){t.length&&this.update(...t),this.draw()},d.prototype.draw=function(...t){return(t.length?t:this.passes).forEach(((t,e)=>{if(t&&Array.isArray(t))return this.draw(...t);"number"==typeof t&&(t=this.passes[t]),t&&t.count>1&&t.opacity&&(this.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&this.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>d.precisionThreshold||t.scale[1]*t.viewport.height>d.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=d.maxPoints)?this.shaders.rect(t):this.shaders.miter(t)))})),this},d.prototype.update=function(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let{regl:e,gl:h}=this;if(t.forEach(((t,m)=>{let g=this.passes[m];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=a(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:e.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},d.defaults,t)),null!=t.thickness&&(g.thickness=parseFloat(t.thickness)),null!=t.opacity&&(g.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(g.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(g.overlay=!!t.overlay,mt-e)),e=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let e=p(t,(t=>t>=a));t=t.slice(0,e),t.push(a)}for(let n=0;ne-a+(t[n]-i))),c=s(o,l);c=c.map((e=>e+i+(e+i{t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()})),this.passes.length=0,this}}}),Fv=d({"node_modules/regl-error2d/index.js"(t,e){var r=Ng(),n=jd(),i=hy(),a=jg(),o=cy(),s=Vg(),{float32:l,fract32:c}=py();e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,f,p,d,m,g,y=t._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),f=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:u}),T(e),h=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{color:{buffer:d,offset:(t,e)=>4*e.offset,divisor:1},position:{buffer:f,offset:(t,e)=>8*e.offset,divisor:1},positionFract:{buffer:p,offset:(t,e)=>8*e.offset,divisor:1},error:{buffer:m,offset:(t,e)=>16*e.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:u.length}),o(_,{update:T,draw:b,destroy:k,regl:t,gl:y,canvas:y.canvas,groups:x}),_;function _(t){t?T(t):null===t&&k(),b()}function b(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(((t,r)=>{t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],h(t),t.after&&t.after(t))}function T(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let e=0,u=0;if(_.groups=x=t.map(((t,l)=>{let h=x[l];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=a(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=o({},v,t)),i(h,t,[{lineWidth:t=>.5*+t,capSize:t=>.5*+t,opacity:parseFloat,errors:t=>(t=s(t),u+=t.length,t),positions:(t,n)=>(t=s(t,"float64"),n.count=Math.floor(t.length/2),n.bounds=r(t,2),n.offset=e,e+=n.count,t)},{color:(t,e)=>{let r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){let e=t;t=Array(r);for(let n=0;n{let n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=c(e.scale),e.translateFract=c(e.translate),t},viewport:t=>{let e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},e}}]),h):h})),e||u){let t=x.reduce(((t,e,r)=>t+(e?e.count:0)),0),e=new Float64Array(2*t),r=new Uint8Array(4*t),n=new Float32Array(4*t);x.forEach(((t,i)=>{if(!t)return;let{positions:a,count:o,offset:s,color:l,errors:c}=t;o&&(r.set(l,4*s),n.set(c,4*s),e.set(a,2*s))}));var h=l(e);f(h);var g=c(e,h);p(g),d(r),m(n)}}function k(){f.destroy(),p.destroy(),d.destroy(),m.destroy(),g.destroy()}};var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),jv=d({"node_modules/unquote/index.js"(t,e){var r=/[\'\"]/;e.exports=function(t){return t?(r.test(t.charAt(0))&&(t=t.substr(1)),r.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}}}),Bv=d({"node_modules/css-global-keywords/index.json"(){}}),Nv=d({"node_modules/css-system-font-keywords/index.json"(){}}),Uv=d({"node_modules/css-font-weight-keywords/index.json"(){}}),Vv=d({"node_modules/css-font-style-keywords/index.json"(){}}),qv=d({"node_modules/css-font-stretch-keywords/index.json"(){}}),Hv=d({"node_modules/parenthesis/index.js"(t,e){function r(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach((function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function n(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?n(t,e):r(t,e)}i.parse=r,i.stringify=n,e.exports=i}}),Gv=d({"node_modules/string-split-by/index.js"(t,e){var r=Hv();e.exports=function(t,e,n){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");n?("string"==typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=r.parse(t,{flat:!0,brackets:n.ignore}),a=i[0].split(e);if(n.escape){for(var o=[],s=0;s1&&e===r&&('"'===e||"'"===e))return['"'+n(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return i(t.substr(0,a.index)).concat(i(a[1])).concat(i(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+n(t)+'"'];for(var s=[],l=0;l65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function d(){var t=f(8,(function(){return[]}));function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[p(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[p(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var m=d();m.zero=d();var g=3553,y=6408,v=5126,x=36160,_=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function b(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||_(t.data))}var w=function(t){return Object.keys(t).map((function(e){return t[e]}))},T={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var a=0;a>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function G(t){return Array.isArray(t)||_(t)}var Z=3553,W=34067,Y=34069,X=6408,$=6406,K=6407,J=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ct=33779,ut=5121,ht=5123,ft=5125,pt=5126,dt=33071,mt=9728,gt=9984,yt=9987,vt=4352,xt=33984,_t=[gt,9986,9985,yt],bt=[0,J,Q,K,X],wt={};function Tt(t){return"[object "+t+"]"}wt[6409]=wt[6406]=wt[6402]=1,wt[34041]=wt[6410]=2,wt[6407]=wt[35904]=3,wt[6408]=wt[35906]=4;var kt=Tt("HTMLCanvasElement"),At=Tt("OffscreenCanvas"),Mt=Tt("CanvasRenderingContext2D"),St=Tt("ImageBitmap"),Et=Tt("HTMLImageElement"),Ct=Tt("HTMLVideoElement"),It=Object.keys(M).concat([kt,At,Mt,St,Et,Ct]),Lt=[];Lt[5121]=1,Lt[5126]=4,Lt[36193]=2,Lt[5123]=2,Lt[5125]=4;var Pt=[];function zt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function Dt(t){return!!Array.isArray(t)&&!(0===t.length||!G(t[0]))}function Ot(t){return Object.prototype.toString.call(t)}function Rt(t){return Ot(t)===kt}function Ft(t){return Ot(t)===At}function jt(t){if(!t)return!1;var e=Ot(t);return It.indexOf(e)>=0||zt(t)||Dt(t)||b(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function Nt(t,e){return m.allocType(t.type===at?pt:t.type,e)}function Ut(t,e){t.type===at?(t.data=H(e),m.freeType(e)):t.data=e}function Vt(t,e,r,n,i,a){var o;if(o=void 0!==Pt[t]?Pt[t]:wt[t]*Lt[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function qt(e,r,n,i,a,o,s){var l={"don't care":vt,"dont care":vt,nice:4354,fast:4353},c={repeat:10497,clamp:dt,mirror:33648},u={nearest:mt,linear:9729},h=t({mipmap:yt,"nearest mipmap nearest":gt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":yt},u),f={none:0,browser:37444},p={uint8:ut,rgba4:32819,rgb565:33635,"rgb5 a1":32820},d={alpha:$,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(d.srgb=nt,d.srgba=it),r.oes_texture_float&&(p.float32=p.float=pt),r.oes_texture_half_float&&(p.float16=p["half float"]=at),r.webgl_depth_texture&&(t(d,{depth:et,"depth stencil":rt}),t(p,{uint16:ht,uint32:ft,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(g,{"rgb s3tc dxt1":ot,"rgba s3tc dxt1":st,"rgba s3tc dxt3":lt,"rgba s3tc dxt5":ct}),r.webgl_compressed_texture_atc&&t(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(e.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(d[t]=e)}));var v=Object.keys(d);n.textureFormats=v;var x=[];Object.keys(d).forEach((function(t){var e=d[t];x[e]=t}));var k=[];Object.keys(p).forEach((function(t){var e=p[t];k[e]=t}));var A=[];Object.keys(u).forEach((function(t){A[u[t]]=t}));var M=[];Object.keys(h).forEach((function(t){var e=h[t];M[e]=t}));var S=[];Object.keys(c).forEach((function(t){S[c[t]]=t}));var E=v.reduce((function(t,e){var n=d[e];return n===J||n===$||n===J||n===Q||n===et||n===rt||r.ext_srgb&&(n===nt||n===it)?t[n]=n:n===tt||e.indexOf("rgba")>=0?t[n]=X:t[n]=K,t}),{});function C(){this.internalformat=X,this.format=X,this.type=ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function L(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=f[e.colorSpace]),"type"in e){var r=e.type;t.type=p[r]}var n=t.width,i=t.height,a=t.channels,o=!1;"shape"in e?(n=e.shape[0],i=e.shape[1],3===e.shape.length&&(a=e.shape[2],o=!0)):("radius"in e&&(n=i=e.radius),"width"in e&&(n=e.width),"height"in e&&(i=e.height),"channels"in e&&(a=e.channels,o=!0)),t.width=0|n,t.height=0|i,t.channels=0|a;var s=!1;if("format"in e){var l=e.format,c=t.internalformat=d[l];t.format=E[c],l in p&&("type"in e||(t.type=p[l])),l in g&&(t.compressed=!0),s=!0}!o&&s?t.channels=wt[t.format]:o&&!s&&t.channels!==bt[t.format]&&(t.format=t.internalformat=bt[t.channels])}}function P(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function z(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function D(t,e){var r=null;if(jt(e)?r=e:e&&(L(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),jt(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(_(r))t.channels=t.channels||4,t.data=r,"type"in e||t.type!==ut||(t.type=Bt(r));else if(zt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ut:case ht:case ft:case pt:var n=m.allocType(t.type,r);n.set(e),t.data=n;break;case at:t.data=H(e)}}(t,r),t.alignment=1,t.needsFree=!0;else if(b(r)){var o=r.data;Array.isArray(o)||t.type!==ut||(t.type=Bt(o));var s,l,c,u,h,f,p=r.shape,d=r.stride;3===p.length?(c=p[2],f=d[2]):(c=1,f=1),s=p[0],l=p[1],u=d[0],h=d[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=bt[c],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=Nt(t,o*s*l),u=0,h=0;h>=i,r.height>>=i,D(r,n[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;t.magFilter=u[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=c[s]}if("wrapT"in e){var f=e.wrapT;a=c[f]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e&&(e.anisotropic,t.anisotropic=e.anisotropic),"mipmap"in e){var p=!1;switch(typeof e.mipmap){case"string":t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,p=!0;break;case"boolean":p=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,p=!0}p&&!("min"in e)&&(t.minFilter=gt)}}function Pt(t,n){e.texParameteri(n,10241,t.minFilter),e.texParameteri(n,10240,t.magFilter),e.texParameteri(n,10242,t.wrapS),e.texParameteri(n,10243,t.wrapT),r.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(e.hint(33170,t.mipmapHint),e.generateMipmap(n))}var qt=0,Ht={},Gt=n.maxTextureUnits,Zt=Array(Gt).map((function(){return null}));function Wt(t){C.call(this),this.mipmask=0,this.internalformat=X,this.id=qt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new It,s.profile&&(this.stats={size:0})}function Yt(t){e.activeTexture(xt),e.bindTexture(t.target,t.texture)}function Xt(){var t=Zt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(Z,null)}function $t(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(xt+n),e.bindTexture(i,null),Zt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Ht[t.id],o.textureCount--}return t(Wt.prototype,{bind:function(){var t=this;t.bindCount+=1;var r=t.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}Zt[n]=t,r=n;break}s.profile&&o.maxTextureUnits>l)-o,c.height=c.height||(n.height>>l)-s,Yt(n),R(c,Z,o,s,l),Xt(),B(c),i},i.resize=function(t,r){var a=0|t,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Yt(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;e.texImage2D(Z,l,n.format,c,u,0,n.format,n.type,null)}return Xt(),s.profile&&(n.stats.size=Vt(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(t,r,n,i,a,l){var c=new Wt(W);Ht[c.id]=c,o.cubeCount++;var u=new Array(6);function h(t,e,r,n,i,a){var o,l=c.texInfo;for(It.call(l),o=0;o<6;++o)u[o]=kt();if("number"!=typeof t&&t){if("object"==typeof t)if(e)V(u[0],t),V(u[1],e),V(u[2],r),V(u[3],n),V(u[4],i),V(u[5],a);else if(Lt(l,t),L(c,t),"faces"in t){var f=t.faces;for(o=0;o<6;++o)I(u[o],c),V(u[o],f[o])}else for(o=0;o<6;++o)V(u[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)U(u[o],p,p)}for(I(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Yt(c),o=0;o<6;++o)q(u[o],Y+o);for(Pt(l,W),Xt(),s.profile&&(c.stats.size=Vt(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[c.internalformat],h.type=k[c.type],h.mag=A[l.magFilter],h.min=M[l.minFilter],h.wrapS=S[l.wrapS],h.wrapT=S[l.wrapT],o=0;o<6;++o)At(u[o]);return h}return h(t,r,n,i,a,l),h.subimage=function(t,e,r,n,i){var a=0|r,o=0|n,s=0|i,l=j();return I(l,c),l.width=0,l.height=0,D(l,e),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Yt(c),R(l,Y+t,a,o,s),Xt(),B(l),h},h.resize=function(t){var r=0|t;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Yt(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)e.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xt(),s.profile&&(c.stats.size=Vt(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var t=0;t>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)e.texImage2D(Y+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);Pt(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t>>4&15)+r.charAt(15&e);return n}(function(t){return ae(de(ie(t),8*t.length))}(function(t){for(var e,r,n="",i=-1;++i>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(t)))}function ie(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;return e}function ae(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}function oe(t,e){return t>>>e|t<<32-e}function se(t,e){return t>>>e}function le(t,e,r){return t&e^~t&r}function ce(t,e,r){return t&e^t&r^e&r}function ue(t){return oe(t,2)^oe(t,13)^oe(t,22)}function he(t){return oe(t,6)^oe(t,11)^oe(t,25)}function fe(t){return oe(t,7)^oe(t,18)^se(t,3)}var pe=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function de(t,e){var r,n,i,a,o,s,l,c,u,h,f,p,d,m=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),g=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,u=0;u>16)+(e>>16)+(r>>16)<<16|65535&r}function ge(t){return Array.prototype.slice.call(t)}function ye(t){return ge(t).join("")}var ve="xyzw".split(""),xe="dither",_e="blend.enable",be="blend.color",we="blend.equation",Te="blend.func",ke="depth.enable",Ae="depth.func",Me="depth.range",Se="depth.mask",Ee="colorMask",Ce="cull.enable",Ie="cull.face",Le="frontFace",Pe="lineWidth",ze="polygonOffset.enable",De="polygonOffset.offset",Oe="sample.alpha",Re="sample.enable",Fe="sample.coverage",je="stencil.enable",Be="stencil.mask",Ne="stencil.func",Ue="stencil.opFront",Ve="stencil.opBack",qe="scissor.enable",He="scissor.box",Ge="viewport",Ze="profile",We="framebuffer",Ye="vert",Xe="frag",$e="elements",Ke="primitive",Je="count",Qe="offset",tr="instances",er="vao",rr="Width",nr="Height",ir=We+rr,ar=We+nr,or=Ge+rr,sr=Ge+nr,lr="drawingBuffer",cr=lr+rr,ur=lr+nr,hr=[Te,we,Ne,Ue,Ve,Fe,Ge,He,De],fr=34962,pr=34963,dr=35664,mr=35665,gr=35666,yr=35667,vr=35668,xr=35669,_r=35671,br=35672,wr=35673,Tr=35674,kr=35675,Ar=35676,Mr=35678,Sr=35680,Er=1028,Cr=1029,Ir=2305,Lr=7680,Pr={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Dr={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Or={cw:2304,ccw:Ir};function Rr(t){return Array.isArray(t)||_(t)||b(t)}function Fr(t){return t.sort((function(t,e){return t===Ge?-1:e===Ge?1:t=1,n>=2,e)}if(4===r){var i=t.data;return new jr(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new jr(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new jr(a,o,s,e)}return new jr(3===r,2===r,1===r,e)}var Vr=new jr(!1,!1,!1,(function(){}));function qr(e,r,n,i,a,s,l,c,u,h,p,d,m,g,y,v){var x=h.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,k={dirty:!0,profile:v.profile},A={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),A[n]=k[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(k[n]=r.slice(),A[n]=r.slice()):k[n]=A[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(xe,3024),L(_e,3042),P(be,"blendColor",[0,0,0,0]),P(we,"blendEquationSeparate",[32774,32774]),P(Te,"blendFuncSeparate",[1,0,1,0]),L(ke,2929,!0),P(Ae,"depthFunc",513),P(Me,"depthRange",[0,1]),P(Se,"depthMask",!0),P(Ee,Ee,[!0,!0,!0,!0]),L(Ce,2884),P(Ie,"cullFace",Cr),P(Le,Le,Ir),P(Pe,Pe,1),L(ze,32823),P(De,"polygonOffset",[0,0]),L(Oe,32926),L(Re,32928),P(Fe,"sampleCoverage",[1,!1]),L(je,2960),P(Be,"stencilMask",-1),P(Ne,"stencilFunc",[519,0,-1]),P(Ue,"stencilOpSeparate",[Er,Lr,Lr,Lr]),P(Ve,"stencilOpSeparate",[Cr,Lr,Lr,Lr]),L(qe,3089),P(He,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(Ge,Ge,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var D={gl:e,context:m,strings:r,next:A,current:k,draw:d,elements:s,buffer:a,shader:p,attributes:h.state,vao:h,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Rr},O={primTypes:F,compareFuncs:zr,blendFuncs:Pr,blendEquations:_,stencilOps:Dr,glTypes:S,orientationType:Or};w&&(O.backBuffer=[Cr],O.drawBuffer=f(i.maxDrawbuffers,(function(t){return 0===t?[0]:f(t,(function(t){return 36064+t}))})));var R=0;function j(){var e=function(e){var r=e&&e.cache,n=0,i=[],a=[],o=[];function s(){var e=[],r=[];return t((function(){e.push.apply(e,ge(arguments))}),{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,ge(arguments)),e.push(";")),t},toString:function(){return ye([r.length>0?"var "+r.join(",")+";":"",ye(e)])}})}function l(){var e=s(),r=s(),n=e.toString,i=r.toString;function a(t,n){r(t,n,"=",e.def(t,n),";")}return t((function(){e.apply(e,ge(arguments))}),{def:e.def,entry:e,exit:r,save:a,set:function(t,r,n){a(t,r),e(t,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(t,e){var r=e&&e.stable;if(!r)for(var s=0;s0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o0,T={framebuffer:d,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ze in r){var i=!!r[Ze];(e=Nr((function(t,e){return i}))).enable=i}else if(Ze in n){var a=n[Ze];e=Ur(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),T.uniforms=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r,i=e[t];if("number"==typeof i||"boolean"==typeof i)r=Nr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Nr((function(t){return t.link(i)})):"framebuffer"!==a&&"framebufferCube"!==a||(r=Nr((function(t){return t.link(i.color[0])})))}else G(i)&&(r=Nr((function(t){return t.global.def("[",f(i.length,(function(t){return i[t]})),"]")})));r.value=i,n[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Ur(e,(function(t,r){return t.invoke(r,e)}))})),n}(i),T.drawVAO=T.scopeVAO=g.vao,!T.drawVAO&&v.program&&!u&&n.angle_instanced_arrays&&g.static.elements){var k=!0,A=v.program.attributes.map((function(t){var r=e.static[t];return k=k&&!!r,r}));if(k&&A.length>0){var E=h.getVAO(h.createVAO({attributes:A,elements:g.static.elements}));T.drawVAO=new jr(null,null,null,(function(t,e){return t.link(E)})),T.useVAO=!0}}return u?T.useVAO=!0:T.attributes=function(t){var e=t.static,n=t.dynamic,i={};return Object.keys(e).forEach((function(t){var n=e[t],o=r.id(t),s=new x;if(Rr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,fr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:ve.forEach((function(t,e){e"+e+"?"+n+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",fr,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(e),T.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=Nr((function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)}))})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Ur(e,(function(t,r){return t.invoke(r,e)}))})),n}(o),T}function N(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach((function(a){e.save(n,"."+a);var o=r[a].append(t,e);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),e(i)}function U(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;w&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,c=t.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&e(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function V(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");M.forEach((function(e){var n,u,h=I(e);if(!(h in r.state))if(h in o){n=o[h],u=a[h];var p=f(k[h].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(p.map((function(t,e){return t+"!=="+u+"["+e+"]"})).join("||")).then(i,".",C[h],"(",p,");",p.map((function(t,e){return u+"["+e+"]="+t})).join(";"),";"))}else{n=c.def(l,".",h);var d=t.cond(n,"!==",s,".",h);c(d),h in E?d(t.cond(n).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",n,";"):d(i,".",C[h],"(",n,");",s,".",h,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function q(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;Fr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(t,e);if(E[a]){var h=E[a];Br(c)?(i=t.link(u,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",u,";"))}else if(G(u)){var f=o[a];e(l,".",C[a],"(",u,");",u.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";")}else Br(c)?(i=t.link(u,{stable:!0}),e(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function H(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function Z(t,e,r,n,i){var a,o,s,l=t.shared,c=t.stats,u=l.current,h=l.timer,f=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",p(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function y(t){var r=e.def(u,".profile");e(u,".profile=",t,";"),e.exit(u,".profile=",r,";")}if(f){if(Br(f))return void(f.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=f.append(t,e))}else s=e.def(u,".profile");var v=t.block();d(v),e("if(",s,"){",v,"}");var x=t.block();m(x),e.exit("if(",s,"){",x,"}")}function W(t,e,r,n,i){var a=t.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(Vr))return;var c=t.scopeAttrib(s);o={},Object.keys(new x).forEach((function(t){o[t]=e.def(c,".",t)}))}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function p(){e("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",l,".type!==",a,"||",l,".size!==",r,"||",f.map((function(t){return l+"."+t+"!=="+i[t]})).join("||"),"){",o,".bindBuffer(",fr,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",f.map((function(t){return l+"."+t+"="+i[t]+";"})).join(""),"}"),b){var c=i.divisor;e("if(",l,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",ve.map((function(t,e){return l+"."+t+"!=="+h[e]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",ve.map((function(t,e){return l+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?p():2===c?d():(e("if(",c,"===",1,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case dr:case yr:case _r:return 2;case mr:case vr:case br:return 3;case gr:case xr:case wr:return 4;default:return 1}}(n.info.type),o)}))}function Y(t,e,n,i,a,o){for(var s,l=t.shared,c=l.gl,u=0;u1){for(var M=[],S=[],E=0;E>1)",p],");")}function e(){r(d,".drawArraysInstancedANGLE(",[m,g,y,p],");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function w(){function t(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof p||p>=0)?"string"==typeof p?(r("if(",p,">0){"),_(),r("}else if(",p,"<0){"),w(),r("}")):_():w()}function $(t,e,r,n,i){var a=j(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function K(t,e,r,n){H(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,r,n.attributes,(function(){return!0}))),Y(t,e,r,n.uniforms,(function(){return!0}),!1),X(t,e,e,r)}function J(t,e,r,n){function i(){return!0}t.batchId="a1",H(t,e),W(t,e,r,n.attributes,i),Y(t,e,r,n.uniforms,i,!1),X(t,e,e,r)}function Q(t,e,r,n){H(t,e);var i=r.contextDep,a=e.def(),o=e.def();t.shared.props=o,t.batchId=a;var s=t.scope(),l=t.scope();function c(t){return t.contextDep&&i||t.propDep}function u(t){return!c(t)}if(e(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&N(t,l,r.context),r.needsFramebuffer&&U(t,l,r.framebuffer),q(t,l,r.state,c),r.profile&&c(r.profile)&&Z(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(t.shared.vao,".setVAO(",r.drawVAO.append(t,l),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),W(t,s,r,n.attributes,u),W(t,l,r,n.attributes,c)),Y(t,s,r,n.uniforms,u,!1),Y(t,l,r,n.uniforms,c,!0),X(t,s,l,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,l),p=l.def(f,".id"),d=l.def(h,"[",p,"]");l(t.shared.gl,".useProgram(",f,".program);","if(!",d,"){",d,"=",h,"[",p,"]=",t.link((function(t){return $(J,0,r,t,2)})),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function tt(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!G(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,a=i.current;if(N(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),Fr(Object.keys(e.state)).forEach((function(r){var a=e.state[r],o=a.append(t,n);G(o)?o.forEach((function(e,i){z(e)?n.set(t.next[r],"["+i+"]",e):n.set(t.next[r],"["+i+"]",t.link(e,{stable:!0}))})):Br(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),Z(t,n,e,!0,!0),[$e,Qe,Je,tr,Ke].forEach((function(r){var a=e.draw[r];if(a){var o=a.append(t,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,t.link(o),{stable:!0})}})),Object.keys(e.uniforms).forEach((function(a){var o=e.uniforms[a].append(t,n);Array.isArray(o)&&(o="["+o.map((function(e){return z(e)?e:t.link(e,{stable:!0})}))+"]"),n.set(i.uniforms,"["+t.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(e.attributes).forEach((function(r){var i=e.attributes[r].append(t,n),a=t.scopeAttrib(r);Object.keys(new x).forEach((function(t){n.set(a,"."+t,i[t])}))})),e.scopeVAO){var o=e.scopeVAO.append(t,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",t.link(o,{stable:!0}))}function s(r){var a=e.shader[r];if(a){var o=a.append(t,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,t.link(o,{stable:!0}))}}s(Ye),s(Xe),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,l),function(t,e){var r=t.proc("batch",2);t.batchId="0",H(t,r);var n=!1,i=!0;Object.keys(e.context).forEach((function(t){n=n||e.context[t].propDep})),n||(N(t,r,e.context),i=!1);var a=e.framebuffer,o=!1;function s(t){return t.contextDep&&n||t.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(t,r,a)):U(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),V(t,r,e),q(t,r,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||Z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=o;var l=e.shader.progVar;if(l.contextDep&&n||l.propDep)Q(t,r,e,null);else{var c=l.append(t,r);if(r(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Q(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var u=t.global.def("{}"),h=r.def(c,".id"),f=r.def(u,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",t.link((function(t){return $(Q,0,e,t,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),t(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var Hr=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[],s=[];function l(t,e,r){var n=o.pop()||new a;n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var c=[],u=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),l(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var t,r,a=i.length;if(0!==a){u.length=Math.max(u.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,u[0]=0;var l,h=0;for(t=0,r=0;r0)if(Array.isArray(e[0])){o=I(e);for(var c=1,u=1;u0)if("number"==typeof t[0]){var i=m.allocType(h.dtype,t.length);O(i,t),p(i,n),m.freeType(i)}else if(Array.isArray(t[0])||_(t[0])){r=I(t);var a=C(t,r,h.dtype);p(a,n),m.freeType(a)}}else if(b(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var d=Array.isArray(t.data)?h.dtype:D(t.data),g=m.allocType(d,s*l);R(g,t.data,s,l,c,u,t.offset),p(g,n),m.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){u(h)},f},createStream:function(t,e){var r=s.pop();return r||(r=new o(t)),r.bind(),c(r,e,35040,0,1,!1),r},destroyStream:function(t){s.push(t)},clear:function(){w(a).forEach(u),s.forEach(u)},getBuffer:function(t){return t&&t._buffer instanceof o?t._buffer:null},restore:function(){w(a).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:c}}(n,p,r,(function(t){return Y.destroyBuffer(t)})),W=function(t,e,r,n){var i={},a=0,o={uint8:j,uint16:B};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}e.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;c||_(i)&&(!b(i)||_(i.data))||(h=e.oes_element_index_uint?N:B),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=u||j,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case j:case 5120:u=j;break;case B:case 5122:u=B;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var f=s;f<0&&(f=n.buffer.byteLength,u===B?f>>=1:u===N&&(f>>=2)),n.vertCount=f;var p=o;if(o<0){p=4;var d=n.buffer.dimension;1===d&&(p=0),2===d&&(p=1),3===d&&(p=4)}n.primType=p}function u(t){n.elementsCount--,delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,e){var i=r.create(null,U,!0),a=new s(i._buffer);function l(t){if(t)if("number"==typeof t)i(t),a.primType=4,a.vertCount=0|t,a.type=j;else{var e=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(t)||_(t)||b(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=E[t.usage]),"primitive"in t&&(n=F[t.primitive]),"count"in t&&(s=0|t.count),"type"in t&&(h=o[t.type]),"length"in t?u=0|t.length:(u=s,h===B||5122===h?u*=2:h!==N&&5124!==h||(u*=4))),c(a,e,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=j;return l}return n.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return i.subdata(t,e),l},l.destroy=function(){u(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),c(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){w(i).forEach(u)}}}(n,T,Z,p),Y=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c=p.byteLength?u.subdata(p):(u.destroy(),e.buffers[c]=null)),e.buffers[c]||(u=e.buffers[c]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[c]=1):i.getBuffer(h)?(f.buffer=i.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(h.buffer)?(f.buffer=i.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,f.type="type"in h?S[h.type]:f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1):"x"in h&&(f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2)}for(var d=0;d1)for(var y=0;yt&&(t=e.stats.uniformsCount)})),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var t=e.deleteShader.bind(e);w(a).forEach(t),a={},w(o).forEach(t),o={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var f=c[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(c[r]=m),h.push(m),t(m,{destroy:function(){if(m.refCount--,m.refCount<=0){e.deleteProgram(m.program);var t=h.indexOf(m);h.splice(t,1),n.shaderCount--}c[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var t=0;t=0?f=!0:c.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(k=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return t(n,{width:l,height:l,color:o})}return n(e),t(n,{faces:r,resize:function(t){var e,i=0|t;if(i===n.width)return n;var a=n.color;for(e=0;e=0;--t){var e=nt[t];e&&e(q,null,0)}n.flush(),k&&k.update()}function ct(){!st&&nt.length>0&&(st=s.next(lt))}function ut(){st&&(s.cancel(lt),st=null)}function ht(t){t.preventDefault(),ut(),it.forEach((function(t){t()}))}function ft(t){n.getError(),a.restore(),X.restore(),Z.restore(),$.restore(),K.restore(),J.restore(),Y.restore(),k&&k.restore(),Q.procs.refresh(),ct(),at.forEach((function(t){t()}))}function pt(e){function r(t,e){var r={},n={};return Object.keys(t).forEach((function(i){var a=t[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(e&&Array.isArray(a))for(var s=0;s0)return h.call(this,function(t){for(;p.length=0},read:tt,destroy:function(){nt.length=0,ut(),rt&&(rt.removeEventListener(Gr,ht),rt.removeEventListener(Zr,ft)),X.clear(),J.clear(),K.clear(),Y.clear(),$.clear(),W.clear(),Z.clear(),k&&k.clear(),ot.forEach((function(t){t()}))},_gl:n,_refresh:xt,poll:function(){vt(),k&&k.update()},now:_t,stats:p,getCachedCode:function(){return d},preloadCachedCode:function(t){Object.entries(t).forEach((function(t){d[t[0]]=t[1]}))}});return r.onDone(null,bt),bt}},"object"==typeof t&&void 0!==e?e.exports=i():void 0===(a="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=a)}}),Jv=d({"node_modules/gl-util/context.js"(t,e){var r=jg();function n(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function a(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=i(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:r(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var o=document.querySelector(t.container);if(!o)throw Error("Element "+t.container+" is not found");t.container=o}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=a(),t.container.appendChild(t.canvas),n(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=a(),t.container.appendChild(t.canvas),n(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}}}),Qv=d({"node_modules/font-atlas/index.js"(t,e){var r=Xv(),n=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],i=t.canvas||document.createElement("canvas"),a=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||n;if(a&&"string"!=typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");e=e.slice(),i.width=e[0],i.height=e[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var f=o[0]/2,p=o[1]/2;for(c=0;ce[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return i}}}),tx=d({"node_modules/bit-twiddle/twiddle.js"(t){function e(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(t){return(t>0)-(t<0)},t.abs=function(t){var e=t>>31;return(t^e)-e},t.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},t.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},t.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},t.countTrailingZeros=e,t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},t.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},t.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},t.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},t.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},t.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},t.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>e(t)+1}}}),ex=d({"node_modules/dup/dup.js"(t,e){function r(t,e,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n0?n.pop():new ArrayBuffer(t)}function f(t){return new Uint8Array(h(t),0,t)}function p(t){return new Uint16Array(h(2*t),0,t)}function d(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function g(t){return new Int16Array(h(2*t),0,t)}function y(t){return new Int32Array(h(4*t),0,t)}function v(t){return new Float32Array(h(4*t),0,t)}function x(t){return new Float64Array(h(8*t),0,t)}function _(t){return i?new Uint8ClampedArray(h(t),0,t):f(t)}function b(t){return a?new BigUint64Array(h(8*t),0,t):null}function w(t){return o?new BigInt64Array(h(8*t),0,t):null}function T(t){return new DataView(h(t),0,t)}function k(t){t=e.nextPow2(t);var r=e.log2(t),i=c[r];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))c[e.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,i=0|e.log2(r);l[i].push(t)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(t){u(t.buffer)},t.freeArrayBuffer=u,t.freeBuffer=function(t){c[e.log2(t.length)].push(t)},t.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return f(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return m(t);case"int16":return g(t);case"int32":return y(t);case"float":case"float32":return v(t);case"double":case"float64":return x(t);case"uint8_clamped":return _(t);case"bigint64":return w(t);case"biguint64":return b(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},t.mallocArrayBuffer=h,t.mallocUint8=f,t.mallocUint16=p,t.mallocUint32=d,t.mallocInt8=m,t.mallocInt16=g,t.mallocInt32=y,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=x,t.mallocUint8Clamped=_,t.mallocBigUint64=b,t.mallocBigInt64=w,t.mallocDataView=T,t.mallocBuffer=k,t.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.BIGUINT64[t].length=0,s.BIGINT64[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}}),nx=d({"node_modules/is-plain-obj/index.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}}}),ix=d({"node_modules/parse-unit/index.js"(t,e){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}}}),ax=d({"node_modules/to-px/topx.js"(t,e){var r=ix();function n(t,e){var n=r(getComputedStyle(t).getPropertyValue(e));return n[0]*i(n[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}e.exports=i}}),ox=d({"node_modules/detect-kerning/index.js"(t,e){e.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var i,o={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?i=a(e):Array.isArray(e)?i=e:(e.o?i=a(e.o):e.pairs&&(i=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),i||(i=n),r.font=s+"px "+t;for(var c=0;cs*l){var p=(f-h)/s;o[u]=1e3*p}}return o}function a(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),lx=d({"node_modules/gl-text/dist.js"(t,e){var r,n=$v(),i=jg(),a=Kv(),o=Jv(),s=Dv(),l=jd(),c=Qv(),u=rx(),h=Bg(),f=nx(),p=ix(),d=ax(),m=ox(),g=cy(),y=sx(),v=Vg(),x=tx().nextPow2,_=new s,b=!1;document.body&&((r=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(r).fontStretch&&(b=!0),document.body.removeChild(r));var w=function(t){!function(t){return"function"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=_.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),_.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(f(t)?t:{})};w.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},w.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=v(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=w.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(w.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,c=t.variant;t=n.parse(n.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),c&&(t.variant=c)}var u=n.stringify({size:w.baseFontSize,family:t.family,stretch:b?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=p(t.size),f=Math.round(h[0]*d(h[1]));if(f!==e.fontSize[r]&&(o=!0,e.fontSize[r]=f),!(e.font[r]&&u==e.font[r].baseString||(a=!0,e.font[r]=w.fonts[u],e.font[r]))){var m=t.family.join(", "),g=[t.style];t.style!=t.variant&&g.push(t.variant),t.variant!=t.weight&&g.push(t.weight),b&&t.weight!=t.stretch&&g.push(t.stretch),e.font[r]={baseString:u,family:m,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:y(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:g.join(" ")})},w.fonts[u]=e.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:b?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),f=0;f2){for(var T=!t.position[0].length,k=u.mallocFloat(2*this.count),A=0,M=0;A1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],i*=-1}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=u.mallocUint8(G);for(var Z=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var $=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array($);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},e.exports=w}}),cx=d({"src/lib/prepare_regl.js"(t,e){var r=$d(),n=Kv();e.exports=function(t,e,i){var a=t._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:i||{}})}catch(t){o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),ux=d({"src/traces/scattergl/plot.js"(t,e){var r=dy(),n=Rv(),i=Fv(),a=lx(),o=se(),s=Dr().selectMode,l=cx(),c=We(),u=ui(),h=ay().styleTextSelection,f={};function p(t,e,r,n){var i=t._size,a=t.width*n,o=t.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,f=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*f,a-c-(1-e.domain[1])*h,o-u-(1-r.domain[1])*f]}(e.exports=function(t,e,d){if(d.length){var m,g,y=t._fullLayout,v=e._scene,x=e.xaxis,_=e.yaxis;if(v)if(l(t,["ANGLE_instanced_arrays","OES_element_index_uint"],f)){var b=v.count,w=y._glcanvas.data()[0].regl;if(u(t,e,d),v.dirty){if(!v.line2d&&!v.error2d||v.scatter2d||v.fill2d||v.glText||w.clear({}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(b),m=0;mv.glText.length){var T=b-v.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var A=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(A)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var r=d[e];if(t&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[e],c=[];o._ownfill&&c.push(e),o._nexttrace&&c.push(e+1),c.length&&(v.fillOrder[e]=c);var u,h,f=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;uu&&isNaN(p[h+1]);)h-=2;0!==p[u+1]&&(f=[p[u],0]),f=f.concat(p.slice(u,h+2)),0!==p[h+1]&&(f=f.concat([p[h],0]))}else if("tozerox"===o.fill){for(u=0;uu&&isNaN(p[h]);)h-=2;0!==p[u]&&(f=[0,p[u+1]]),f=f.concat(p.slice(u,h+2)),0!==p[h]&&(f=f.concat([0,p[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(f=[],n=0,t.splitNull=!0,i=0;i-1;for(m=0;ma&&l||ih?_.sizeAvg||Math.max(_.size,3):i(e,x),p=0;p2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),f.length>2?(s=f[0],c=f[2],l=f[1],u=f[3]):f.length?(s=l=f[0],c=u=f[1]):(s=f.x,l=f.y,c=f.x+f.width,u=f.y+f.height),[s,i,c,o]}function f(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];{let e=s(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}}e.exports=c,c.prototype.render=function(...t){return t.length&&this.update(...t),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.prototype.update=function(...t){if(!t.length)return;for(let e=0;ee)continue;if(!c.lower&&t{e[a+r]=n}))}this.scatter.draw(...e)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((t=>{t.buffer&&t.buffer.destroy&&t.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),wx=d({"src/traces/splom/plot.js"(t,e){var r=bx(),n=se(),i=ve(),a=Dr().selectMode;function o(t,e){var o,s,l,c,u,h=t._fullLayout,f=h._size,p=e.trace,d=e.t,m=h._splomScenes[p.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=p.showupperhalf,g.upper=p.showlowerhalf,g.diagonal=p.diagonal.visible;var _=p._visibleDims,b=y.length,w=m.viewOpts={};for(w.ranges=new Array(b),w.domains=new Array(b),u=0;u<_.length;u++){l=_[u];var T=w.ranges[u]=new Array(4),k=w.domains[u]=new Array(4);(o=i.getFromId(t,p._diag[l][0]))&&(T[0]=o._rl[0],T[2]=o._rl[1],k[0]=o.domain[0],k[2]=o.domain[1]),(s=i.getFromId(t,p._diag[l][1]))&&(T[1]=s._rl[0],T[3]=s._rl[1],k[1]=s.domain[0],k[3]=s.domain[1])}var A=t._context.plotGlPixelRatio,M=f.l*A,S=f.b*A,E=f.w*A,C=f.h*A;w.viewport=[M,S,E+M,C+S],!0===m.matrix&&(m.matrix=r(v));var I=h.clickmode.indexOf("select")>-1,L=!0;if(a(x)||p.selectedpoints||I){var P=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var z=p.selectedpoints,D={};for(l=0;l=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],u=l,f=a;i*fe){f=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-c[h][1]t[1]+n||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var y=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(n=0;n=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(i)].sort(o),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),_(t.parentNode)}function T(t,e){var i=b(e,e.height-n.mouse(t)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){n.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(t){!function(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.unitToPaddedPx.invert(i),o=e.brush,s=b(e,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,i=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),_(t.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?_(t.parentNode,s):(s(),_(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,t)})))}function A(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var s,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(o)})).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(s=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e),n=r.slice();e.filter.set(n),s()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,n){var o=t.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(t,e,n){var i=n._context.staticPlot,o=t.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(k).attr("height",(function(t){return t.height-r.verticalPadding}));var l=t.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",e).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(t){return t.height})).call(x);var c=t.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(x)}(o,e,n)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(o)})),t=e.multiselect?S(t.sort(A)):[t[0]]):t=[t.sort(o)],e.tickvals){var r=e.tickvals.slice().sort(o);if(!(t=t.map((function(t){var e=[f(0,r,t[0],[]),f(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}}}),Ox=d({"src/traces/parcoords/defaults.js"(t,e){var r=se(),n=Se().hasColorscale,i=Ve(),a=Ta().defaults,o=je(),s=nr(),l=Lx(),c=Dx(),u=Px().maxDimensionCount,h=dx();function f(t,e,n,i){function a(n,i){return r.coerce(t,e,l.dimensions,n,i)}var o=a("values"),u=a("visible");if(o&&o.length||(u=e.visible=!1),u){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(e._ax,i.layout),a("multiselect");var f=a("constraintrange");f&&(e.constraintrange=c.cleanRanges(f,e))}}e.exports=function(t,e,s,c){function p(n,i){return r.coerce(t,e,l,n,i)}var d=t.dimensions;Array.isArray(d)&&d.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),d.splice(u));var m=o(t,e,{name:"dimensions",layout:c,handleItemDefaults:f}),g=function(t,e,a,o,s){var l=s("line.color",a);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,s,c,p);a(e,c,p),Array.isArray(m)&&m.length||(e.visible=!1),h(e,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(p,"labelfont",y),r.coerceFont(p,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(p,"rangefont",y),p("labelangle"),p("labelside"),p("unselected.line.color"),p("unselected.line.opacity")}}}),Rx=d({"src/traces/parcoords/calc.js"(t,e){var r=se().isArrayOrTypedArray,n=Ze(),i=zx().wrap;e.exports=function(t,e){var a,o;return n.hasColorscale(e,"line")&&r(e.line.color)?(a=e.line.color,o=n.extractOpts(e.line).colorscale,n.calc(t,e,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(t){for(var e=new Array(t),r=0;r 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=Px().maxDimensionCount,a=se(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function f(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[n].dim1.canvasX,a=n);0===o&&h(A,0,0,l.canvasWidth,l.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&n<_.length?_[n].brush.filter.getBounds():[-1/0,1/0];i[0][n]=a[0],i[1][n]=a[1]}var o=new Array(16384);for(e=0;e<16384;e++)o[e]=255;if(!t)for(e=0;e<_.length;e++){var l=e%8,c=(e-l)/8,u=Math.pow(2,l),h=_[e].brush.filter.get();if(!(h.length<2)){var f=x(h[0])[1];for(r=1;rs._length&&(E=E.slice(0,s._length));var I,L=s.tickvals;function P(t,e){return{val:t,text:I[e]}}function z(t,e){return t.val-e.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),I=s.ticktext,i(I)&&I.length?I.length>L.length?I=I.slice(0,L.length):L.length>I.length&&(L=L.slice(0,I.length)):I=L.map(a(s.tickformat));for(var D=1;D=n||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,f={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==B&&(u?a.hover(f):a.unhover&&a.unhover(f),B=h)}})),j.style("opacity",(function(t){return t.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var N=p.selectAll("."+x.cn.parcoords).data(F,d);N.exit().remove(),N.enter().append("g").classed(x.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),N.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var U=N.selectAll("."+x.cn.parcoordsControlView).data(m,d);U.enter().append("g").classed(x.cn.parcoordsControlView,!0),U.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var V=U.selectAll("."+x.cn.yAxis).data((function(t){return t.dimensions}),d);V.enter().append("g").classed(x.cn.yAxis,!0),U.each((function(t){D(V,t,w)})),j.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),V.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),V.call(r.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;E.linePickActive(!1),t.x=Math.max(-x.overdrag,Math.min(t.model.width+x.overdrag,r.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,V.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),D(V,e,w),V.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),r.select(this).attr("transform",c(t.x,0)),V.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!C(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,D(V,e,w),r.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!C(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),E.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),V.exit().remove();var q=V.selectAll("."+x.cn.axisOverlays).data(m,d);q.enter().append("g").classed(x.cn.axisOverlays,!0),q.selectAll("."+x.cn.axis).remove();var H=q.selectAll("."+x.cn.axis).data(m,d);H.enter().append("g").classed(x.cn.axis,!0),H.each((function(t){var e=t.model.height/t.model.tickDistance,n=t.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return y.isOrdinal(t)?e:O(t.model.dimensions[t.visibleIndex],e)})).scale(n)),h.font(H.selectAll("text"),t.model.tickFont)})),H.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),H.selectAll("text").style("cursor","default");var G=q.selectAll("."+x.cn.axisHeading).data(m,d);G.enter().append("g").classed(x.cn.axisHeading,!0);var Z=G.selectAll("."+x.cn.axisTitle).data(m,d);Z.enter().append("text").classed(x.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),Z.text((function(t){return t.label})).each((function(e){var n=r.select(this);h.font(n,e.model.labelFont),u.convertToTspans(n,t)})).attr("transform",(function(t){var e=z(t.model.labelAngle,t.model.labelSide),r=x.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=z(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var W=q.selectAll("."+x.cn.axisExtent).data(m,d);W.enter().append("g").classed(x.cn.axisExtent,!0);var Y=W.selectAll("."+x.cn.axisExtentTop).data(m,d);Y.enter().append("g").classed(x.cn.axisExtentTop,!0),Y.attr("transform",c(0,-x.axisExtentOffset));var X=Y.selectAll("."+x.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(x.cn.axisExtentTopText,!0).call(P),X.text((function(t){return R(t,!0)})).each((function(t){h.font(r.select(this),t.model.rangeFont)}));var $=W.selectAll("."+x.cn.axisExtentBottom).data(m,d);$.enter().append("g").classed(x.cn.axisExtentBottom,!0),$.attr("transform",(function(t){return c(0,t.model.height+x.axisExtentOffset)}));var K=$.selectAll("."+x.cn.axisExtentBottomText).data(m,d);K.enter().append("text").classed(x.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(P),K.text((function(t){return R(t,!1)})).each((function(t){h.font(r.select(this),t.model.rangeFont)})),_.ensureAxisBrush(q,k,t)}}}),Nx=d({"src/traces/parcoords/plot.js"(t,e){var r=Bx(),n=cx(),i=Fx().isVisible,a={};function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var s=t._fullLayout;if(n(t,[],a)){var l={},c={},u={},h={},f=s._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()})),r(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=c[e][r],a=n.map((function(t){return t.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[o]){var f=i.constraintrange;l[o]=f||null}var p=t._fullData[u[e]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,p.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete p.constraintrange,a=null);var d={};d[o]=a,t.emit("plotly_restyle",[d,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,c[e].filter(i));l[e].sort(n),c[e].filter((function(t){return!i(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[h[e]]])}})}}).reglPrecompiled=a}}),Ux=d({"src/traces/parcoords/base_plot.js"(t){var e=v(),r=be().getModuleCalcData,n=Nx(),i=ke();t.name="parcoords",t.plot=function(t){var e=r(t.calcdata,"parcoords")[0];e.length&&n(t,e)},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter((function(t,e){return e===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})})),window.setTimeout((function(){e.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),Vx=d({"src/traces/parcoords/base_index.js"(t,e){e.exports={attributes:Lx(),supplyDefaults:Ox(),calc:Rx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Ux(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),qx=d({"src/traces/parcoords/index.js"(t,e){var r=Vx();r.plot=Nx(),e.exports=r}}),Hx=d({"lib/parcoords.js"(t,e){e.exports=qx()}}),Gx=d({"src/traces/parcats/attributes.js"(t,e){var r=O().extendFlat,n=N(),i=R(),a=Le(),o=Dt().hovertemplateAttrs,s=Ta().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});e.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),Zx=d({"src/traces/parcats/defaults.js"(t,e){var r=se(),n=Se().hasColorscale,i=Ve(),a=Ta().defaults,o=je(),s=Gx(),l=dx(),c=S().isTypedArraySpec;function u(t,e){function n(n,i){return r.coerce(t,e,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=e.visible=!1),a){n("label"),n("displayindex",e._index);var o,l=t.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==h||(e.categoryorder="trace")}}e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,s,n,i)}var p=o(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,c,h,f);a(e,h,f),Array.isArray(p)&&p.length||(e.visible=!1),l(e,p,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var m=h.font;r.coerceFont(f,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(f,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),Wx=d({"src/traces/parcats/calc.js"(t,e){var r=zx().wrap,n=Se().hasColorscale,i=Ge(),a=ne(),o=Je(),s=se(),l=T();function c(t,e,r){t.valueInds.push(e),t.count+=r}function u(t,e,r){return{categoryInds:t,color:e,rawColor:r,valueInds:[],count:0}}function h(t,e,r){t.valueInds.push(e),t.count+=r}e.exports=function(t,e){var f=s.filterVisible(e.dimensions);if(0===f.length)return[];var p,d,m,g=f.map((function(t){var e;if("trace"===t.categoryorder)e=null;else if("array"===t.categoryorder)e=t.categoryarray;else{e=a(t.values);for(var r=!0,n=0;n=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(r))for(e=0;ee.model.rawColor?1:t.model.rawColor"),C=r.mouse(h)[0];a.loneHover({trace:f,x:v-d.left+m.left,y:b-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C1&&f.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var _=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:v,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:y}]}}function I(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var e,n=t.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron,u=this;"color"===l?(function(t){var e=r.select(t).datum(),n=M(e);T(n),n.each((function(){o.raiseToTop(this)})),r.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),E(u,"plotly_hover",r.event)):(function(t){r.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=M(t);T(e),e.each((function(){o.raiseToTop(this)}))})),r.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),S(u,"plotly_hover",r.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=C(n,s,u):"color"===l?e=function(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,f=h.parcatsViewModel,p=f.model.dimensions[h.model.dimensionInd],d=f.trace,m=l.y+l.height/2;f.dimensions.length>1&&p.displayInd===f.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(t){t.color===u.color&&(v+=t.count)}));var x=h.model.count,_=0;f.pathSelection.each((function(t){t.model.color===u.color&&(_+=t.model.count)}));var b=v/y,w=v/_,T=v/x,k={countLabel:v,categoryLabel:g,probabilityLabel:b.toFixed(3)},A=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color ∩ "+g+"): "+k.probabilityLabel),A.push("P("+g+" | color): "+w.toFixed(3)),A.push("P(color | "+g+"): "+T.toFixed(3)));var M=A.join("
"),S=c.mostReadable(u.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(e=function(t,e,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(t,e,this))})),i}(n,s,u)),e&&a.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(t){var e=t.parcatsViewModel;e.dragDimension||(w(e.pathSelection),k(e.dimensionSelection.selectAll("g.category")),A(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(d),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):S(this,"plotly_unhover",r.event))}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var f=t.parcatsViewModel.dimensions[n],p=t.parcatsViewModel.dimensions[i];void 0!==f&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}V(t.parcatsViewModel),U(t.parcatsViewModel),j(t.parcatsViewModel),F(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var e={},n=R(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==a[e]}));o&&a.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?E(t.potentialClickBand,"plotly_click",r.event.sourceEvent):S(t.potentialClickBand,"plotly_click",r.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,V(t.parcatsViewModel),U(t.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){j(t.parcatsViewModel,!0),F(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[n])}))}}function R(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),u+="l-"+r[s]+",0 ";return u+="Z"}function U(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),i=h(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var f=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(y.count/p):0;for(var v,x=new Array(n.length),_=0;_1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=t.model.maxCats,f=e.categories.length,p=e.count,d=t.height-8*(h-1),m=8*(h-f)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}}}),Xx=d({"src/traces/parcats/plot.js"(t,e){var r=Yx();e.exports=function(t,e,n,i){var a=t._fullLayout,o=a._paper,s=a._size;r(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),$x=d({"src/traces/parcats/base_plot.js"(t){var e=be().getModuleCalcData,r=Xx(),n="parcats";t.name=n,t.plot=function(t,i,a,o){var s=e(t.calcdata,n);if(s.length){var l=s[0];r(t,l,a,o)}},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcats"),a=e._has&&e._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),Kx=d({"src/traces/parcats/index.js"(t,e){e.exports={attributes:Gx(),supplyDefaults:Zx(),calc:Wx(),plot:Xx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:$x(),categories:["noOpacity"],meta:{}}}}),Jx=d({"lib/parcats.js"(t,e){e.exports=Kx()}}),Qx=d({"src/plots/mapbox/constants.js"(t,e){var r=Zt(),n="1.13.4",i='© OpenStreetMap contributors',a=['© Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=r(s);e.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+n+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}}),t_=d({"src/plots/mapbox/layout_attributes.js"(t,e){var r=se(),n=q().defaultLine,i=Ta().attributes,a=R(),o=wn().textposition,s=Lt().overrideAll,l=ge().templatedArray,c=Qx(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),e_=d({"src/traces/scattermapbox/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=bn(),a=Gm(),o=wn(),s=t_(),l=N(),c=Le(),u=O().extendFlat,h=Lt().overrideAll,f=t_(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),r_=d({"src/traces/scattermapbox/constants.js"(t,e){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),n_=d({"src/traces/scattermapbox/defaults.js"(t,e){var r=se(),n=We(),i=Zn(),a=Wn(),o=Xn(),s=$n(),l=e_(),c=r_().isSupportedFont;e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f);if(d){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),n.hasMarkers(e)){i(t,e,u,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==e.fill&&s(t,e,u,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),i_=d({"src/traces/scattermapbox/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),a_=d({"src/plots/mapbox/convert_text_opts.js"(t,e){var r=se();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),o_=d({"src/traces/scattermapbox/convert.js"(t,e){var r=T(),n=se(),i=k().BADNUM,a=Jm(),o=Ze(),s=Je(),l=Ye(),c=We(),u=r_().isSupportedFont,h=a_(),f=Xe().appendArrayPointValue,p=Me().NEWLINES,d=Me().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),k=c.hasMarkers(u),A=c.hasText(u),M=k&&"circle"===u.marker.symbol,S=k&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,_=[];for(e=0;e=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function f(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",f.circle,l.cluster),r=0;r")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-f.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),c_=d({"src/traces/scattermapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),u_=d({"src/traces/scattermapbox/select.js"(t,e){var r=se(),n=We(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},l=Math.pow(2,53)-1;function c(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}var u=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function f(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function x(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function b(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function w(t){return Array.isArray(t)?t.map(w):"object"==typeof t&&t?_(t,w):t}var T={};function k(t){T[t]||("undefined"!=typeof console&&console.warn(t),T[t]=!0)}function A(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function M(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var C=null;function I(t){if(null==C){var e=t.navigator?t.navigator.userAgent:null;C=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return C}function L(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,z,D,O,R=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,j=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,B={now:R,frame:function(t){var e=F(t);return{cancel:function(){return j(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&O&&(q?H(t):D=t)}},V=!1,q=!1;function H(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,O),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}s.document&&((O=s.document.createElement("img")).onload=function(){D&&H(D),D=null,q=!0},O.onerror=function(){V=!0,D=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",Z=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function W(t){return 0===t.indexOf("mapbox:")}Z.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},Z.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Z.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},Z.prototype.normalizeStyleURL=function(t,e){if(!W(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},Z.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!W(t))return t;var r=K(t),n=B.devicePixelRatio>=2||512===e?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!N.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Y.test(t)}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match($);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var Q="mapbox.eventData";function tt(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(s.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var et=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};et.prototype.getStorageKey=function(t){var e,r=tt(N.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n=N.ACCESS_TOKEN||"",t?Q+"."+t+":"+n:Q+":"+n},et.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){k("Unable to read from LocalStorage")}},et.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){k("Unable to write to LocalStorage")}},et.prototype.processRequests=function(t){},et.prototype.postEvent=function(t,e,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=e?p(s,e):s,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=St(c,(function(t){a.pendingRequest=null,n(t),a.saveEventData(),a.processRequests(i)}))}},et.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var rt,nt,it=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(et),at=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=tt(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(et)),ot=at.postTurnstileEvent.bind(at),st=new it,lt=st.postMapLoadEvent.bind(st),ct="mapbox-tiles",ut=500,ht=50;function ft(){s.caches&&!rt&&(rt=s.caches.open(ct))}function pt(t,e,r){if(ft(),rt){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=E(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===nt)try{new Response(new ReadableStream),nt=!0}catch(t){nt=!1}nt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new s.Response(e,n);ft(),rt&&rt.then((function(e){return e.put(dt(t.url),r)})).catch((function(t){return k(t.message)}))})))}}function dt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function mt(t,e){if(ft(),!rt)return e(null);var r=dt(t.url);rt.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}var gt,yt=1/0;function vt(){return null==gt&&(gt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),gt}var xt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(xt);var _t=function(t){function e(e,r,n){401===r&&X(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),bt=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function wt(t,e){var r,n=new s.AbortController,i=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:bt(),signal:n.signal}),a=!1,o=!1,l=(r=i.url).indexOf("sku=")>0&&X(r);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&k(r),n&&a)return u(n);var c=Date.now();s.fetch(i).then((function(r){if(r.ok){var n=l?r.clone():null;return u(r,n,c)}return e(new _t(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&pt(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return l?mt(i,c):c(null,null),{cancel:function(){o=!0,a||n.abort()}}}var Tt,kt,At=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(bt())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return wt(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new s.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new _t(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Mt=function(t,e){return At(p(t,{type:"arrayBuffer"}),e)},St=function(t,e){return At(p(t,{method:"POST"}),e)},Et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Tt=[],kt=0;var Ct=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),kt>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Tt.push(r),r}kt++;var n=!1,i=function(){if(!n)for(n=!0,kt--;Tt.length&&kt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Dt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Ot={$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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},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:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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-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"],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}},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"}}},Rt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ft(t){var e=t.key,r=t.value;return r?[new Rt(e,r,"constants have been deprecated as of v8")]:[]}function jt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ee=[qt,Ht,Gt,Zt,Wt,Kt,Yt,Qt(Xt),Jt];function re(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!re(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=ee;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,oe=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};oe.parse=function(t){if(t){if(t instanceof oe)return t;if("string"==typeof t){var e=ae(t);if(e)return new oe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},oe.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},oe.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},oe.black=new oe(0,0,0,1),oe.white=new oe(1,1,1,1),oe.transparent=new oe(0,0,0,0),oe.red=new oe(1,0,0,1);var se=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var le=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ce=function(t){this.sections=t};ce.fromString=function(t){return new ce([new le(t,null,null,null,null)])},ce.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ce.factory=function(t){return t instanceof ce?t:ce.fromString(t)},ce.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function fe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof oe)return!0;if(t instanceof se)return!0;if(t instanceof ce)return!0;if(t instanceof ue)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in ye)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ye[s],n++}else a=Xt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Qt(a,o)}else r=ye[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var xe=function(t){this.type=Kt,this.sections=t};xe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Qt(Gt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Wt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[a],1,Xt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new xe(n)},xe.prototype.evaluate=function(t){return new ce(this.sections.map((function(e){var r=e.content.evaluate(t);return pe(r)===Jt?new le("",r,null,null,null):new le(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},xe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},_e.prototype.eachChild=function(t){t(this.input)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return["image",this.input.serialize()]};var be={"to-boolean":Zt,"to-color":Wt,"to-number":Ht,"to-string":Gt},we=function(t,e){this.type=t,this.args=e};we.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=be[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":he(e[0],e[1],e[2],e[3])))return new oe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ge(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ie(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*Se),Math.round(i*a*Se)]}function Le(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Pe(t,e){for(var r,n,i,a,o,s,l,c=!1,u=0,h=e.length;u0&&h<0||u<0&&h>0}function Oe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Ee(e,t)}function Ue(t,e,r,n){for(var i=Math.pow(2,n.z)*Se,a=[n.x*Se,n.y*Se],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ze(t,e)&&(r=!1)})),r}qe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(fe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ge("Input is not a number.");o=s-1}return 0}Ye.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ye.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ve(e,[t]):"coerce"===r?new we(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof me)&&"resolvedImage"!==a.type.kind&&Xe(a)){var l=new ke;try{a=new me(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ye.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ye(this.registry,n,e||null,i,this.errors)},Ye.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ut(n,t))},Ye.prototype.checkSubtype=function(t,e){var r=re(t,e);return r&&this.error(r),r};var Ke=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Ke(i,r,n)},Ke.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[$e(e,n)].evaluate(t)},Ke.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Qe=Object.freeze({__proto__:null,number:Je,color:function(t,e,r){return new oe(Je(t.r,e.r,r),Je(t.g,e.g,r),Je(t.b,e.b,r),Je(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Je(t,e[n],r)}))}}),tr=.95047,er=1.08883,rr=4/29,nr=6/29,ir=3*nr*nr,ar=nr*nr*nr,or=Math.PI/180,sr=180/Math.PI;function lr(t){return t>ar?Math.pow(t,1/3):t/ir+rr}function cr(t){return t>nr?t*t*t:ir*(t-rr)}function ur(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function hr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fr(t){var e=hr(t.r),r=hr(t.g),n=hr(t.b),i=lr((.4124564*e+.3575761*r+.1804375*n)/tr),a=lr((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-lr((.0193339*e+.119192*r+.9503041*n)/er)),alpha:t.a}}function pr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*cr(e),r=tr*cr(r),n=er*cr(n),new oe(ur(3.2404542*r-1.5371385*e-.4985314*n),ur(-.969266*r+1.8760108*e+.041556*n),ur(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function dr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var mr={forward:fr,reverse:pr,interpolate:function(t,e,r){return{l:Je(t.l,e.l,r),a:Je(t.a,e.a,r),b:Je(t.b,e.b,r),alpha:Je(t.alpha,e.alpha,r)}}},gr={forward:function(t){var e=fr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*sr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*or,r=t.c;return pr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:dr(t.h,e.h,r),c:Je(t.c,e.c,r),l:Je(t.l,e.l,r),alpha:Je(t.alpha,e.alpha,r)}}},yr=Object.freeze({__proto__:null,lab:mr,hcl:gr}),vr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ht)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Wt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=e.parse(f,d,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new vr(c,r,n,i,l):e.error("Type "+te(c)+" is not interpolatable.")},vr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=$e(e,n),o=e[a],s=e[a+1],l=vr.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?Qe[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?gr.reverse(gr.interpolate(gr.forward(c),gr.forward(u),l)):mr.reverse(mr.interpolate(mr.forward(c),mr.forward(u),l))},vr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ge("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ge("Array index must be an integer, but found "+e+" instead.");return r[e]},wr.prototype.eachChild=function(t){t(this.index),t(this.input)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Tr=function(t,e){this.type=Zt,this.needle=t,this.haystack=e};Tr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);return r&&n?ne(r.type,[Zt,Gt,Ht,qt,Xt])?new Tr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},Tr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(pe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(pe(r))+" instead.");return r.indexOf(e)>=0},Tr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Tr.prototype.outputDefined=function(){return!0},Tr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var kr=function(t,e,r){this.type=Ht,this.needle=t,this.haystack=e,this.fromIndex=r};kr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);if(!r||!n)return null;if(!ne(r.type,[Zt,Gt,Ht,qt,Xt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new kr(r,n,i):null}return new kr(r,n)},kr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(pe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(pe(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},kr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},kr.prototype.outputDefined=function(){return!1},kr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ar=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Ar.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,pe(f)))return null}else r=pe(f);if(void 0!==i[String(f)])return c.error("Branch labels must be unique.");i[String(f)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,Xt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Ar(r,n,d,i,a,m):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(pe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ar.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ar.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Ar.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!ne(r.type,[Qt(Xt),Gt,Xt]))return e.error("Expected first argument to be of type array or string, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Sr(r.type,r,n,i):null}return new Sr(r.type,r,n)},Sr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ie(e,["string","array"]))throw new ge("Expected first argument to be of type array or string, but found "+te(pe(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Sr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lr=Ir("==",(function(t,e,r){return e===r}),Cr),Pr=Ir("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Cr(0,e,r,n)})),zr=Ir("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Or=Ir("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Rr=Ir(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Fr=function(t,e,r,n,i){this.type=Gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Fr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Gt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Gt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new Fr(r,i,a,o,s)},Fr.prototype.evaluate=function(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))},Fr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Fr.prototype.outputDefined=function(){return!1},Fr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var jr=function(t){this.type=Ht,this.input=t};jr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+te(r.type)+" instead."):new jr(r):null},jr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ge("Expected value to be of type string or array, but found "+te(pe(e))+" instead.")},jr.prototype.eachChild=function(t){t(this.input)},jr.prototype.outputDefined=function(){return!1},jr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Br={"==":Lr,"!=":Pr,">":Dr,"<":zr,">=":Rr,"<=":Or,array:ve,at:wr,boolean:ve,case:Mr,coalesce:_r,collator:Me,format:xe,image:_e,in:Tr,"index-of":kr,interpolate:vr,"interpolate-hcl":vr,"interpolate-lab":vr,length:jr,let:br,literal:me,match:Ar,number:ve,"number-format":Fr,object:ve,slice:Sr,step:Ke,string:ve,"to-boolean":we,"to-color":we,"to-number":we,"to-string":we,var:We,within:qe};function Nr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=he(r,n,i,o);if(s)throw new ge(s);return new oe(r/255*o,n/255*o,i/255*o,o)}function Ur(t,e){return t in e}function Vr(t,e){var r=e[t];return void 0===r?null:r}function qr(t){return{type:t}}function Hr(t){return{result:"success",value:t}}function Gr(t){return{result:"error",value:t}}function Zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Wr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Yr(t){return!!t.expression&&t.expression.interpolated}function Xr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function $r(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Kr(t){return t}function Jr(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"==typeof t.stops[0][0],s=o||void 0!==t.property,l=o||!s,c=t.type||(Yr(e)?"exponential":"interval");if(a&&((t=jt({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],oe.parse(t[1])]}))),t.default?t.default=oe.parse(t.default):t.default=oe.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!yr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===c)r=rn;else if("interval"===c)r=en;else if("categorical"===c){r=tn,n=Object.create(null);for(var u=0,h=t.stops;u=t.stops[n-1][0])return t.stops[n-1][1];var i=$e(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function rn(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Xr(r))return Qr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=$e(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Qe[e.type]||Kr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=yr[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function nn(t,e,r){return"color"===e.type?r=oe.parse(r):"formatted"===e.type?r=ce.fromString(r.toString()):"resolvedImage"===e.type?r=ue.fromString(r.toString()):Xr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Qr(r,t.default,e.default)}Ae.register(Br,{error:[{kind:"error"},[Gt],function(t,e){var r=e[0];throw new ge(r.evaluate(t))}],typeof:[Gt,[Xt],function(t,e){return te(pe(e[0].evaluate(t)))}],"to-rgba":[Qt(Ht,4),[Wt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Wt,[Ht,Ht,Ht],Nr],rgba:[Wt,[Ht,Ht,Ht,Ht],Nr],has:{type:Zt,overloads:[[[Gt],function(t,e){return Ur(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return Ur(r.evaluate(t),n.evaluate(t))}]]},get:{type:Xt,overloads:[[[Gt],function(t,e){return Vr(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return Vr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Xt,[Gt],function(t,e){return Vr(e[0].evaluate(t),t.featureState||{})}],properties:[Yt,[],function(t){return t.properties()}],"geometry-type":[Gt,[],function(t){return t.geometryType()}],id:[Xt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[Xt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,qr(Ht),function(t,e){for(var r=0,n=0,i=e;n":[Zt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Zt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Zt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Zt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Zt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Zt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Zt,[Xt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Zt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Zt,[Qt(Gt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Zt,[Qt(Xt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Zt,[Gt,Qt(Xt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Zt,[Gt,Qt(Xt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[qr(Zt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Br}function sn(t,e){var r,n,i=new Ye(Br,[],e?(n={color:Wt,string:Gt,number:Ht,enum:Gt,boolean:Zt,formatted:Kt,resolvedImage:Jt},"array"===(r=e).type?Qt(n[r.value]||Xt,r.length):n[r.type]):void 0),a=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return a?Hr(new an(a,e)):Gr(i.errors)}an.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},an.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ge("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ln=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ge(e.expression)};ln.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},ln.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var cn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ge(e.expression),this.interpolationType=n};function un(t,e){if("error"===(t=sn(t,e)).result)return t;var r=t.value.expression,n=He(r);if(!n&&!Zr(e))return Gr([new Ut("","data expressions not supported")]);var i=Ze(r,["zoom"]);if(!i&&!Wr(e))return Gr([new Ut("","zoom expressions not supported")]);var a=fn(r);if(!a&&!i)return Gr([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ut)return Gr([a]);if(a instanceof vr&&!Yr(e))return Gr([new Ut("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Hr(new ln(n?"constant":"source",t.value));var o=a instanceof vr?a.interpolation:void 0;return Hr(new cn(n?"camera":"composite",t.value,a.labels,o))}cn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},cn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},cn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?vr.interpolationFactor(this.interpolationType,t,e,r):0};var hn=function(t,e){this._parameters=t,this._specification=e,jt(this,Jr(this._parameters,this._specification))};function fn(t){var e=null;if(t instanceof br)e=fn(t.result);else if(t instanceof _r)for(var r=0,n=t.args;rn.maximum?[new Rt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function gn(t){var e,r,n,i=t.valueSpec,a=Bt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Xr(t.value.stops)&&"array"===Xr(t.value.stops[0])&&"object"===Xr(t.value.stops[0][0]),u=pn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Rt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(dn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Xr(r)&&0===r.length&&e.push(new Rt(t.key,r,"array must have at least one stop")),e},default:function(t){return Nn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Rt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new Rt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Yr(t.valueSpec)&&u.push(new Rt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Zr(t.valueSpec)?u.push(new Rt(t.key,t.value,"property functions not supported")):s&&!Wr(t.valueSpec)&&u.push(new Rt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new Rt(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Xr(a))return[new Rt(s,a,"array expected, "+Xr(a)+" found")];if(2!==a.length)return[new Rt(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Xr(a[0]))return[new Rt(s,a,"object expected, "+Xr(a[0])+" found")];if(void 0===a[0].zoom)return[new Rt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Rt(s,a,"object stop key must have value")];if(n&&n>Bt(a[0].zoom))return[new Rt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Bt(a[0].zoom)!==n&&(n=Bt(a[0].zoom),r=void 0,o={}),e=e.concat(pn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:mn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return on(Nt(a[1]))?e.concat([new Rt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Nn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Xr(t.value),l=Bt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Rt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Rt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Zr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Rt(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function Tn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===r||"<="===r||">="===r?An(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(kn))):"all"===r?["all"].concat(t.slice(1).map(kn)):"none"===r?["all"].concat(t.slice(1).map(kn).map(En)):"in"===r?Mn(t[1],t.slice(2)):"!in"===r?En(Mn(t[1],t.slice(2))):"has"===r?Sn(t[1]):"!has"===r?En(Sn(t[1])):"within"!==r||t}function An(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Mn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(wn)]]:["filter-in-small",t,["literal",e]]}}function Sn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function En(t){return["!",t]}function Cn(t){return xn(Nt(t.value))?yn(jt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):In(t)}function In(t){var e=t.value,r=t.key;if("array"!==Xr(e))return[new Rt(r,e,"array expected, "+Xr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new Rt(r,e,"filter array must have at least 1 element")];switch(a=a.concat(vn({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Bt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Bt(e[1])&&a.push(new Rt(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new Rt(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Xr(e[1]))&&a.push(new Rt(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o=u[p+0]&&n>=u[p+1])?(o[f]=!0,a.push(c[f])):o[f]=!1}}},Jn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=l;f<=u;f++)for(var p=c;p<=h;p++){var d=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},Jn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Jn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Jn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Kn+this.cells.length+1+1,r=0,n=0;n=0)){var h=t[u];c[u]=ei[l].shallow.indexOf(u)>=0?h:oi(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function si(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||ii(t)||ai(t)||ArrayBuffer.isView(t)||t instanceof Qn)return t;if(Array.isArray(t))return t.map(si);if("object"==typeof t){var e=t.$name||"Object",r=ei[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:si(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var li=function(){this.first=!0};li.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function ui(t){for(var e=0,r=t;e=65097&&t<=65103)||ci["CJK Compatibility Ideographs"](t)||ci["CJK Compatibility"](t)||ci["CJK Radicals Supplement"](t)||ci["CJK Strokes"](t)||!(!ci["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||ci["CJK Unified Ideographs Extension A"](t)||ci["CJK Unified Ideographs"](t)||ci["Enclosed CJK Letters and Months"](t)||ci["Hangul Compatibility Jamo"](t)||ci["Hangul Jamo Extended-A"](t)||ci["Hangul Jamo Extended-B"](t)||ci["Hangul Jamo"](t)||ci["Hangul Syllables"](t)||ci.Hiragana(t)||ci["Ideographic Description Characters"](t)||ci.Kanbun(t)||ci["Kangxi Radicals"](t)||ci["Katakana Phonetic Extensions"](t)||ci.Katakana(t)&&12540!==t||!(!ci["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!ci["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ci["Unified Canadian Aboriginal Syllabics"](t)||ci["Unified Canadian Aboriginal Syllabics Extended"](t)||ci["Vertical Forms"](t)||ci["Yijing Hexagram Symbols"](t)||ci["Yi Syllables"](t)||ci["Yi Radicals"](t))))}function pi(t){return!(fi(t)||function(t){return!!(ci["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||ci["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||ci["Letterlike Symbols"](t)||ci["Number Forms"](t)||ci["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||ci["Control Pictures"](t)&&9251!==t||ci["Optical Character Recognition"](t)||ci["Enclosed Alphanumerics"](t)||ci["Geometric Shapes"](t)||ci["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||ci["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||ci["CJK Symbols and Punctuation"](t)||ci.Katakana(t)||ci["Private Use Area"](t)||ci["CJK Compatibility Forms"](t)||ci["Small Form Variants"](t)||ci["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function di(t){return ci.Arabic(t)||ci["Arabic Supplement"](t)||ci["Arabic Extended-A"](t)||ci["Arabic Presentation Forms-A"](t)||ci["Arabic Presentation Forms-B"](t)}function mi(t){return t>=1424&&t<=2303||ci["Arabic Presentation Forms-A"](t)||ci["Arabic Presentation Forms-B"](t)}function gi(t,e){return!(!e&&mi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||ci.Khmer(t))}function yi(t){for(var e=0,r=t;e-1&&(Ti=bi),wi&&wi(t)};function Mi(){Si.fire(new Pt("pluginStateChange",{pluginStatus:Ti,pluginURL:ki}))}var Si=new Dt,Ei=function(){return Ti},Ci=function(){if(Ti!==vi||!ki)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ti=xi,Mi(),ki&&Mt({url:ki},(function(t){t?Ai(t):(Ti=_i,Mi())}))},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ti===_i||null!=Ii.applyArabicShaping},isLoading:function(){return Ti===xi},setState:function(t){Ti=t.pluginStatus,ki=t.pluginURL},isParsed:function(){return null!=Ii.applyArabicShaping&&null!=Ii.processBidirectionalText&&null!=Ii.processStyledBidirectionalText},getPluginURL:function(){return ki}},Li=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new li,this.transition={})};Li.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Pi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if($r(t))return new hn(t,e);if(on(t)){var r=un(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=oe.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Pi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Pi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var zi=function(t){this.property=t,this.value=new Pi(t,void 0)};zi.prototype.transitioned=function(t,e){return new Oi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},zi.prototype.untransitioned=function(){return new Oi(this.property,this.value,null,{},0)};var Di=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Di.prototype.getValue=function(t){return w(this._values[t].value.value)},Di.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new zi(this._values[t].property)),this._values[t].value=new Pi(this._values[t].property,null===e?void 0:w(e))},Di.prototype.getTransition=function(t){return w(this._values[t].transition)},Di.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new zi(this._values[t].property)),this._values[t].transition=w(e)||void 0},Di.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var Ri=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Ri.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Bi(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ui),qi=function(t){this.specification=t};qi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Li(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Li(Math.floor(e.zoom),e)),t.expression.evaluate(new Li(Math.floor(e.zoom+1),e)),e)}},qi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},qi.prototype.interpolate=function(t){return t};var Hi=function(t){this.specification=t};Hi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Hi.prototype.interpolate=function(){return!1};var Gi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Pi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new zi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ri("DataDrivenProperty",Ui),ri("DataConstantProperty",Ni),ri("CrossFadedDataDrivenProperty",Vi),ri("CrossFadedProperty",qi),ri("ColorRampProperty",Hi);var Zi="-transition",Wi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Di(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Bi(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(Yn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return x(t,Zi)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Wn,n,t,e,r))return!1}if(x(t,Zi))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var 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),b(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Xn(this,t.call(Gn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Ot,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof ji&&Zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Dt),Yi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xi=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},$i=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ki(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,a=(i=t.type,Yi[i].BYTES_PER_ELEMENT),o=r=Ji(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Ji(r,Math.max(n,e)),alignment:e}}function Ji(t,e){return Math.ceil(t/e)*e}$i.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},$i.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},$i.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},$i.prototype.clear=function(){this.length=0},$i.prototype.resize=function(t){this.reserve(t),this.length=t},$i.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},$i.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}($i);Qi.prototype.bytesPerElement=4,ri("StructArrayLayout2i4",Qi);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}($i);ta.prototype.bytesPerElement=8,ri("StructArrayLayout4i8",ta);var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}($i);ea.prototype.bytesPerElement=12,ri("StructArrayLayout2i4i12",ea);var ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}($i);ra.prototype.bytesPerElement=8,ri("StructArrayLayout2i4ub8",ra);var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}($i);na.prototype.bytesPerElement=8,ri("StructArrayLayout2f8",na);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}($i);ia.prototype.bytesPerElement=20,ri("StructArrayLayout10ui20",ia);var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t},e}($i);aa.prototype.bytesPerElement=24,ri("StructArrayLayout4i4ui4i24",aa);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}($i);oa.prototype.bytesPerElement=12,ri("StructArrayLayout3f12",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}($i);sa.prototype.bytesPerElement=4,ri("StructArrayLayout1ul4",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}($i);la.prototype.bytesPerElement=20,ri("StructArrayLayout6i1ul2ui20",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}($i);ca.prototype.bytesPerElement=12,ri("StructArrayLayout2i2i2i12",ca);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}($i);ua.prototype.bytesPerElement=16,ri("StructArrayLayout2f1f2i16",ua);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}($i);ha.prototype.bytesPerElement=12,ri("StructArrayLayout2ub2f12",ha);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}($i);fa.prototype.bytesPerElement=6,ri("StructArrayLayout3ui6",fa);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){var v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t},e}($i);pa.prototype.bytesPerElement=48,ri("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",pa);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){var C=34*t,I=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.float32[I+15]=S,this.float32[I+16]=E,t},e}($i);da.prototype.bytesPerElement=68,ri("StructArrayLayout8i15ui1ul4f68",da);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}($i);ma.prototype.bytesPerElement=4,ri("StructArrayLayout1f4",ma);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}($i);ga.prototype.bytesPerElement=6,ri("StructArrayLayout3i6",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}($i);ya.prototype.bytesPerElement=8,ri("StructArrayLayout1ul2ui8",ya);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}($i);va.prototype.bytesPerElement=4,ri("StructArrayLayout2ui4",va);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}($i);xa.prototype.bytesPerElement=2,ri("StructArrayLayout1ui2",xa);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}($i);_a.prototype.bytesPerElement=16,ri("StructArrayLayout4f16",_a);var ba=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Xi);ba.prototype.size=20;var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ba(this,t)},e}(la);ri("CollisionBoxArray",wa);var Ta=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Xi);Ta.prototype.size=48;var ka=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ta(this,t)},e}(pa);ri("PlacedSymbolArray",ka);var Aa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Xi);Aa.prototype.size=68;var Ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Aa(this,t)},e}(da);ri("SymbolInstanceArray",Ma);var Sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ma);ri("GlyphOffsetArray",Sa);var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(ga);ri("SymbolLineVertexArray",Ea);var Ca=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Xi);Ca.prototype.size=8;var Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ca(this,t)},e}(ya);ri("FeatureIndexArray",Ia);var La=Ki([{name:"a_pos",components:2,type:"Int16"}],4).members,Pa=function(t){void 0===t&&(t=[]),this.segments=t};function za(t,e){return 256*(t=h(Math.floor(t),0,255))+(e=h(Math.floor(e),0,255))}Pa.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Pa.MAX_VERTEX_ARRAY_LENGTH&&k("Max vertices per segment is "+Pa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Pa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Pa.prototype.get=function(){return this.segments},Pa.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Ra=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),Fa=Oa,ja=Oa,Ba=Ra;Fa.murmur3=ja,Fa.murmur2=Ba;var Na=function(){this.ids=[],this.positions=[],this.indexed=!1};Na.prototype.add=function(t,e,r,n){this.ids.push(Va(t)),this.positions.push(e,r,n)},Na.prototype.getPositions=function(t){for(var e=Va(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Na.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return qa(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Na.deserialize=function(t){var e=new Na;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var Ua=Math.pow(2,53)-1;function Va(t){var e=+t;return!isNaN(e)&&e<=Ua?e:Fa(String(t))}function qa(t,e,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(t[a]i);if(a>=o)break;Ha(t,a,o),Ha(e,3*a,3*o),Ha(e,3*a+1,3*o+1),Ha(e,3*a+2,3*o+2)}o-ro.x+1||lo.y+1)&&k("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function mo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?po(t):[]}}function go(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var yo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Qi,this.indexArray=new fa,this.segments=new Pa,this.programConfigurations=new so(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function vo(t,e){for(var r=0;r1){if(wo(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Mo(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function So(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Eo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=A(t,e,r[0]);return a!==A(t,e,r[1])||a!==A(t,e,r[2])||a!==A(t,e,r[3])}function Co(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Io(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Lo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=uo||u<0||u>=uo)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;go(this.layoutVertexArray,c,u,-1,-1),go(this.layoutVertexArray,c,u,1,-1),go(this.layoutVertexArray,c,u,1,1),go(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},ri("CircleBucket",yo,{omit:["layers"]});var Po=new Gi({"circle-sort-key":new Ui(Ot.layout_circle["circle-sort-key"])}),zo={paint:new Gi({"circle-radius":new Ui(Ot.paint_circle["circle-radius"]),"circle-color":new Ui(Ot.paint_circle["circle-color"]),"circle-blur":new Ui(Ot.paint_circle["circle-blur"]),"circle-opacity":new Ui(Ot.paint_circle["circle-opacity"]),"circle-translate":new Ni(Ot.paint_circle["circle-translate"]),"circle-translate-anchor":new Ni(Ot.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ni(Ot.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ni(Ot.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ui(Ot.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ui(Ot.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ui(Ot.paint_circle["circle-stroke-opacity"])}),layout:Po},Do="undefined"!=typeof Float32Array?Float32Array:Array;function Oo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ro(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*f+w*g,t[2]=x*a+_*c+b*p+w*y,t[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*h+w*m,t[5]=x*i+_*l+b*f+w*g,t[6]=x*a+_*c+b*p+w*y,t[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*h+w*m,t[9]=x*i+_*l+b*f+w*g,t[10]=x*a+_*c+b*p+w*y,t[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*h+w*m,t[13]=x*i+_*l+b*f+w*g,t[14]=x*a+_*c+b*p+w*y,t[15]=x*o+_*u+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var Fo,jo=Ro,Bo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function No(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Fo=new Do(3),Do!=Float32Array&&(Fo[0]=0,Fo[1]=0,Fo[2]=0),function(){var t=new Do(4);Do!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Uo=function(t){var e=t[0],r=t[1];return e*e+r*r},Vo=(function(){var t=new Do(2);Do!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,zo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new yo(t)},e.prototype.queryRadius=function(t){var e=t;return Co("circle-radius",this,e)+Co("circle-stroke-width",this,e)+Io(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=Lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return qo(t,e)}))}(l,s),f=u?c*o:c,p=0,d=n;pt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ss(f,p,r,n,i,c),p}function as(t,e,r,n,i){var a,o;if(i===Cs(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Ms(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function os(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==xs(n.prev,n,n.next))n=n.next;else{if(Ss(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ss(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ms(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?cs(t,n,i,a):ls(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ss(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?ss(t=us(os(t),e,r),e,r,n,i,a,2):2===o&&hs(t,e,r,n,i,a):ss(os(t),e,r,n,i,a,1);break}}}function ls(t){var e=t.prev,r=t,n=t.next;if(xs(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ys(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cs(t,e,r,n){var i=t.prev,a=t,o=t.next;if(xs(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=ms(s,l,e,r,n),f=ms(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function us(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!_s(i,a)&&bs(i,n,n.next,a)&&ks(i,a)&&ks(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ss(n),Ss(n.next),n=t=a),n=n.next}while(n!==t);return os(n)}function hs(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&vs(o,s)){var l=As(o,s);return o=os(o,o.next),l=os(l,l.next),ss(o,e,r,n,i,a),void ss(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function fs(t,e){return t.x-e.x}function ps(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&ys(ar.x||n.x===r.x&&ds(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e),e){var r=As(e,t);os(e,e.next),os(r,r.next)}}function ds(t,e){return xs(t.prev,t,e.prev)<0&&xs(e.next,t,t.next)<0}function ms(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function gs(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function vs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&bs(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ks(t,e)&&ks(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(xs(t.prev,t,e.prev)||xs(t,e.prev,e))||_s(t,e)&&xs(t.prev,t,t.next)>0&&xs(e.prev,e,e.next)>0)}function xs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function bs(t,e,r,n){var i=Ts(xs(t,e,r)),a=Ts(xs(t,e,n)),o=Ts(xs(r,n,t)),s=Ts(xs(r,n,e));return i!==a&&o!==s||!(0!==i||!ws(t,r,e))||!(0!==a||!ws(t,n,e))||!(0!==o||!ws(r,t,n))||!(0!==s||!ws(r,e,n))}function ws(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ts(t){return t>0?1:t<0?-1:0}function ks(t,e){return xs(t.prev,t,t.next)<0?xs(t,e,t.next)>=0&&xs(t,t.prev,e)>=0:xs(t,e,t.prev)<0||xs(t,t.next,e)<0}function As(t,e){var r=new Es(t.i,t.x,t.y),n=new Es(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(t,e,r,n){var i=new Es(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ss(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Es(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cs(t,e,r,n){for(var i=0,a=e,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ls(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,f=n;for(Ps(t,r,e),i(t[n],u)>0&&Ps(t,r,n);h0;)f--}0===i(t[r],u)?Ps(t,r,f):Ps(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function Ps(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function zs(t,e){return te?1:0}function Ds(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},rs.default=ns;var js=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Qi,this.indexArray=new fa,this.indexArray2=new va,this.programConfigurations=new so(t.layers,t.zoom),this.segments=new Pa,this.segments2=new Pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};js.prototype.populate=function(t,e,r){this.hasPattern=Rs("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Hs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Hs.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Hs.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function $s(t,e,r){if(3===t){var n=new Ws(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Ys.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new qs(this._pbf,e,this.extent,this._keys,this._values)};var Ks={VectorTile:function(t,e){this.layers=t.readFields($s,{},e)},VectorTileFeature:qs,VectorTileLayer:Ws},Js=Ks.VectorTileFeature.types,Qs=Math.pow(2,13);function tl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Qs)+o,i*Qs*2,a*Qs*2,Math.round(s))}var el=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ea,this.indexArray=new fa,this.programConfigurations=new so(t.layers,t.zoom),this.segments=new Pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function rl(t,e){return t.x===e.x&&(t.x<0||t.x>uo)||t.y===e.y&&(t.y<0||t.y>uo)}function nl(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>uo}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>uo}))}el.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Rs("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var v=d[g-1];if(!rl(y,v)){h.vertexLength+4>Pa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),_=v.dist(y);m+_>32768&&(m=0),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=_,tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Pa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Js[t.type]){for(var w=[],T=[],k=h.vertexLength,A=0,M=s;A=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&y>c){var A=u.dist(p);if(A>2*h){var M=u.sub(u.sub(p)._mult(h/A)._round());this.updateDistance(p,M),this.addCurrentVertex(M,m,0,0,f),p=M}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(bi&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b100)v=g.mult(-1);else{var C=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(k?-1:1))}this.addCurrentVertex(u,v,0,0,f),this.addCurrentVertex(u,v.mult(-1),0,0,f)}else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(b*b-1),L=k?I:0,P=k?0:I;if(p&&this.addCurrentVertex(u,m,L,P,f),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),D=1;D2*h){var N=u.add(d.sub(u)._mult(h/B)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,f),u=N}}}}},pl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>fl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},pl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*(this.lineClips?this.scaledDistance*(fl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},pl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},pl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},ri("LineBucket",pl,{omit:["layers","patternFeatures"]});var dl=new Gi({"line-cap":new Ni(Ot.layout_line["line-cap"]),"line-join":new Ui(Ot.layout_line["line-join"]),"line-miter-limit":new Ni(Ot.layout_line["line-miter-limit"]),"line-round-limit":new Ni(Ot.layout_line["line-round-limit"]),"line-sort-key":new Ui(Ot.layout_line["line-sort-key"])}),ml={paint:new Gi({"line-opacity":new Ui(Ot.paint_line["line-opacity"]),"line-color":new Ui(Ot.paint_line["line-color"]),"line-translate":new Ni(Ot.paint_line["line-translate"]),"line-translate-anchor":new Ni(Ot.paint_line["line-translate-anchor"]),"line-width":new Ui(Ot.paint_line["line-width"]),"line-gap-width":new Ui(Ot.paint_line["line-gap-width"]),"line-offset":new Ui(Ot.paint_line["line-offset"]),"line-blur":new Ui(Ot.paint_line["line-blur"]),"line-dasharray":new qi(Ot.paint_line["line-dasharray"]),"line-pattern":new Vi(Ot.paint_line["line-pattern"]),"line-gradient":new Hi(Ot.paint_line["line-gradient"])}),layout:dl},gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Li(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Ui),yl=new gl(ml.paint.properties["line-width"].specification);yl.useIntegerZoom=!0;var vl=function(t){function e(e){t.call(this,e,ml),this.gradientVersion=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){if("line-gradient"===t){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof Ke,this.gradientVersion=(this.gradientVersion+1)%l}},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=yl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new pl(t)},e.prototype.queryRadius=function(t){var e=t,r=xl(Co("line-width",this,e),Co("line-gap-width",this,e)),n=Co("line-offset",this,e);return r/2+Math.abs(n)+Io(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=Lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*xl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var a=0;a0?e+2*t:t}var _l=Ki([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bl=Ki([{name:"a_projected_pos",components:3,type:"Float32"}],4),wl=(Ki([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ki([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Ki([{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"}]),Ki([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),kl=Ki([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Al(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Ii.applyArabicShaping&&(t=Ii.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ki([{name:"triangle",components:3,type:"Uint16"}]),Ki([{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"}]),Ki([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ki([{type:"Float32",name:"offsetX"}]),Ki([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Sl=24,El=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Cl=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m},Il=Ll;function Ll(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ll.Varint=0,Ll.Fixed64=1,Ll.Bytes=2,Ll.Fixed32=5;var Pl=4294967296,zl=1/Pl,Dl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ol(t){return t.type===Ll.Bytes?t.readVarint()+t.pos:t.pos+1}function Rl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Fl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function jl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Xl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function $l(t,e,r){1===t&&r.readMessage(Kl,e)}function Kl(t,e,r){if(3===t){var n=r.readMessage(Jl,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new Yo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Jl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function Ql(t){for(var e=0,r=0,n=0,i=t;n=0;f--){var p=o[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=o.pop();f>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Wl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Xl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Wl(this.buf,this.pos)+Wl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readSFixed64:function(){var t=Wl(this.buf,this.pos)+Xl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readFloat:function(){var t=El(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=El(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return Rl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Dl?function(t,e,r){return Dl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ll.Bytes)return t.push(this.readVarint(e));var r=Ol(this);for(t=t||[];this.pos127;);else if(e===Ll.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ll.Fixed32)this.pos+=4;else{if(e!==Ll.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Fl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Cl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cl(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Fl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ll.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zl,e)},writeBytesField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var tc=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},ec={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ec.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ec.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ec.tlbr.get=function(){return this.tl.concat(this.br)},ec.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(tc.prototype,ec);var rc=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=Ql(i),o=a.w,s=a.h,l=new Xo({width:o||1,height:s||1});for(var c in t){var u=t[c],h=r[c].paddedRect;Xo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var f in e){var p=e[f],d=n[f].paddedRect,m=d.x+1,g=d.y+1,y=p.data.width,v=p.data.height;Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g},p.data),Xo.copy(p.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Xo.copy(p.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Xo.copy(p.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};rc.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new tc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},rc.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},rc.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],a=n[1];r.update(e.data,void 0,{x:i,y:a})}},ri("ImagePosition",tc),ri("ImageAtlas",rc);var nc={horizontal:1,vertical:2,horizontalOnly:3},ic=-17,ac=function(){this.scale=1,this.fontStack="",this.imageName=null};ac.forText=function(t,e){var r=new ac;return r.scale=t||1,r.fontStack=e,r},ac.forImage=function(t){var e=new ac;return e.imageName=t,e};var oc=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function sc(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g,y=oc.fromFeature(t,i);h===nc.vertical&&y.verticalizePunctuation();var v=Ii.processBidirectionalText,x=Ii.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var _=0,b=v(y.toString(),mc(y,c,a,e,n,p,d));_0&&j>A&&(A=j)}else{var B=r[S.fontStack],N=B&&B[C];if(N&&N.rect)P=N.rect,L=N.metrics;else{var U=e[S.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}I=(b-S.scale)*Sl}O?(t.verticalizable=!0,k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=D*S.scale+c):(k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=L.advance*S.scale+c)}if(0!==k.length){var q=f-c;d=Math.max(q,d),yc(k,0,k.length-1,g,A)}f=0;var H=a*b+A;T.lineOffset=Math.max(A,w),p+=H,m=Math.max(H,m),++y}else p+=a,++y}var G=p-ic,Z=gc(o),W=Z.horizontalAlign,Y=Z.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c=(e-r)*i,u=0;u=a!==o?-s*n-ic:(-n*l+.5)*o;for(var h=0,f=t;h=0&&n>=t&&lc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},oc.prototype.substring=function(t,e){var r=new oc;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},oc.prototype.toString=function(){return this.text},oc.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},oc.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(ac.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var lc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},cc={};function uc(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*Sl/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function hc(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,f=0;f-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}function Mc(t){for(var e=0,r=0;rc){var d=(c-l)/p,m=Je(h.x,f.x,d),g=Je(h.y,f.y,d),y=new xc(m,g,f.angleTo(h),u);return y._round(),!o||Ac(t,y,s,o,e)?y:void 0}l+=p}}function Ic(t,e,r,n,i,a,o,s,l){var c=Sc(n,a,o),u=Ec(n,i),h=u*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&_=0&&b=0&&f+c<=u){var w=new xc(_,b,v,d);w._round(),n&&!Ac(t,w,a,n,i)||p.push(w)}}h+=y}return s||p.length||o||(p=Lc(t,h/2,r,n,i,a,o,!0,l)),p}function Pc(t,e,r,n,i){for(var o=[],s=0;s=n&&f.x>=n||(h.x>=n?h=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=i&&f.y>=i||(h.y>=i?h=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round():f.y>=i&&(f=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(f)))))}return o}function zc(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,f=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),g=p.reduce(d,0),y=l-m,v=c-g,x=0,_=m,b=0,w=g,T=0,k=y,A=0,M=v;if(o.content&&n){var S=o.content;x=Dc(f,0,S[0]),b=Dc(p,0,S[1]),_=Dc(f,S[0],S[2]),w=Dc(p,S[1],S[3]),T=S[0]-x,A=S[1]-b,k=S[2]-S[0]-_,M=S[3]-S[1]-w}var E=function(n,i,l,c){var f=Rc(n.stretch-x,_,u,t.left),p=Fc(n.fixed-T,k,n.stretch,m),d=Rc(i.stretch-b,w,h,t.top),y=Fc(i.fixed-A,M,i.stretch,g),v=Rc(l.stretch-x,_,u,t.left),S=Fc(l.fixed-T,k,l.stretch,m),E=Rc(c.stretch-b,w,h,t.top),C=Fc(c.fixed-A,M,c.stretch,g),I=new a(f,d),L=new a(v,d),P=new a(v,E),z=new a(f,E),D=new a(p/s,y/s),O=new a(S/s,C/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),j=Math.cos(R),B=[j,-F,F,j];I._matMult(B),L._matMult(B),z._matMult(B),P._matMult(B)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:I,tr:L,bl:z,br:P,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:k/s/u,minFontScaleY:M/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Oc(f,y,m),I=Oc(p,v,g),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var _=new a(y,m),b=new a(v,m),w=new a(y,g),T=new a(v,g),k=u*Math.PI/180;_._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),y=Math.min(_.x,b.x,w.x,T.x),v=Math.max(_.x,b.x,w.x,T.x),m=Math.min(_.y,b.y,w.y,T.y),g=Math.max(_.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,n,i)}this.boxEndIndex=t.length},Bc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Nc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Nc(t,e){return te?1:0}function Uc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,f=s-i,p=Math.min(h,f),d=p/2,m=new Bc([],Vc);if(0===p)return new a(n,i);for(var g=n;gv.d||!v.d)&&(v=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,x)),_.max-v.d<=e||(d=_.h/2,m.push(new qc(_.p.x-d,_.p.y-d,d,t)),m.push(new qc(_.p.x+d,_.p.y-d,d,t)),m.push(new qc(_.p.x-d,_.p.y+d,d,t)),m.push(new qc(_.p.x+d,_.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function Vc(t,e){return e.max-t.max}function qc(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Ao(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Bc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Bc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Bc.prototype.peek=function(){return this.data[0]},Bc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Bc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var Hc=Number.POSITIVE_INFINITY;function Gc(t,e){return e[1]!==Hc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Zc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Wc=255,Yc=Wc*_c;function Xc(t,e,r,n,i,o,s,l,c,u,h,f,p,d,m){var g=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,f=e.positionedLines;hYc&&k(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[_c*d.compositeTextSizes[0].evaluate(s,{},m),_c*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>Yc||v[1]>Yc)&&k(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(var x=0,_=h;x<_.length;x+=1)f[_[x]]=t.text.placedSymbolArray.length-1;return 4*g.length}function $c(t){for(var e in t)return t[e];return null}function Kc(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new Li(this.zoom),m=0,g=t;m=0;for(var z=0,D=k.sections;z=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},au.prototype.hasIconData=function(){return this.icon.segments.get().length>0},au.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},au.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},au.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},au.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||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(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),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)}},ri("SymbolBucket",au,{omit:["layers","collisionBoxArray","features","compareText"]}),au.MAX_GLYPHS=65535,au.addDynamicAttributes=eu;var ou=new Gi({"symbol-placement":new Ni(Ot.layout_symbol["symbol-placement"]),"symbol-spacing":new Ni(Ot.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ni(Ot.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ui(Ot.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ni(Ot.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ni(Ot.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ni(Ot.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ni(Ot.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ni(Ot.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ui(Ot.layout_symbol["icon-size"]),"icon-text-fit":new Ni(Ot.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ni(Ot.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ui(Ot.layout_symbol["icon-image"]),"icon-rotate":new Ui(Ot.layout_symbol["icon-rotate"]),"icon-padding":new Ni(Ot.layout_symbol["icon-padding"]),"icon-keep-upright":new Ni(Ot.layout_symbol["icon-keep-upright"]),"icon-offset":new Ui(Ot.layout_symbol["icon-offset"]),"icon-anchor":new Ui(Ot.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ni(Ot.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ni(Ot.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ni(Ot.layout_symbol["text-rotation-alignment"]),"text-field":new Ui(Ot.layout_symbol["text-field"]),"text-font":new Ui(Ot.layout_symbol["text-font"]),"text-size":new Ui(Ot.layout_symbol["text-size"]),"text-max-width":new Ui(Ot.layout_symbol["text-max-width"]),"text-line-height":new Ni(Ot.layout_symbol["text-line-height"]),"text-letter-spacing":new Ui(Ot.layout_symbol["text-letter-spacing"]),"text-justify":new Ui(Ot.layout_symbol["text-justify"]),"text-radial-offset":new Ui(Ot.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ni(Ot.layout_symbol["text-variable-anchor"]),"text-anchor":new Ui(Ot.layout_symbol["text-anchor"]),"text-max-angle":new Ni(Ot.layout_symbol["text-max-angle"]),"text-writing-mode":new Ni(Ot.layout_symbol["text-writing-mode"]),"text-rotate":new Ui(Ot.layout_symbol["text-rotate"]),"text-padding":new Ni(Ot.layout_symbol["text-padding"]),"text-keep-upright":new Ni(Ot.layout_symbol["text-keep-upright"]),"text-transform":new Ui(Ot.layout_symbol["text-transform"]),"text-offset":new Ui(Ot.layout_symbol["text-offset"]),"text-allow-overlap":new Ni(Ot.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ni(Ot.layout_symbol["text-ignore-placement"]),"text-optional":new Ni(Ot.layout_symbol["text-optional"])}),su={paint:new Gi({"icon-opacity":new Ui(Ot.paint_symbol["icon-opacity"]),"icon-color":new Ui(Ot.paint_symbol["icon-color"]),"icon-halo-color":new Ui(Ot.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ui(Ot.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ui(Ot.paint_symbol["icon-halo-blur"]),"icon-translate":new Ni(Ot.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ni(Ot.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ui(Ot.paint_symbol["text-opacity"]),"text-color":new Ui(Ot.paint_symbol["text-color"],{runtimeType:Wt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ui(Ot.paint_symbol["text-halo-color"]),"text-halo-width":new Ui(Ot.paint_symbol["text-halo-width"]),"text-halo-blur":new Ui(Ot.paint_symbol["text-halo-blur"]),"text-translate":new Ni(Ot.paint_symbol["text-translate"]),"text-translate-anchor":new Ni(Ot.paint_symbol["text-translate-anchor"])}),layout:ou},lu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t};lu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},lu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},lu.prototype.outputDefined=function(){return!1},lu.prototype.serialize=function(){return null},ri("FormatSectionOverride",lu,{omit:["defaultValue"]});var cu=function(t){function e(e){t.call(this,e,su)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else S()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Tu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Tu.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(si(e.error)):n(null,si(e.data)))}else{var i=!1,a=I(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?oi(e):null,data:oi(n,a)},a)}:function(t){i=!0},s=null,l=si(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Au.prototype.setNorthEast=function(t){return this._ne=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},Au.prototype.setSouthWest=function(t){return this._sw=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},Au.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Su)e=t,r=t;else{if(!(t instanceof Au)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Au.convert(a))}var o=t;return this.extend(Su.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Su(e.lng,e.lat),this._ne=new Su(r.lng,r.lat)),this},Au.prototype.getCenter=function(){return new Su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Au.prototype.getSouthWest=function(){return this._sw},Au.prototype.getNorthEast=function(){return this._ne},Au.prototype.getNorthWest=function(){return new Su(this.getWest(),this.getNorth())},Au.prototype.getSouthEast=function(){return new Su(this.getEast(),this.getSouth())},Au.prototype.getWest=function(){return this._sw.lng},Au.prototype.getSouth=function(){return this._sw.lat},Au.prototype.getEast=function(){return this._ne.lng},Au.prototype.getNorth=function(){return this._ne.lat},Au.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Au.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Au.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Au.prototype.contains=function(t){var e=Su.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Au.convert=function(t){return!t||t instanceof Au?t:new Au(t)};var Mu=6371008.8,Su=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Su.prototype.wrap=function(){return new Su(f(this.lng,-180,180),this.lat)},Su.prototype.toArray=function(){return[this.lng,this.lat]},Su.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Su.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Mu*Math.acos(Math.min(i,1))},Su.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Au(new Su(this.lng-r,this.lat-e),new Su(this.lng+r,this.lat+e))},Su.convert=function(t){if(t instanceof Su)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Su(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Su(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 [, ]")};var Eu=2*Math.PI*Mu;function Cu(t){return Eu*Math.cos(t*Math.PI/180)}function Iu(t){return(180+t)/360}function Lu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pu(t,e){return t/Cu(e)}function zu(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Du=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Du.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Su.convert(t);return new Du(Iu(r.lng),Lu(r.lat),Pu(e,r.lat))},Du.prototype.toLngLat=function(){return new Su(360*this.x-180,zu(this.y))},Du.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Cu(zu(e));var t,e},Du.prototype.meterInMercatorCoordinateUnits=function(){return 1/Eu*(t=zu(this.y),1/Math.cos(t*Math.PI/180));var t};var Ou=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ju(0,t,t,e,r)};Ou.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ou.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=ku(256*r,256*(n=Math.pow(2,i)-n-1),i),o=ku(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Fu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Fu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?ju(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ju(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Fu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Fu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Fu(e,this.wrap,e,r,n),new Fu(e,this.wrap,e,r+1,n),new Fu(e,this.wrap,e,r,n+1),new Fu(e,this.wrap,e,r+1,n+1)]},Fu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Bu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bu.prototype.getPixels=function(){return new Xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Hu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ks.VectorTile(new Il(this.rawTileData)).layers,this.sourceLayerCoder=new Nu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hu.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=uo/t.tileSize/t.scale,l=bn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,h=Zu(c),f=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=Zu(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var c=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var u=0,h=c;u=0)return!0;return!1}(a,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var m=mo(d,!0);if(!i.filter(new Li(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new Li(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,f),y=0;yn)i=!1;else if(e)if(this.expirationTimeht&&(t.getActor().send("enforceCacheSizeLimit",ut),yt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete(ct);t&&e.catch(t).then((function(){return t()}))},t.clipLine=Pc,t.clone=function(t){var e=new Do(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=w,t.clone$2=function(t){var e=new Do(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=kl,t.config=N,t.create=function(){var t=new Do(16);return Do!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Do(9);return Do!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new Do(4);return Do!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=sn,t.createLayout=Ki,t.createStyleLayer=function(t){return"custom"===t.type?new du(t):new mu[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=Je,t.offscreenCanvasSupported=vt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Il(t).readFields($l,[])},t.pbf=Il,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=uo/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new Li(f),o),c["text-size"].possiblyEvaluate(new Li(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new Li(m),o),c["icon-size"].possiblyEvaluate(new Li(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new Li(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new Li(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new Li(18));for(var y=l.get("text-line-height")*Sl,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),_=l.get("text-size"),b=function(){var a=T[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=_.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),f=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),b=l.get("text-letter-spacing").evaluate(a,{},o)*Sl,A=function(t){for(var e=0,r=t;e=uo||h.y<0||h.y>=uo||function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A){var M,S,E,C,I,L=t.addToLineVertexArray(e,r),P=0,z=0,D=0,O=0,R=-1,F=-1,j={},B=Fa(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(M=s.layout.get("text-offset").evaluate(_,{},T).map((function(t){return t*Sl})))[0],U=M[1]):(N=s.layout.get("text-radial-offset").evaluate(_,{},T)*Sl,U=Hc),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},T)+90,q=n.vertical;C=new jc(l,e,c,u,h,q,f,p,d,V),o&&(I=new jc(l,e,c,u,h,o,g,y,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),Z=zc(i,H,w,G),W=o?zc(o,H,w,G):void 0;E=new jc(l,e,c,u,h,i,g,y,!1,H),P=4*Z.length;var Y=t.iconSizeData,X=null;"source"===Y.kind?(X=[_c*s.layout.get("icon-size").evaluate(_,{})])[0]>Yc&&k(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[_c*b.compositeIconSizes[0].evaluate(_,{},T),_c*b.compositeIconSizes[1].evaluate(_,{},T)])[0]>Yc||X[1]>Yc)&&k(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'),t.addSymbols(t.icon,Z,X,x,v,_,!1,e,L.lineStartIndex,L.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,W&&(z=4*W.length,t.addSymbols(t.icon,W,X,x,v,_,nc.vertical,e,L.lineStartIndex,L.lineLength,-1,T),F=t.icon.placedSymbolArray.length-1)}for(var $ in n.horizontal){var K=n.horizontal[$];if(!S){B=Fa(K.text);var J=s.layout.get("text-rotate").evaluate(_,{},T);S=new jc(l,e,c,u,h,K,f,p,d,J)}var Q=1===K.positionedLines.length;if(D+=Xc(t,e,K,a,s,d,_,m,L,n.vertical?nc.horizontal:nc.horizontalOnly,Q?Object.keys(n.horizontal):[$],j,R,b,T),Q)break}n.vertical&&(O+=Xc(t,e,n.vertical,a,s,d,_,m,L,nc.vertical,["vertical"],j,F,b,T));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=C?C.boxStartIndex:t.collisionBoxArray.length,nt=C?C.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(C,lt),lt=ct(E,lt);var ut=(lt=ct(I,lt))>-1?1:0;ut&&(lt*=A/Sl),t.glyphOffsetArray.length>=au.MAX_GLYPHS&&k("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical||-1,R,F,B,tt,et,rt,nt,it,at,ot,st,c,D,O,P,z,ut,0,f,N,U,lt)}(t,h,s,r,n,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,M,l,_,T,S,d,e,a,c,u,o)};if("line"===E)for(var P=0,z=Pc(e.geometry,0,0,uo,uo);P1){var U=Cc(N,A,r.vertical||m,n,g,x);U&&L(N,U)}}else if("Polygon"===e.type)for(var V=0,q=Ds(e.geometry,0);V=E.maxzoom||"none"!==E.visibility&&(o(S,this.zoom,n),(m[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var C=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},(function(t,e){h||(h=t,f=e,P.call(l))})):f={};var I=Object.keys(g.iconDependencies);I.length?a.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,P.call(l))})):p={};var L=Object.keys(g.patternDependencies);function P(){if(h)return s(h);if(f&&p&&d){var e=new i(f),r=new t.ImageAtlas(p,d);for(var a in m){var l=m[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,f,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,P.call(l))})):d={},P.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function L(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;D(t,e,o,n,i,a%2),z(t,e,r,n,o-1,a+1),z(t,e,r,o+1,i,a+1)}}function D(t,e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);D(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=e[2*r+a],f=n,p=i;for(O(t,e,n,r),e[2*i+a]>h&&O(t,e,n,i);fh;)p--}e[2*n+a]===h?O(t,e,n,p):O(t,e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function O(t,e,r,n){R(t,r,n),R(e,2*r,2*n),R(e,2*r+1,2*n+1)}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function F(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}b.fromVectorTileJs=w,b.fromGeojsonVt=T,b.GeoJSONWrapper=k;var j=function(t){return t[0]},B=function(t){return t[1]},N=function(t,e,r,n,i){void 0===e&&(e=j),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var m=Math.floor((p+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var f=h;f<=u;f++)F(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var p=Math.floor((h+u)/2),d=e[2*p],m=e[2*p+1];F(d,m,r,n)<=l&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},V=function(t){this.options=X(Object.create(U),t),this.trees=new Array(this.options.maxZoom+1)};function q(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function H(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Y(i),zoom:1/0,index:e,parentId:-1}}function G(t){return{type:"Feature",id:t.id,properties:Z(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Z(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function W(t){return t/360+.5}function Y(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function X(t,e){for(var r in e)t[r]=e[r];return t}function $(t){return t.x}function K(t){return t.y}function J(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],c=t[e+1],u=t[r],h=t[r+1],f=e+3;fa)i=f,a=p;else if(p===a){var d=Math.abs(f-o);dn&&(i-e>3&&J(t,e,i,n),t[i+2]=a,r-i>3&&J(t,i,r,n))}function Q(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function tt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)et(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,J(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function at(t,e,r,n){for(var i=0;i1?1:r}function lt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var m=[];if("Point"===f||"MultiPoint"===f)ct(h,m,r,n,i);else if("LineString"===f)ut(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)ft(h,m,r,n,i,!1);else if("Polygon"===f)ft(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ut(t,e,r,n,i,a,o){for(var s,l,c=ht(t),u=0===i?dt:mt,h=t.start,f=0;fr&&(l=u(c,p,d,g,y,r),o&&(c.start=h+s*l)):v>n?x=r&&(l=u(c,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,p,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),e.push(c),c=ht(t)),o&&(h+=s)}var b=t.length-3;p=t[b],d=t[b+1],m=t[b+2],(v=0===i?p:d)>=r&&v<=n&&pt(c,p,d,m),b=c.length-3,a&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&pt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ht(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ft(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function bt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,$,K,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(W(r),Y(a),W(i),Y(n));ue&&(d+=v.numPoints||1)}if(d>=s){for(var x=u.x*p,_=u.y*p,b=o&&p>1?this._map(u,!0):null,w=(c<<5)+(e+1)+this.points.length,T=0,k=f;T1)for(var E=0,C=f;E>5},V.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},V.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},Tt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Tt.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),f=this.tiles[h]=_t(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,g,y,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=g=y=v=null,x=lt(t,u,r-b,r+T,0,f.minX,f.maxX,l),_=lt(t,u,r+w,r+k,0,f.minX,f.maxX,l),t=null,x&&(m=lt(x,u,n-b,n+T,1,f.minY,f.maxY,l),g=lt(x,u,n+w,n+k,1,f.minY,f.maxY,l),x=null),_&&(y=lt(_,u,n-b,n+T,1,f.minY,f.maxY,l),v=lt(_,u,n+w,n+k,1,f.minY,f.maxY,l),_=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},Tt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[kt(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?vt(this.tiles[s],i):null):null};var Mt=function(e){function r(t,r,n,i){e.call(this,t,r,n,At),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=o.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));o={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new V(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);p=Math.sqrt(f*f+m*m)}else p=n-Math.sqrt(f*f+d*d);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},k.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=l.isDash?f:-f;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},k.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),O=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,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 t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.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())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var 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()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Dt(this._source.type)){for(var c={},u={},h=0,f=Object.keys(l);hthis._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),_=d.overscaledZ-1;_>=a;--_){var b=d.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(m=this.getTile(b))&&x&&(m=this._addTile(b)),m&&(n[b.key]=b,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,m=0,g=c;m=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function zt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Ot(){return new t.window.Worker(aa.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={}};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ae(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function le(e,r,n,i,a,o,s,l,c,u,h,f,p,d){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=oe(g,l,y,v,n,h,f,e,c,o,p);if(!w)return{notEnoughRoom:!0};var T=re(w.first.point,s).point,k=re(w.last.point,s).point;if(i&&!n){var A=se(e.writingMode,T,k,d);if(A)return A}m=[w.first];for(var M=e.glyphStartIndex+1;M0?I.point:ce(f,C,S,1,a),P=se(e.writingMode,S,L,d);if(P)return P}var z=ue(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,O=m;D0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,v=a,x=0,_=0,b=Math.abs(p),w=[];x+_<=b;){if((g+=d)=c)return null;if(v=y,w.push(y),void 0===(y=f[g])){var T=new t.Point(u.getx(g),u.gety(g)),k=re(T,h);if(k.signedDistanceFromCamera>0)y=f[g]=k.point;else{var A=g-d;y=ce(0===x?o:new t.Point(u.getx(A),u.gety(A)),T,v,b-x+1,h)}}x+=_,_=v.dist(y)}var M=(b-x)/_,S=y.sub(v),E=S.mult(M)._add(v);E._add(S._unit()._perp()._mult(n*d));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Qt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Qt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Qt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Qt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Qt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Qt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Qt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Qt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,f=c;h=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;yo*o+s*s},Qt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,f=u-c;return h*h+f*f<=r*r};var he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function fe(t,e){for(var r=0;r=1;L--)I.push(E.path[L]);for(var P=1;P0){for(var R=I[0].clone(),F=I[0].clone(),j=1;j=A.x&&F.x<=M.x&&R.y>=A.y&&F.y<=M.y?[I]:F.xM.x||F.yM.y?[]:t.clipLine([I],A.x,A.y,M.x,M.y)}for(var B=0,N=O;B=this.screenRightBoundary||nthis.screenBottomBoundary},me.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(f,t,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:y,placedGlyphBoxes:v}):void 0},Ae.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(x||!o.hasIconData()||y),A=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var M=function(e,a){if(!r[e.crossTileID])if(f)i.placements[e.crossTileID]=new xe(!1,!1,!1);else{var p,T=!1,M=!1,S=!0,E=null,C={box:null,offscreen:null},I={box:null,offscreen:null},L=null,P=null,z=0,D=0,O=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},j=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(B=B.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,f={box:[],offscreen:!1},p=v?2*B.length:B.length,d=0;d=B.length,k=i.attemptAnchorPlacement(g,t,a,s,c,_,b,h,l,m,y,e,o,n,u);if(k&&(f=k.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,E=k.shift;break}}return f};j((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(T=C.box,S=C.offscreen);var V=F(C&&C.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};j((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(C&&C.box&&C.box.length)}}if(T=(p=C)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(o.textSizeData,d,G),W=s.get("text-padding"),Y=e.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,Z,l,c,u,n,b,m.predicate,Y,W),T=v||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var X=function(t){var e=w&&E?ke(t,E.x,E.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,h,l,m.predicate)};M=I&&I.box&&I.box.length&&a.verticalIconBox?(P=X(a.verticalIconBox)).box.length>0:(P=X(a.iconBox)).box.length>0,S=S&&P.offscreen}var $=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if($||K?K?$||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(I&&I.box&&D?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),M&&P&&i.collisionIndex.insertCollisionBox(P.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),L&&(T&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new _e);for(var tt=0;tt=0;--E){var C=S[E];M(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var I=e.symbolInstanceStart;I=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},Ae.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,_=i.placedOrientations[a.crossTileID],b=_===t.WritingMode.vertical,w=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(v){var T=De(y.text),k=b?Oe:T;d(e.text,s,k);var A=w?Oe:T;d(e.text,l,A);var M=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||b?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,_);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var C=De(y.icon),I=!(f&&a.verticalPlacedIconSymbolIndex&&b);if(a.placedIconSymbolIndex>=0){var L=I?C:Oe;d(e.icon,a.numIconVertices,L),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var P=I?Oe:C;d(e.icon,a.numVerticalIconVertices,P),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var z=e.collisionArrays[n];if(z){var D=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var O=!0;if(c){var R=i.variableOffsets[m];R?(D=Te(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&D._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}z.textBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||b,D.x,D.y),z.verticalTextBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||w,D.x,D.y)}var F=Boolean(!w&&z.verticalIconBox);z.iconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,f?D.x:0,f?D.y:0),z.verticalIconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,f?D.x:0,f?D.y:0)}}},g=0;gt},Ae.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Ce=Math.pow(2,17),Ie=Math.pow(2,16),Le=Math.pow(2,9),Pe=Math.pow(2,8),ze=Math.pow(2,1);function De(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Se+e*Ee+r*Ce+e*Ie+r*Le+e*Pe+r*ze+e}var Oe=0,Re=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Re.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Re(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Fe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var je=512/t.EXTENT/2,Be=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,f=l.y,p=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,v,{x:h,y:f},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:d,sdf:p,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Pt(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(qe(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id] 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,0.0,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;}"),nr=br("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);}"),ir=br("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,0,1);}"),ar=br("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=br("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=br("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),lr=br("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),cr=br("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);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;}"),ur=br("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);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\n? a_pos\n: 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;}"),hr=br("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),fr=br("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),pr=br("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_width2=vec2(outset,inset);}"),dr=br("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_width2=vec2(outset,inset);}"),mr=br("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),gr=br("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;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);}"),yr=br("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),vr=br("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);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),0.0,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;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),xr=br("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),_r=br("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,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);}");function br(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var wr=Object.freeze({__proto__:null,prelude:Xe,background:$e,backgroundPattern:Ke,circle:Je,clippingMask:Qe,heatmap:tr,heatmapTexture:er,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:cr,fillExtrusionPattern:ur,hillshadePrepare:hr,hillshade:fr,line:pr,lineGradient:dr,linePattern:mr,lineSDF:gr,raster:yr,symbolIcon:vr,symbolSDF:xr,symbolTextAndIcon:_r}),Tr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function kr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Ar.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],_=0,b=u.get();_0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Wr(i.paint.get("raster-hue-rotate"))};var a,o};function Wr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Yr,Xr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},$r=function(e,r,n,i,a,o,s,l,c,u,h){var f=a.transform;return t.extend(Xr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(e,r,n,i,a,o,s,l,c,u){return t.extend($r(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Qr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),f=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ge(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},tn={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function en(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d0){var b=t.create(),w=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:w,invTransform:b}),p=f+=_.length/4}x&&u.draw(l,c.LINES,Mt.disabled,Et.disabled,e.colorModeForRenderPass(),It.disabled,Dr(v,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*f),k._trim();for(var A=0,M=0,S=h;M=0&&(m[y.associatedIconIndex]={shiftedAnchor:S,angle:E})}else fe(y.numGlyphs,p)}if(h){d.clear();for(var I=e.icon.placedSymbolArray,L=0;L0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.clamp(f?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var dn=new t.Color(1,0,0,1),mn=new t.Color(0,1,0,1),gn=new t.Color(0,0,1,1),yn=new t.Color(1,0,1,1),vn=new t.Color(0,1,1,1);function xn(t){var e=t.transform.padding;_n(t,t.transform.height-(e.top||0),3,dn),_n(t,e.bottom||0,3,mn),bn(t,e.left||0,3,gn),bn(t,t.transform.width-(e.right||0),3,yn);var r=t.transform.centerPoint;!function(t,e,r,n){var i=20,a=2;wn(t,e-a/2,r-i/2,a,i,n),wn(t,e-i/2,r-a/2,i,a,n)}(t,r.x,t.transform.height-r.y,vn)}function _n(t,e,r,n){wn(t,0,e+r/2,t.transform.width,r,n)}function bn(t,e,r,n){wn(t,e-r/2,0,r,t.transform.height,n)}function wn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function Tn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,c=Et.disabled,u=e.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,It.disabled,Rr(o,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,p=f&&f.byteLength||0,d=Math.floor(p/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+d+"kb"),s.draw(i,a.TRIANGLES,l,c,Ct.alphaBlended,It.disabled,Rr(o,t.Color.transparent,g),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var kn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Et.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,f=e;h256&&this.clearStencil(),r.setColorMode(Ct.disabled),r.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},An.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},An.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Ar(this.context,t,wr[t],e,tn[t],this._showOverdrawInspector)),this.cache[r]},An.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},An.prototype.setBaseState=function(){var 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)},An.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},An.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Mn=function(t,e){this.points=t,this.planes=e};Mn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-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((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new Mn(a,o)};var Sn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Sn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;hthis.max[l]-this.min[l])return 0}return 1};var En=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};En.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},En.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},En.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},En.prototype.clone=function(){return new En(this.top,this.bottom,this.left,this.right)},En.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cn=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new En,this._posMatrixCache={},this._alignedPosMatrixCache={}},In={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Cn.prototype.clone=function(){var t=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},In.minZoom.get=function(){return this._minZoom},In.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},In.maxZoom.get=function(){return this._maxZoom},In.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},In.minPitch.get=function(){return this._minPitch},In.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},In.maxPitch.get=function(){return this._maxPitch},In.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},In.renderWorldCopies.get=function(){return this._renderWorldCopies},In.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},In.worldSize.get=function(){return this.tileSize*this.scale},In.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},In.size.get=function(){return new t.Point(this.width,this.height)},In.bearing.get=function(){return-this.angle/Math.PI*180},In.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},In.pitch.get=function(){return this._pitch/Math.PI*180},In.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},In.fov.get=function(){return this._fov/Math.PI*180},In.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},In.zoom.get=function(){return this._zoom},In.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},In.center.get=function(){return this._center},In.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},In.padding.get=function(){return this._edgeInsets.toJSON()},In.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},In.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Cn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Cn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Cn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Cn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=Mn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Sn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],f=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var _=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(_),Math.abs(b)),T=3+(1<T&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===f?p:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var k=0;k<4;k++){var A=(g<<1)+k%2,M=(y<<1)+(k>>1);u.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:A,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Cn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},In.unmodified.get=function(){return this._unmodified},Cn.prototype.zoomScale=function(t){return Math.pow(2,t)},Cn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Cn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Cn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},In.point.get=function(){return this.project(this.center)},Cn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Cn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Cn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Cn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Cn.prototype.coordinateLocation=function(t){return t.toLngLat()},Cn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,f=u===h?0:(0-u)/(h-u);return new t.MercatorCoordinate(t.number(o,s,f)/this.worldSize,t.number(l,c,f)/this.worldSize)},Cn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Cn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Cn.prototype.setMaxBounds=function(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])},Cn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var y=p.x,v=c.x/2;y-vl&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},Cn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-s,-l,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),t.scale(h,h,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var f=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*f+m*p,y=l-Math.round(l)+d*p+m*f,v=new Float64Array(h);if(t.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Cn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Cn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Ln.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Pn={linearity:.3,easing:t.bezier(0,0,.3,1)},zn=t.extend({deceleration:2500,maxSpeed:1400},Pn),Dn=t.extend({deceleration:20,maxSpeed:1400},Pn),On=t.extend({deceleration:1e3,maxSpeed:360},Pn),Rn=t.extend({deceleration:1e3,maxSpeed:90},Pn),Fn=function(t){this._map=t,this.clear()};function jn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Fn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.dblclick=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},qn.prototype.mouseover=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.mouseout=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.touchstart=function(t){return this._firePreventable(new Un(t.type,this._map,t))},qn.prototype.touchmove=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype.touchend=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype.touchcancel=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(t){this._map=t};Hn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Hn.prototype.mousemove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Hn.prototype.mousedown=function(){this._delayContextMenu=!0},Hn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Hn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Nn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Hn.prototype.isEnabled=function(){return!0},Hn.prototype.isActive=function(){return!1},Hn.prototype.enable=function(){},Hn.prototype.disable=function(){};var Gn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Zn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Wn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Yn=function(t){this.singleTap=new Wn(t),this.numTaps=t.numTaps,this.reset()};Yn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Yn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Yn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Yn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Xn=function(){this._zoomIn=new Yn({numTouches:1,numTaps:2}),this._zoomOut=new Yn({numTouches:2,numTaps:1}),this.reset()};Xn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Xn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Xn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Xn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var $n={0:1,2:2},Kn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Kn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Kn.prototype._correctButton=function(t,e){return!1},Kn.prototype._move=function(t,e){return{}},Kn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Kn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=$n[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Zn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,li(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return li(t)&&li(e)&&a}},e}(ri),ui={panStep:100,bearingStep:15,pitchStep:10},hi=function(){var t=ui;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function fi(t){return t*(2-t)}hi.prototype.reset=function(){this._active=!1},hi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:fi,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active},hi.prototype.disableRotation=function(){this._rotationDisabled=!0},hi.prototype.enableRotation=function(){this._rotationDisabled=!1};var pi=4.000244140625,di=1/450,mi=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=di,t.bindAll(["_onTimeout"],this)};mi.prototype.setZoomRate=function(t){this._defaultZoomRate=t},mi.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},mi.prototype.isEnabled=function(){return!!this._enabled},mi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mi.prototype.isZooming=function(){return!!this._zooming},mi.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},mi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mi.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%pi==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},mi.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},mi.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mi.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>pi?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(h);o=t.number(l,s,f),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mi.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},mi.prototype.reset=function(){this._active=!1};var gi=function(t,e){this._clickZoom=t,this._tapZoom=e};gi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},gi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},gi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},gi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var yi=function(){this.reset()};yi.prototype.reset=function(){this._active=!1},yi.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(){this._tap=new Yn({numTouches:1,numTaps:1}),this.reset()};vi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},vi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},vi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},vi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var xi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};xi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var _i=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};_i.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},_i.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},_i.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},_i.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var bi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};bi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},bi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},bi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},bi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},bi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},bi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function ki(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Ai=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Fn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,b):Math.max(.5,b),w=Math.pow(g,1-e),T=i.unproject(x.add(_.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(u-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var x=a.project(y),_=a.project(v).sub(x),b=e.curve,w=Math.max(a.width,a.height),T=w/d,k=_.mag();if("minZoom"in e){var A=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),M=w/a.zoomScale(A-o);b=Math.sqrt(M/k*2)}var S=b*b;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var L=E(0),P=function(t){return I(L)/I(L+b*t)},z=function(t){return w*((I(L)*(C(e=L+b*t)/I(e))-C(L))/S)/k;var e},D=(E(1)-L)/b;if(Math.abs(k)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(e){var i=e*D,d=1/P(i);a.zoom=1===e?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,h,e)),n._pitching&&(a.pitch=t.number(l,f,e)),n._padding&&(a.interpolatePadding(c,p,e),g=a.centerPoint.add(m));var y=1===e?v:a.unproject(x.add(_.mult(z(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),Si=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Si.prototype.getDefaultPosition=function(){return"bottom-right"},Si.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Si.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Si.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},Si.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Si.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Si.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ei=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Ei.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ei.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ei.prototype.getDefaultPosition=function(){return"bottom-left"},Ei.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Ei.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},Ei.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Ci=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ci.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Ci.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>Di)throw new Error("maxPitch must be less than or equal to 60");var i=new Cn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ii,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Pi))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ai(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Ln(a).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,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Si({customAttribution:e.customAttribution})),this.addControl(new Ei,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()Di)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Nn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Nn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Nn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ni.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ni.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ni.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ni.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ni.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ni.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ni.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ni.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ni.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ni.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){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),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))},n.prototype.setDraggable=function(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},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Wi=0,Yi=!1,Xi=function(e){function n(r){e.call(this),this.options=t.extend({},Zi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Hi?n(Hi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Hi="denied"!==t.state,n(Hi)})):(Hi=!!t.window.navigator.geolocation,n(Hi)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Wi=0,Yi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("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("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Yi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");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=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Gi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gi({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",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Wi--,Yi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Wi>1?(e={maximumAge:6e5,timeout:0},Yi=!0):(e=this.options.positionOptions,Yi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),$i={maxWidth:100,unit:"metric"},Ki=function(e){this.options=t.extend({},$i,e),t.bindAll(["_onMove","setUnit"],this)};function Ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Qi(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Qi(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Qi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Qi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Qi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Qi(t,e,r,n){var i,a,o,s=(i=r,a=Math.pow(10,(""+Math.floor(i)).length-1),o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),a*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}Ki.prototype.getDefaultPosition=function(){return"bottom-left"},Ki.prototype._onMove=function(){Ji(this._map,this._container,this.options)},Ki.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ki.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ki.prototype.setUnit=function(t){this.options.unit=t,Ji(this._map,this._container,this.options)};var ta=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};ta.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ta.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ta.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},ta.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ta.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},ta.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ta.prototype._isFullscreen=function(){return this._fullscreen},ta.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ta.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ea={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ra=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(ea),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.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 t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-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))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(t){var e=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),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=Ui(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=ia(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Vi[a]+" translate("+u.x+"px,"+u.y+"px)"),qi(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(ra);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function ia(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.Point(0,0),top:new t.Point(0,e),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-e),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(e,0),right:new t.Point(-e,0)}}if(e instanceof t.Point||Array.isArray(e)){var n=t.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(e.center||[0,0]),top:t.Point.convert(e.top||[0,0]),"top-left":t.Point.convert(e["top-left"]||[0,0]),"top-right":t.Point.convert(e["top-right"]||[0,0]),bottom:t.Point.convert(e.bottom||[0,0]),"bottom-left":t.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(e["bottom-right"]||[0,0]),left:t.Point.convert(e.left||[0,0]),right:t.Point.convert(e.right||[0,0])}}return ia(new t.Point(0,0))}var aa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ri,NavigationControl:Bi,GeolocateControl:Xi,AttributionControl:Si,ScaleControl:Ki,FullscreenControl:ta,Popup:na,Marker:Gi,Style:We,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Nt().acquire(Rt)},clearPrewarmedResources:function(){var t=jt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),jt=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()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return aa})),r},"object"==typeof t&&void 0!==e?e.exports=i():void 0===(a="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=a)}}),f_=d({"src/plots/mapbox/layers.js"(t,e){var r=se(),n=Me().sanitizeHTML,i=a_(),a=Qx();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e1&&r.warn(f.multipleTokensErrorMsg),a[0]):(o.length&&r.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);e.accessToken=s;for(var l=0;lw/2){var T=v.split("|").join("
");_.text(T).attr("data-unformatted",T).call(c.convertToTspans,t),b=l.bBox(_.node())}_.attr("transform",n(-3,8-b.height)),x.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;b.width+6>w&&(k=w/(b.width+6));var A=[a.l+a.w*d.x[1],a.t+a.h*(1-d.y[0])];x.attr("transform",n(A[0],A[1])+i(k))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[h],n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),w_=d({"src/traces/choroplethmapbox/index.js"(t,e){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:v_(),supplyDefaults:x_(),colorbar:No(),calc:Tg(),plot:b_(),hoverPoints:Mg(),eventData:Sg(),selectPoints:Eg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),C_=d({"src/traces/densitymapbox/hover.js"(t,e){var r=nr(),n=l_().hoverPoints,i=l_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),I_=d({"src/traces/densitymapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),L_=d({"src/traces/densitymapbox/index.js"(t,e){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:k_(),supplyDefaults:A_(),colorbar:No(),formatLabels:i_(),calc:M_(),plot:E_(),hoverPoints:C_(),eventData:I_(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;nESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),D_=d({"src/plots/map/styles/arcgis-sat.js"(t,e){e.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),O_=d({"src/plots/map/constants.js"(t,e){var r=Zt(),n=z_(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:D_(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'© OpenStreetMap contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);e.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),R_=d({"src/plots/map/layout_attributes.js"(t,e){var r=se(),n=q().defaultLine,i=Ta().attributes,a=R(),o=wn().textposition,s=Lt().overrideAll,l=ge().templatedArray,c=O_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),F_=d({"src/traces/scattermap/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=bn(),a=Gm(),o=wn(),s=R_(),l=N(),c=Le(),u=O().extendFlat,h=Lt().overrideAll,f=R_(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),j_=d({"src/traces/scattermap/constants.js"(t,e){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),B_=d({"src/traces/scattermap/defaults.js"(t,e){var r=se(),n=We(),i=Zn(),a=Wn(),o=Xn(),s=$n(),l=F_(),c=j_().isSupportedFont;e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f);if(d){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),n.hasMarkers(e)){i(t,e,u,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==e.fill&&s(t,e,u,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),N_=d({"src/traces/scattermap/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),U_=d({"src/plots/map/convert_text_opts.js"(t,e){var r=se();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),V_=d({"src/traces/scattermap/convert.js"(t,e){var r=T(),n=se(),i=k().BADNUM,a=Jm(),o=Ze(),s=Je(),l=Ye(),c=We(),u=j_().isSupportedFont,h=U_(),f=Xe().appendArrayPointValue,p=Me().NEWLINES,d=Me().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),k=c.hasMarkers(u),A=c.hasText(u),M=k&&"circle"===u.marker.symbol,S=k&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,_=[];for(e=0;e=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function f(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",f.circle,l.cluster),r=0;r")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-f.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),G_=d({"src/traces/scattermap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),Z_=d({"src/traces/scattermap/select.js"(t,e){var r=se(),n=We(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var d=n(l);let m,g;function y(){return null==m&&(m="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;ri.solve(t)}const _=x(.25,.1,.25,1);function b(t,e,r){return Math.min(r,Math.max(e,t))}function w(t,e,r){const n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function T(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}let k=1;function A(t,e,r){const n={};for(const r in t)n[r]=e.call(this,t[r],r,t);return n}function M(t,e,r){const n={};for(const r in t)e.call(this,t[r],r,t)&&(n[r]=t[r]);return n}function S(t){return Array.isArray(t)?t.map(S):"object"==typeof t&&t?A(t,S):t}const E={};function C(t){E[t]||("undefined"!=typeof console&&console.warn(t),E[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function L(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let P=null;function z(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(t,e,n,i,a){return r(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const r=new VideoFrame(t,{timestamp:0});try{const o=null==r?void 0:r.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);const s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield r.copyTo(l,function(t,e,r,n,i){const a=4*Math.max(-e,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,e),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(t.width,e+n)-l,height:Math.min(t.height,r+i)-c},layout:[{offset:o,stride:s}]}}(t,e,n,i,a)),s)for(let t=0;tL(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,G=function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const r=U(t.url);if(r)return r(t,e);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:V},e)}if(!(/^file:/.test(n=t.url)||/^file:/.test(H())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,e){return r(this,void 0,void 0,(function*(){const r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:H(),signal:e.signal});"json"!==t.type||r.headers.has("Accept")||r.headers.set("Accept","application/json");const n=yield fetch(r);if(!n.ok){const e=yield n.blob();throw new q(n.status,n.statusText,t.url,e)}let i;i="arrayBuffer"===t.type||"image"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text();const a=yield i;if(e.signal.aborted)throw B();return{data:a,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}))}(t,e);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:V},e)}var n,i,a;return i=t,a=e,new Promise(((t,e)=>{var r;const n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(const t in i.headers)n.setRequestHeader(t,i.headers[t]);"json"===i.type&&(n.responseType="text",(null===(r=i.headers)||void 0===r?void 0:r.Accept)||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{e(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===i.type)try{r=JSON.parse(n.response)}catch(t){return void e(t)}t({data:r,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{const t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});e(new q(n.status,n.statusText,i.url,t))}},a.signal.addEventListener("abort",(()=>{n.abort(),e(B())})),n.send(i.body)}))};function Z(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function W(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Y(t,e,r){if(r&&r[t]){const n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}class X{constructor(t,e={}){T(this,e),this.type=t}}class $ extends X{constructor(t,e={}){super("error",T({error:t},e))}}class K{on(t,e){return this._listeners=this._listeners||{},W(t,e,this._listeners),this}off(t,e){return Y(t,e,this._listeners),Y(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},W(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new X(t,e||{}));const r=t.type;if(this.listens(r)){t.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of e)r.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const e of n)Y(r,e,this._oneTimeListeners),e.call(this,t);const i=this._eventedParent;i&&(T(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(t))}else t instanceof $&&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,e){return this._eventedParent=t,this._eventedParentData=e,this}}var J={$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"}}};const Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tt(t,e){const r={};for(const e in t)"ref"!==e&&(r[e]=t[e]);return Q.forEach((t=>{t in e&&(r[t]=e[t])})),r}function et(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Et=[dt,mt,gt,yt,vt,wt,xt,Mt(_t),Tt,kt,At];function Ct(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ct(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of Et)if(!Ct(t,e))return null}return`Expected ${St(t)} but found ${St(e)} instead.`}function It(t,e){return e.some((e=>e.kind===t.kind))}function Lt(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function Pt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const zt=.96422,Dt=.82521,Ot=4/29,Rt=6/29,Ft=3*Rt*Rt,jt=Rt*Rt*Rt,Bt=Math.PI/180,Nt=180/Math.PI;function Ut(t){return(t%=360)<0&&(t+=360),t}function Vt([t,e,r,n]){let i,a;const o=Ht((.2225045*(t=qt(t))+.7168786*(e=qt(e))+.0606169*(r=qt(r)))/1);t===e&&e===r?i=a=o:(i=Ht((.4360747*t+.3850649*e+.1430804*r)/zt),a=Ht((.0139322*t+.0971045*e+.7141733*r)/Dt));const s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),n]}function qt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ht(t){return t>jt?Math.pow(t,1/3):t/Ft+Ot}function Gt([t,e,r,n]){let i=(t+16)/116,a=isNaN(e)?i:i+e/500,o=isNaN(r)?i:i-r/200;return i=1*Wt(i),a=zt*Wt(a),o=Dt*Wt(o),[Zt(3.1338561*a-1.6168667*i-.4906146*o),Zt(-.9787684*a+1.9161415*i+.033454*o),Zt(.0719453*a-.2289914*i+1.4052427*o),n]}function Zt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Wt(t){return t>Rt?t*t*t:Ft*(t-Ot)}function Yt(t){return parseInt(t.padEnd(2,t),16)/255}function Xt(t,e){return $t(e?t/100:t,0,1)}function $t(t,e,r){return Math.min(Math.max(e,t),r)}function Kt(t){return!t.some(Number.isNaN)}const Jt={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 Qt{constructor(t,e,r,n=1,i=!0){this.r=t,this.g=e,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,e,r,n]))}static parse(t){if(t instanceof Qt)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=Jt[t];if(e){const[t,r,n]=e;return[t/255,r/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let r=1;return[Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,r,n,i,a,o,s,l,c,u,h,f]=e,p=[i||" ",s||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const t=[n,o,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[$t(+r/e,0,1),$t(+a/e,0,1),$t(+l/e,0,1),h?Xt(+h,f):1];if(Kt(t))return t}}return}}const r=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[t,e,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const t=[+e,$t(+i,0,100),$t(+o,0,100),l?Xt(+l,c):1];if(Kt(t))return function([t,e,r,n]){function i(n){const i=(n+t/30)%12,a=e*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=Ut(t),e/=100,r/=100,[i(0),i(8),i(4),n]}(t)}}}(t);return e?new Qt(...e,!1):void 0}get rgb(){const{r:t,g:e,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[t/i,e/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,r,n,i]=Vt(t),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ut(Math.atan2(n,r)*Nt):NaN,a,e,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Vt(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,r,n]=this.rgb;return`rgba(${[t,e,r].map((t=>Math.round(255*t))).join(",")},${n})`}}Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);class te{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ee{constructor(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i}}class re{constructor(t){this.sections=t}static fromString(t){return new re([new ee(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof re?t:re.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class ne{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ne)return t;if("number"==typeof t)return new ne([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)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 ne(t)}}toString(){return JSON.stringify(this.values)}}const ie=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ae{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ae)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function le(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Qt||t instanceof te||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe)return!0;if(Array.isArray(t)){for(const e of t)if(!le(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!le(t[e]))return!1;return!0}return!1}function ce(t){if(null===t)return dt;if("string"==typeof t)return gt;if("boolean"==typeof t)return yt;if("number"==typeof t)return mt;if(t instanceof Qt)return vt;if(t instanceof te)return bt;if(t instanceof re)return wt;if(t instanceof ne)return Tt;if(t instanceof ae)return At;if(t instanceof oe)return kt;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=ce(e);if(r){if(r===t)continue;r=_t;break}r=t}return Mt(r||_t,e)}return xt}function ue(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe?t.toString():JSON.stringify(t)}class he{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!le(t[1]))return e.error("invalid value");const r=t[1];let n=ce(r);const i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new he(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class fe{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const pe={string:gt,number:mt,boolean:yt,object:xt};class de{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1;const i=t[0];if("array"===i){let i,a;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in pe)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[r],n++}else i=_t;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Mt(i,a)}else{if(!pe[i])throw new Error(`Types doesn't contain name = ${i}`);r=pe[i]}const a=[];for(;nt.outputDefined()))}}const me={"to-boolean":yt,"to-color":vt,"to-number":mt,"to-string":gt};class ge{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(!me[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const n=me[r],i=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:se(e[0],e[1],e[2],e[3]),!r))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new fe(r||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const r of this.args){e=r.evaluate(t);const n=ne.parse(e);if(n)return n}throw new fe(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const r of this.args){e=r.evaluate(t);const n=ae.parse(e);if(n)return n}throw new fe(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new fe(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return re.fromString(ue(this.args[0].evaluate(t)));case"resolvedImage":return oe.fromString(ue(this.args[0].evaluate(t)));default:return ue(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const ye=["Unknown","Point","LineString","Polygon"];class ve{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?"number"==typeof this.feature.type?ye[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 e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e}}class xe{constructor(t,e,r=[],n,i=new pt,a=[]){this.registry=t,this.path=r,this.key=r.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=e}parse(t,e,r,n,i={}){return e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}_parse(t,e){function r(t,e,r){return"assert"===r?new de(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,i=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==t.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(t,i))return null}else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"assert")}if(!(n instanceof he)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const t=new ve;try{n=new he(n.type,n.evaluate(t))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xe(this.registry,this._isConstant,n,e||null,i,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new ft(r,t))}checkSubtype(t,e){const r=Ct(t,e);return r&&this.error(r),r}}class _e{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let n=1;n=r.length)throw new fe(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new fe(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Te{constructor(t,e){this.type=yt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);return r&&n?It(r.type,[yt,gt,mt,dt,_t])?new Te(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Lt(e,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ce(e))} instead.`);if(!Lt(r,["string","array"]))throw new fe(`Expected second argument to be of type array or string, but found ${St(ce(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ke{constructor(t,e,r){this.type=mt,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);if(!r||!n)return null;if(!It(r.type,[yt,gt,mt,dt,_t]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,mt);return i?new ke(r,n,i):null}return new ke(r,n)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Lt(e,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ce(e))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),Lt(r,["string"])){const t=r.indexOf(e,n);return-1===t?-1:[...r.slice(0,t)].length}if(Lt(r,["array"]))return r.indexOf(e,n);throw new fe(`Expected second argument to be of type array or string, but found ${St(ce(r))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Ae{constructor(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i={},a=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ce(t)))return null}else r=ce(t);if(void 0!==i[String(t)])return c.error("Branch labels must be unique.");i[String(t)]=a.length}const u=e.parse(l,o,n);if(!u)return null;n=n||u.type,a.push(u)}const o=e.parse(t[1],1,_t);if(!o)return null;const s=e.parse(t[t.length-1],t.length-1,n);return s?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ae(r,n,o,i,a,s):null}evaluate(t){const e=this.input.evaluate(t);return(ce(e)===this.inputType&&this.outputs[this.cases[e]]||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 Me{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n=[];for(let i=1;ie.outputDefined()))&&this.otherwise.outputDefined()}}class Se{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,_t),n=e.parse(t[2],2,mt);if(!r||!n)return null;if(!It(r.type,[Mt(_t),gt,_t]))return e.error(`Expected first argument to be of type array or string, but found ${St(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,mt);return i?new Se(r.type,r,n,i):null}return new Se(r.type,r,n)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);let n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),Lt(e,["string"]))return[...e].slice(r,n).join("");if(Lt(e,["array"]))return e.slice(r,n);throw new fe(`Expected first argument to be of type array or string, but found ${St(ce(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ee(t,e){const r=t.length-1;let n,i,a=0,o=r,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),n=t[s],i=t[s+1],n<=e){if(s===r||ee))throw new fe("Input is not a number.");o=s-1}return 0}class Ce{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,mt);if(!r)return null;const n=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let r=1;r=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=e.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new Ce(i,r,n)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ee(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}var Ie=Le;function Le(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}Le.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Pe,ze=(Pe=Ie)&&Pe.__esModule&&Object.prototype.hasOwnProperty.call(Pe,"default")?Pe.default:Pe;function De(t,e,r){return t+r*(e-t)}function Oe(t,e,r){return t.map(((t,n)=>De(t,e[n],r)))}const Re={number:De,color:function(t,e,r,n="rgb"){switch(n){case"rgb":{const[n,i,a,o]=Oe(t.rgb,e.rgb,r);return new Qt(n,i,a,o,!1)}case"hcl":{const[n,i,a,o]=t.hcl,[s,l,c,u]=e.hcl;let h,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?h=NaN:(h=s,1!==a&&0!==a||(f=l)):(h=n,1!==c&&0!==c||(f=i));else{let t=s-n;s>n&&t>180?t-=360:s180&&(t+=360),h=n+r*t}const[p,d,m,g]=function([t,e,r,n]){return t=isNaN(t)?0:t*Bt,Gt([r,Math.cos(t)*e,Math.sin(t)*e,n])}([h,null!=f?f:De(i,l,r),De(a,c,r),De(o,u,r)]);return new Qt(p,d,m,g,!1)}case"lab":{const[n,i,a,o]=Gt(Oe(t.lab,e.lab,r));return new Qt(n,i,a,o,!1)}}},array:Oe,padding:function(t,e,r){return new ne(Oe(t.values,e.values,r))},variableAnchorOffsetCollection:function(t,e,r){const n=t.values,i=e.values;if(n.length!==i.length)throw new fe(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const a=[];for(let t=0;t"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,mt),!i)return null;const o=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=vt:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=e.parse(n,l,s);if(!c)return null;s=s||c.type,o.push([r,c])}return Pt(s,mt)||Pt(s,vt)||Pt(s,Tt)||Pt(s,At)||Pt(s,Mt(mt))?new Fe(s,r,n,i,o):e.error(`Type ${St(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);const a=Ee(e,n),o=Fe.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),l=r[a+1].evaluate(t);switch(this.operator){case"interpolate":return Re[this.type.kind](s,l,o);case"interpolate-hcl":return Re.color(s,l,o,"hcl");case"interpolate-lab":return Re.color(s,l,o,"lab")}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function je(t,e,r,n){const i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}class Be{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null;const n=e.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of t.slice(1)){const t=e.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t)}if(!r)throw new Error("No output type");const a=n&&i.some((t=>Ct(n,t.type)));return new Be(a?_t:r,i)}evaluate(t){let e,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(t),r&&r instanceof oe&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null!==r)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function Ne(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ue(t,e,r,n){return 0===n.compare(e,r)}function Ve(t,e,r){const n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let a=e.parse(t[1],1,_t);if(!a)return null;if(!Ne(r,a.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${St(a.type)}'.`);let o=e.parse(t[2],2,_t);if(!o)return null;if(!Ne(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${St(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${St(a.type)}' and '${St(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new de(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new de(a.type,[o])));let s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,bt),!s)return null}return new i(a,o,s)}evaluate(i){const a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const e=ce(a),r=ce(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new fe(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=ce(a),r=ce(o);if("string"!==t.kind||"string"!==r.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const qe=Ve("==",(function(t,e,r){return e===r}),Ue),He=Ve("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Ue(0,e,r,n)})),Ge=Ve("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),We=Ve("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Ye=Ve(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0}));class Xe{constructor(t,e,r){this.type=bt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,yt);if(!n)return null;const i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,yt);if(!i)return null;let a=null;return r.locale&&(a=e.parse(r.locale,1,gt),!a)?null:new Xe(n,i,a)}evaluate(t){return new te(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 $e{constructor(t,e,r,n,i){this.type=gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,mt);if(!r)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parse(n.locale,1,gt),!i))return null;let a=null;if(n.currency&&(a=e.parse(n.currency,1,gt),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=e.parse(n["min-fraction-digits"],1,mt),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=e.parse(n["max-fraction-digits"],1,mt),!s)?null:new $e(r,i,a,o,s)}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 Ke{constructor(t){this.type=wt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=t.length-1;++r){const a=t[r];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;let t=null;if(a["font-scale"]&&(t=e.parse(a["font-scale"],1,mt),!t))return null;let r=null;if(a["text-font"]&&(r=e.parse(a["text-font"],1,Mt(gt)),!r))return null;let o=null;if(a["text-color"]&&(o=e.parse(a["text-color"],1,vt),!o))return null;const s=n[n.length-1];s.scale=t,s.font=r,s.textColor=o}else{const a=e.parse(t[r],1,_t);if(!a)return null;const o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:a,scale:null,font:null,textColor:null})}}return new Ke(n)}evaluate(t){return new re(this.sections.map((e=>{const r=e.content.evaluate(t);return ce(r)===kt?new ee("",r,null,null,null):new ee(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}}class Je{constructor(t){this.type=kt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,gt);return r?new Je(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=oe.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}}class Qe{constructor(t){this.type=mt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${St(r.type)} instead.`):new Qe(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new fe(`Expected value to be of type string or array, but found ${St(ce(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const tr=8192;function er(t,e){const r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*tr),Math.round(n*i*tr)]}function rr(t,e){const r=Math.pow(2,e.z);return[(i=(t[0]/tr+e.x)/r,360*i-180),(n=(t[1]/tr+e.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ar(t,e,r){const n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(t,e,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-i[1]*a[0]&&!(!fr(t,e,r,n)||!fr(r,n,t,e));var i,a}function sr(t,e,r){for(const n of r)for(let r=0;r(i=t)[1]!=(o=s[e+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function cr(t,e){for(const r of e)if(lr(t,r))return!0;return!1}function ur(t,e){for(const r of t)if(!lr(r,e))return!1;for(let r=0;r0&&s<0||o<0&&s>0}function pr(t,e,r){const n=[];for(let i=0;ir[2]){const e=.5*n;let i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i}nr(e,t)}function gr(t,e,r,n){const i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(const n of t)for(const t of n){const n=[t.x+a[0],t.y+a[1]];mr(n,e,r,i),o.push(n)}return o}function yr(t,e,r,n){const i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(const r of t){const t=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];nr(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of o)for(const n of t)mr(n,e,r,i)}var s;return o}class vr{constructor(t,e){this.type=yt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const r of e.features){const{type:e,coordinates:n}=r.geometry;"Polygon"===e&&t.push(n),"MultiPolygon"===e&&t.push(...n)}if(t.length)return new vr(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new vr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new vr(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const a=pr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!lr(t,a))return!1}if("MultiPolygon"===e.type){const a=dr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!cr(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const a=pr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!ur(t,a))return!1}if("MultiPolygon"===e.type){const a=dr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!hr(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(t=[],e=(t,e)=>te?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=e[n],t=n}e[t]=i}};function _r(t,e,r,n,i){br(t,e,r,n||t.length-1,i||Tr)}function br(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);br(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,f=n;for(wr(t,r,e),i(t[n],u)>0&&wr(t,r,n);h0;)f--}0===i(t[r],u)?wr(t,r,f):wr(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function wr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Tr(t,e){return te?1:0}function kr(t,e){if(t.length<=1)return[t];const r=[];let n,i;for(const e of t){const t=Mr(e);0!==t&&(e.area=Math.abs(t),void 0===i&&(i=t<0),i===t<0?(n&&r.push(n),n=[e]):n.push(e))}if(n&&r.push(n),e>1)for(let t=0;t1?(l=t[s+1][0],c=t[s+1][1]):f>0&&(l+=u/this.kx*f,c+=h/this.ky*f)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;const p=u*u+h*h;p180;)t-=360;return t}}function Lr(t,e){return e[0]-t[0]}function Pr(t){return t[1]-t[0]+1}function zr(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];const r=Pr(t);if(e){if(2===r)return[t,null];const e=Math.floor(r/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===r)return[t,null];const n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function Or(t,e){if(!zr(e,t.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)nr(r,t[n]);return r}function Rr(t){const e=[1/0,1/0,-1/0,-1/0];for(const r of t)for(const t of r)nr(e,t);return e}function Fr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function jr(t,e,r){if(!Fr(t)||!Fr(e))return NaN;let n=0,i=0;return t[2]e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]=n)return n;if(ir(i,a)){if(Gr(t,e))return 0}else if(Gr(e,t))return 0;let o=1/0;for(const n of t)for(let t=0,i=n.length,a=i-1;t0;){const i=o.pop();if(i[0]>=a)continue;const l=i[1],c=e?50:100;if(Pr(l)<=c){if(!zr(l,t.length))return NaN;if(e){const e=Hr(t,l,r,n);if(isNaN(e)||0===e)return e;a=Math.min(a,e)}else for(let e=l[0];e<=l[1];++e){const i=qr(t[e],r,n);if(a=Math.min(a,i),0===a)return 0}}else{const r=Dr(l,e);Wr(o,a,n,t,s,r[0]),Wr(o,a,n,t,s,r[1])}}return a}function $r(t,e,r,n,i,a=1/0){let o=Math.min(a,i.distance(t[0],r[0]));if(0===o)return o;const s=new xr([[0,[0,t.length-1],[0,r.length-1]]],Lr);for(;s.length>0;){const a=s.pop();if(a[0]>=o)continue;const l=a[1],c=a[2],u=e?50:100,h=n?50:100;if(Pr(l)<=u&&Pr(c)<=h){if(!zr(l,t.length)&&zr(c,r.length))return NaN;let a;if(e&&n)a=Ur(t,l,r,c,i),o=Math.min(o,a);else if(e&&!n){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(a=Br(r[t],e,i),o=Math.min(o,a),0===o)return o}else if(!e&&n){const e=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Br(t[r],e,i),o=Math.min(o,a),0===o)return o}else a=Vr(t,l,r,c,i),o=Math.min(o,a)}else{const a=Dr(l,e),u=Dr(c,n);Yr(s,o,i,t,r,a[0],u[0]),Yr(s,o,i,t,r,a[0],u[1]),Yr(s,o,i,t,r,a[1],u[0]),Yr(s,o,i,t,r,a[1],u[1])}}return o}function Kr(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class Jr{constructor(t,e){this.type=mt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Jr(e,e.features.map((t=>Kr(t.geometry))).flat());if("Feature"===e.type)return new Jr(e,Kr(e.geometry));if("type"in e&&"coordinates"in e)return new Jr(e,Kr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;const i=new Ir(n[0][1]);let a=1/0;for(const t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!1,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!1,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!1,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;const i=new Ir(n[0][1]);let a=1/0;for(const t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!0,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!0,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!0,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const r=t.geometry();if(0===r.length||0===r[0].length)return NaN;const n=kr(r,0).map((e=>e.map((e=>e.map((e=>rr([e.x,e.y],t.canonical))))))),i=new Ir(n[0][0][0][1]);let a=1/0;for(const t of e)for(const e of n){switch(t.type){case"Point":a=Math.min(a,Xr([t.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Xr(t.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Zr(e,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Qr={"==":qe,"!=":He,">":Ze,"<":Ge,">=":Ye,"<=":We,array:de,at:we,boolean:de,case:Me,coalesce:Be,collator:Xe,format:Ke,image:Je,in:Te,"index-of":ke,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Qe,let:_e,literal:he,match:Ae,number:de,"number-format":$e,object:de,slice:Se,step:Ce,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:be,within:vr,distance:Jr};class tn{constructor(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const r=t[0],n=tn.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[n,a]of o){s=new xe(e.registry,on,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(St).join(", ")})`:`(${St(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r{r=e?r&&on(t):r&&t instanceof he})),!!r&&sn(t)&&cn(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(t){if(t instanceof tn){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof vr)return!1;if(t instanceof Jr)return!1;let e=!0;return t.eachChild((t=>{e&&!sn(t)&&(e=!1)})),e}function ln(t){if(t instanceof tn&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!ln(t)&&(e=!1)})),e}function cn(t,e){if(t instanceof tn&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!cn(t,e)&&(r=!1)})),r}function un(t){return{result:"success",value:t}}function hn(t){return{result:"error",value:t}}function fn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function pn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function dn(t){return!!t.expression&&t.expression.interpolated}function mn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function gn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function yn(t){return t}function vn(t,e){const r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),a=t.type||(dn(e)?"exponential":"interval");if(r||"padding"===e.type){const n=r?Qt.parse:ne.parse;(t=ht({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],n(t[1])]))),t.default=n(t.default?t.default:e.default)}if(t.colorSpace&&"rgb"!==(o=t.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${t.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=wn;else if("interval"===a)s=bn;else if("categorical"===a){s=_n,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=Tn}if(n){const r={},n=[];for(let e=0;et[0])),evaluate:({zoom:r},n)=>wn({stops:i,base:t.base},e,r).evaluate(r,n)}}if(i){const r="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Fe.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>s(t,e,r,l,c)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?xn(t.default,e.default):s(t,e,i,l,c)}}}function xn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function _n(t,e,r,n,i){return xn(typeof r===i?n[r]:void 0,t.default,e.default)}function bn(t,e,r){if("number"!==mn(r))return xn(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const i=Ee(t.stops.map((t=>t[0])),r);return t.stops[i][1]}function wn(t,e,r){const n=void 0!==t.base?t.base:1;if("number"!==mn(r))return xn(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const a=Ee(t.stops.map((t=>t[0])),r),o=function(t,e,r,n){const i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Re[e.type]||yn;return"function"==typeof s.evaluate?{evaluate(...e){const r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o,t.colorSpace)}}:c(s,l,o,t.colorSpace)}function Tn(t,e,r){switch(e.type){case"color":r=Qt.parse(r);break;case"formatted":r=re.fromString(r.toString());break;case"resolvedImage":r=oe.fromString(r.toString());break;case"padding":r=ne.parse(r);break;default:mn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0)}return xn(r,t.default,e.default)}tn.register(Qr,{error:[{kind:"error"},[gt],(t,[e])=>{throw new fe(e.evaluate(t))}],typeof:[gt,[_t],(t,[e])=>St(ce(e.evaluate(t)))],"to-rgba":[Mt(mt,4),[vt],(t,[e])=>{const[r,n,i,a]=e.evaluate(t).rgb;return[255*r,255*n,255*i,a]}],rgb:[vt,[mt,mt,mt],en],rgba:[vt,[mt,mt,mt,mt],en],has:{type:yt,overloads:[[[gt],(t,[e])=>rn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>rn(e.evaluate(t),r.evaluate(t))]]},get:{type:_t,overloads:[[[gt],(t,[e])=>nn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>nn(e.evaluate(t),r.evaluate(t))]]},"feature-state":[_t,[gt],(t,[e])=>nn(e.evaluate(t),t.featureState||{})],properties:[xt,[],t=>t.properties()],"geometry-type":[gt,[],t=>t.geometryType()],id:[_t,[],t=>t.id()],zoom:[mt,[],t=>t.globals.zoom],"heatmap-density":[mt,[],t=>t.globals.heatmapDensity||0],"line-progress":[mt,[],t=>t.globals.lineProgress||0],accumulated:[_t,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[mt,an(mt),(t,e)=>{let r=0;for(const n of e)r+=n.evaluate(t);return r}],"*":[mt,an(mt),(t,e)=>{let r=1;for(const n of e)r*=n.evaluate(t);return r}],"-":{type:mt,overloads:[[[mt,mt],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[mt],(t,[e])=>-e.evaluate(t)]]},"/":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[mt,[],()=>Math.LN2],pi:[mt,[],()=>Math.PI],e:[mt,[],()=>Math.E],"^":[mt,[mt,mt],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[mt,[mt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))],log2:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[mt,[mt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[mt,[mt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[mt,[mt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[mt,[mt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[mt,[mt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[mt,[mt],(t,[e])=>Math.atan(e.evaluate(t))],min:[mt,an(mt),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[mt,an(mt),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[mt,[mt],(t,[e])=>Math.abs(e.evaluate(t))],round:[mt,[mt],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[mt,[mt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[mt,[mt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[yt,[gt,_t],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[yt,[_t],(t,[e])=>t.id()===e.value],"filter-type-==":[yt,[gt],(t,[e])=>t.geometryType()===e.value],"filter-<":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n{const r=t.id(),n=e.value;return typeof r==typeof n&&r":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[yt,[_t],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[yt,[_t],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[yt,[_t],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[yt,[_t],(t,[e])=>e.value in t.properties()],"filter-has-id":[yt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[yt,[Mt(gt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[yt,[Mt(_t)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[yt,[gt,Mt(_t)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[yt,[gt,Mt(_t)],(t,[e,r])=>function(t,e,r,n){for(;r<=n;){const i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[an(yt),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[an(yt),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[yt,[yt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[yt,[gt],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[gt,[gt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[gt,[gt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[gt,an(_t),(t,e)=>e.map((e=>ue(e.evaluate(t)))).join("")],"resolved-locale":[gt,[bt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class kn{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?"color"===(r=e).type&&gn(r.default)?new Qt(0,0,0,0):"color"===r.type?Qt.parse(r.default)||null:"padding"===r.type?ne.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ae.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new fe(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function An(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Qr}function Mn(t,e){const r=new xe(Qr,on,[],e?function(t){const e={color:vt,string:gt,number:mt,enum:gt,boolean:yt,formatted:wt,padding:Tt,resolvedImage:kt,variableAnchorOffsetCollection:At};return"array"===t.type?Mt(e[t.value]||_t,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?un(new kn(n,e)):hn(r.errors)}class Sn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ln(e.expression)}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}}class En{constructor(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ln(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}interpolationFactor(t,e,r){return this.interpolationType?Fe.interpolationFactor(this.interpolationType,t,e,r):0}}function Cn(t,e){const r=Mn(t,e);if("error"===r.result)return r;const n=r.value.expression,i=sn(n);if(!i&&!fn(e))return hn([new ft("","data expressions not supported")]);const a=cn(n,["zoom"]);if(!a&&!pn(e))return hn([new ft("","zoom expressions not supported")]);const o=Ln(n);return o||a?o instanceof ft?hn([o]):o instanceof Fe&&!dn(e)?hn([new ft("",'"interpolate" expressions cannot be used with this property')]):un(o?new En(i?"camera":"composite",r.value,o.labels,o instanceof Fe?o.interpolation:void 0):new Sn(i?"constant":"source",r.value)):hn([new ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class In{constructor(t,e){this._parameters=t,this._specification=e,ht(this,vn(this._parameters,this._specification))}static deserialize(t){return new In(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ln(t){let e=null;if(t instanceof _e)e=Ln(t.result);else if(t instanceof Be){for(const r of t.args)if(e=Ln(r),e)break}else(t instanceof Ce||t instanceof Fe)&&t.input instanceof tn&&"zoom"===t.input.name&&(e=t);return e instanceof ft||t.eachChild((t=>{const r=Ln(t);r instanceof ft?e=r:!e&&r?e=new ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new ft("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Pn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Pn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Dn(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Pn(t)||(t=Fn(t));const e=Mn(t,zn);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,r,n)=>e.value.evaluate(t,r,{},n),needGeometry:Rn(t)}}function On(t,e){return te?1:0}function Rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?jn(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fn))):"all"===e?["all"].concat(t.slice(1).map(Fn)):"none"===e?["all"].concat(t.slice(1).map(Fn).map(Un)):"in"===e?Bn(t[1],t.slice(2)):"!in"===e?Un(Bn(t[1],t.slice(2))):"has"===e?Nn(t[1]):"!has"!==e||Un(Nn(t[1]));var r}function jn(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Bn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(On)]]:["filter-in-small",t,["literal",e]]}}function Nn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Un(t){return["!",t]}function Vn(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const r of t)e+=`${Vn(r)},`;return`${e}]`}const r=Object.keys(t).sort();let n="{";for(let e=0;en.maximum?[new ut(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function $n(t){const e=t.valueSpec,r=Gn(t.value.type);let n,i,a,o={};const s="categorical"!==r&&void 0===t.value.property,l=!s,c="array"===mn(t.value.stops)&&"array"===mn(t.value.stops[0])&&"object"===mn(t.value.stops[0][0]),u=Wn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===r)return[new ut(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(Yn({key:t.key,value:n,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===mn(n)&&0===n.length&&e.push(new ut(t.key,n,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===r&&s&&u.push(new ut(t.key,t.value,'missing required property "property"')),"identity"===r||t.value.stops||u.push(new ut(t.key,t.value,'missing required property "stops"')),"exponential"===r&&t.valueSpec.expression&&!dn(t.valueSpec)&&u.push(new ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!fn(t.valueSpec)?u.push(new ut(t.key,t.value,"property functions not supported")):s&&!pn(t.valueSpec)&&u.push(new ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==t.value.property||u.push(new ut(t.key,t.value,'"property" property is required')),u;function h(t){let r=[];const n=t.value,s=t.key;if("array"!==mn(n))return[new ut(s,n,`array expected, ${mn(n)} found`)];if(2!==n.length)return[new ut(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==mn(n[0]))return[new ut(s,n,`object expected, ${mn(n[0])} found`)];if(void 0===n[0].zoom)return[new ut(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ut(s,n,"object stop key must have value")];if(a&&a>Gn(n[0].zoom))return[new ut(s,n[0].zoom,"stop zoom values must appear in ascending order")];Gn(n[0].zoom)!==a&&(a=Gn(n[0].zoom),i=void 0,o={}),r=r.concat(Wn({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Xn,value:f}}))}else r=r.concat(f({key:`${s}[0]`,value:n[0],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},n));return An(Zn(n[1]))?r.concat([new ut(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(t.validateSpec({key:`${s}[1]`,value:n[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function f(t,a){const s=mn(t.value),l=Gn(t.value),c=null!==t.value?t.value:a;if(n){if(s!==n)return[new ut(t.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let n=`number expected, ${s} found`;return fn(e)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(t.key,c,n)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==i&&lnew ut(`${t.key}${e.key}`,t.value,e.message)));const r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new ut(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ut(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!sn(r))return[new ut(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(t){const e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(t){return Pn(Zn(t.value))?Kn(ht({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ti(t)}function ti(t){const e=t.value,r=t.key;if("array"!==mn(e))return[new ut(r,e,`array expected, ${mn(e)} found`)];const n=t.styleSpec;let i,a=[];if(e.length<1)return[new ut(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Jn({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Gn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Gn(e[1])&&a.push(new ut(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new ut(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=mn(e[1]),"string"!==i&&a.push(new ut(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let o=2;o{t in r&&e.push(new ut(n,r[t],`"${t}" is prohibited for ref layers`))})),i.layers.forEach((e=>{Gn(e.id)===s&&(t=e)})),t?t.ref?e.push(new ut(n,r.ref,"ref cannot reference another ref layer")):o=Gn(t.type):e.push(new ut(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){const t=i.sources&&i.sources[r.source],a=t&&Gn(t.type);t?"vector"===a&&"raster"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?e.push(new ut(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?e.push(new ut(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&t.lineMetrics||e.push(new ut(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ut(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ut(n,r.source,`source "${r.source}" not found`))}else e.push(new ut(n,r,'missing required property "source"'));return e=e.concat(Wn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:t=>Wn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ni(ht({layerType:o},t))}}),paint:t=>Wn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ri(ht({layerType:o},t))}})}})),e}function ai(t){const e=t.value,r=t.key,n=mn(e);return"string"!==n?[new ut(r,e,`string expected, ${n} found`)]:[]}const oi={promoteId:function({key:t,value:e}){if("string"===mn(e))return ai({key:t,value:e});{const r=[];for(const n in e)r.push(...ai({key:`${t}.${n}`,value:e[n]}));return r}}};function si(t){const e=t.value,r=t.key,n=t.styleSpec,i=t.style,a=t.validateSpec;if(!e.type)return[new ut(r,e,'"type" is required')];const o=Gn(e.type);let s;switch(o){case"vector":case"raster":return s=Wn({key:r,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),s;case"raster-dem":return s=function(t){var e;const r=null!==(e=t.sourceName)&&void 0!==e?e:"",n=t.value,i=t.styleSpec,a=i.source_raster_dem,o=t.style;let s=[];const l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ut("source_raster_dem",n,`object expected, ${l} found`)),s;const c="custom"===Gn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const e in n)!c&&u.includes(e)?s.push(new ut(e,n[e],`In "${r}": "${e}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[e]?s=s.concat(t.validateSpec({key:e,value:n[e],valueSpec:a[e],validateSpec:t.validateSpec,style:o,styleSpec:i})):s.push(new ut(e,n[e],`unknown property "${e}"`));return s}({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),s;case"geojson":if(s=Wn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),e.cluster)for(const t in e.clusterProperties){const[n,i]=e.clusterProperties[t],o="string"==typeof n?[n,["accumulated"],["get",t]]:n;s.push(...Kn({key:`${r}.${t}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Kn({key:`${r}.${t}.reduce`,value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return Wn({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Wn({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ut(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function li(t){const e=t.value,r=t.styleSpec,n=r.light,i=t.style;let a=[];const o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("light",e,`object expected, ${o} found`)]),a;for(const o in e){const s=o.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r}):n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(o,e[o],`unknown property "${o}"`)])}return a}function ci(t){const e=t.value,r=t.styleSpec,n=r.sky,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("sky",e,`object expected, ${a} found`)];let o=[];for(const a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ut(a,e[a],`unknown property "${a}"`)]);return o}function ui(t){const e=t.value,r=t.styleSpec,n=r.terrain,i=t.style;let a=[];const o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("terrain",e,`object expected, ${o} found`)]),a;for(const o in e)a=a.concat(n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(o,e[o],`unknown property "${o}"`)]);return a}function hi(t){let e=[];const r=t.value,n=t.key;if(Array.isArray(r)){const i=[],a=[];for(const o in r)r[o].id&&i.includes(r[o].id)&&e.push(new ut(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&e.push(new ut(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),e=e.concat(Wn({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return ai({key:n,value:r})}const fi={"*":()=>[],array:Yn,boolean:function(t){const e=t.value,r=t.key,n=mn(e);return"boolean"!==n?[new ut(r,e,`boolean expected, ${n} found`)]:[]},number:Xn,color:function(t){const e=t.key,r=t.value,n=mn(r);return"string"!==n?[new ut(e,r,`color expected, ${n} found`)]:Qt.parse(String(r))?[]:[new ut(e,r,`color expected, "${r}" found`)]},constants:Hn,enum:Jn,filter:Qn,function:$n,layer:ii,object:Wn,source:si,light:li,sky:ci,terrain:ui,projection:function(t){const e=t.value,r=t.styleSpec,n=r.projection,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("projection",e,`object expected, ${a} found`)];let o=[];for(const a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ut(a,e[a],`unknown property "${a}"`)]);return o},string:ai,formatted:function(t){return 0===ai(t).length?[]:Kn(t)},resolvedImage:function(t){return 0===ai(t).length?[]:Kn(t)},padding:function(t){const e=t.key,r=t.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ut(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let i=[];for(let a=0;a[]}})),t.constants&&(r=r.concat(Hn({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:pi}))),yi(r)}function gi(t){return function(r){return t(((t,r)=>e(t,s(r)))(((t,e)=>{for(var r in e||(e={}))u.call(e,r)&&f(t,r,e[r]);if(c)for(var r of c(e))h.call(e,r)&&f(t,r,e[r]);return t})({},r),{validateSpec:pi}))}}function yi(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function vi(t){return function(...e){return yi(t.apply(this,e))}}mi.source=vi(gi(si)),mi.sprite=vi(gi(hi)),mi.glyphs=vi(gi(di)),mi.light=vi(gi(li)),mi.sky=vi(gi(ci)),mi.terrain=vi(gi(ui)),mi.layer=vi(gi(ii)),mi.filter=vi(gi(Qn)),mi.paintProperty=vi(gi(ri)),mi.layoutProperty=vi(gi(ni));const xi=mi,_i=xi.light,bi=xi.sky,wi=xi.paintProperty,Ti=xi.layoutProperty;function ki(t,e){let r=!1;if(e&&e.length)for(const n of e)t.fire(new $(new Error(n.message))),r=!0;return r}class Ai{constructor(t,e,r){const n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(let t=0;t=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(t,e,r,n,i,a,o,s){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++){const c=this.d*l+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(l),this._convertFromCellCoord(f+1),this._convertFromCellCoord(l+1)))&&i.call(this,t,e,r,n,c,a,o,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let r=0;for(let t=0;t=0)continue;const a=t[n];i[n]=Mi[r].shallow.indexOf(n)>=0?a:Li(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Pi(t){if(Ii(t))return t;if(Array.isArray(t))return t.map(Pi);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=Ci(t)||"Object";if(!Mi[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Mi[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);const n=Object.create(r.prototype);for(const r of Object.keys(t)){if("$name"===r)continue;const i=t[r];n[r]=Mi[e].shallow.indexOf(r)>=0?i:Pi(i)}return n}class zi{constructor(){this.first=!0}update(t,e){const r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomt>=128&&t<=255,Oi=t=>t>=6016&&t<=6143,Ri=t=>t>=8192&&t<=8303,Fi=t=>t>=8448&&t<=8527,ji=t=>t>=8528&&t<=8591,Bi=t=>t>=8960&&t<=9215,Ni=t=>t>=9216&&t<=9279,Ui=t=>t>=9280&&t<=9311,Vi=t=>t>=9312&&t<=9471,qi=t=>t>=9632&&t<=9727,Hi=t=>t>=9728&&t<=9983,Gi=t=>t>=11008&&t<=11263,Zi=t=>t>=12272&&t<=12287,Wi=t=>t>=12288&&t<=12351,Yi=t=>t>=12448&&t<=12543,Xi=t=>t>=12688&&t<=12703,$i=t=>t>=12736&&t<=12783,Ki=t=>t>=12800&&t<=13055,Ji=t=>t>=13056&&t<=13311,Qi=t=>t>=19904&&t<=19967,ta=t=>t>=57344&&t<=63743,ea=t=>t>=65040&&t<=65055,ra=t=>t>=65072&&t<=65103,na=t=>t>=65104&&t<=65135,ia=t=>t>=65280&&t<=65519;function aa(t){for(const e of t)if(ha(e.charCodeAt(0)))return!0;return!1}function oa(t){for(const e of t)if(!ca(e.charCodeAt(0)))return!1;return!0}function sa(t){const e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}const la=sa(["Arab","Dupl","Mong","Ougr","Syrc"]);function ca(t){return!la.test(String.fromCodePoint(t))}const ua=sa(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ha(t){return!(746!==t&&747!==t&&(t<4352||!(ra(t)&&!(t>=65097&&t<=65103)||Ji(t)||$i(t)||!(!Wi(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ki(t)||Zi(t)||Xi(t)||Yi(t)&&12540!==t||!(!ia(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!na(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ea(t)||Qi(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||ua.test(String.fromCodePoint(t)))))}function fa(t){return!(ha(t)||(e=t,Di(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ri(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Fi(e)||ji(e)||Bi(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ni(e)&&9251!==e||Ui(e)||Vi(e)||qi(e)||Hi(e)&&!(e>=9754&&e<=9759)||Gi(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Wi(e)||Yi(e)||ta(e)||ra(e)||na(e)||ia(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}const pa=sa(["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 da(t){return pa.test(String.fromCodePoint(t))}function ma(t,e){return!(!e&&da(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Oi(t))}function ga(t){for(const e of t)if(da(e.charCodeAt(0)))return!0;return!1}const ya=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class va{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(t){return function(t,e){for(const r of t)if(!ma(r.charCodeAt(0),e))return!1;return!0}(t,"loaded"===ya.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}}class xa{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new In(t,e);if(An(t)){const r=Cn(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"color"===e.type&&"string"==typeof t?r=Qt.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(r=ae.parse(t)):r=ne.parse(t),{kind:"constant",evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class _a{constructor(t){this.property=t,this.value=new xa(t,void 0)}transitioned(t,e){return new wa(this.property,this.value,e,T({},t.transition,this.transition),t.now)}untransitioned(){return new wa(this.property,this.value,null,{},0)}}class ba{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return S(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _a(this._values[t].property)),this._values[t].value=new xa(this._values[t].property,null===e?void 0:S(e))}getTransition(t){return S(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _a(this._values[t].property)),this._values[t].transition=S(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const r=new Ta(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){const t=new Ta(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class wa{constructor(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){const n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}}return i}}class Ta{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){const n=new Ma(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class ka{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return S(this._values[t].value)}setValue(t,e){this._values[t]=new xa(this._values[t].property,null===e?void 0:S(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){const n=new Ma(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class Aa{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class Ma{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Sa{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,r){const n=Re[this.specification.type];return n?n(t,e,r):t}}class Ea{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,r,n){return new Aa(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Aa(this,{kind:"constant",value:void 0},t.parameters);const n=Re[this.specification.type];if(n){const i=n(t.value.value,e.value.value,r);return new Aa(this,{kind:"constant",value:i},t.parameters)}return t}evaluate(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)}}class Ca extends Ea{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new Aa(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new Aa(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){const r=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Aa(this,{kind:"constant",value:r},e)}return new Aa(this,t.expression,e)}evaluate(t,e,r,n,i,a){if("source"===t.kind){const o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class Ia{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new va(Math.floor(e.zoom-1),e)),t.expression.evaluate(new va(Math.floor(e.zoom),e)),t.expression.evaluate(new va(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class La{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)}interpolate(){return!1}}class Pa{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const r=t[e];r.specification.overridable&&this.overridableProperties.push(e);const n=this.defaultPropertyValues[e]=new xa(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new _a(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}Si("DataDrivenProperty",Ea),Si("DataConstantProperty",Sa),Si("CrossFadedDataDrivenProperty",Ca),Si("CrossFadedProperty",Ia),Si("ColorRampProperty",La);const za="-transition";class Da extends K{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ka(e.layout)),e.paint)){this._transitionablePaint=new ba(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ma(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,r={}){null!=e&&this._validate(Ti,`layers.${this.id}.layout.${t}`,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(za)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(null!=e&&this._validate(wi,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(za))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const o=this._transitionablePaint._values[t].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(t,a,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),M(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,r,n,i={}){return(!i||!1!==i.validate)&&ki(this,t.call(xi,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:J,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof Aa&&fn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const Oa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ra{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ja(t,e=1){let r=0,n=0;return{members:t.map((t=>{const i=Oa[t.type].BYTES_PER_ELEMENT,a=r=Ba(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:Ba(r,Math.max(n,e)),alignment:e}}function Ba(t,e){return Math.ceil(t/e)*e}class Na extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}Na.prototype.bytesPerElement=4,Si("StructArrayLayout2i4",Na);class Ua extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Ua.prototype.bytesPerElement=6,Si("StructArrayLayout3i6",Ua);class Va extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t}}Va.prototype.bytesPerElement=8,Si("StructArrayLayout4i8",Va);class qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}qa.prototype.bytesPerElement=12,Si("StructArrayLayout2i4i12",qa);class Ha extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t}}Ha.prototype.bytesPerElement=8,Si("StructArrayLayout2i4ub8",Ha);class Ga extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}Ga.prototype.bytesPerElement=8,Si("StructArrayLayout2f8",Ga);class Za extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)}emplace(t,e,r,n,i,a,o,s,l,c,u){const h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t}}Za.prototype.bytesPerElement=20,Si("StructArrayLayout10ui20",Za);class Wa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h){const f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t}}Wa.prototype.bytesPerElement=24,Si("StructArrayLayout4i4ui4i24",Wa);class Ya extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}Ya.prototype.bytesPerElement=12,Si("StructArrayLayout3f12",Ya);class Xa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Xa.prototype.bytesPerElement=4,Si("StructArrayLayout1ul4",Xa);class $a extends Fa{_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,e,r,n,i,a,o,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)}emplace(t,e,r,n,i,a,o,s,l,c){const u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t}}$a.prototype.bytesPerElement=20,Si("StructArrayLayout6i1ul2ui20",$a);class Ka extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}Ka.prototype.bytesPerElement=12,Si("StructArrayLayout2i2i2i12",Ka);class Ja extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)}emplace(t,e,r,n,i,a){const o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t}}Ja.prototype.bytesPerElement=16,Si("StructArrayLayout2f1f2i16",Ja);class Qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,t}}Qa.prototype.bytesPerElement=16,Si("StructArrayLayout2ub2f2i16",Qa);class to extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}to.prototype.bytesPerElement=6,Si("StructArrayLayout3ui6",to);class eo extends Fa{_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,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){const v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t}}eo.prototype.bytesPerElement=48,Si("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",eo);class ro extends Fa{_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,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){const E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){const C=32*t,I=16*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.uint16[C+30]=S,this.uint16[C+31]=E,t}}ro.prototype.bytesPerElement=64,Si("StructArrayLayout8i15ui1ul2f2ui64",ro);class no extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}no.prototype.bytesPerElement=4,Si("StructArrayLayout1f4",no);class io extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[6*t+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}io.prototype.bytesPerElement=12,Si("StructArrayLayout1ui2f12",io);class ao extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t}}ao.prototype.bytesPerElement=8,Si("StructArrayLayout1ul2ui8",ao);class oo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}oo.prototype.bytesPerElement=4,Si("StructArrayLayout2ui4",oo);class so extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}so.prototype.bytesPerElement=2,Si("StructArrayLayout1ui2",so);class lo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t}}lo.prototype.bytesPerElement=16,Si("StructArrayLayout4f16",lo);class co extends Ra{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 o(this.anchorPointX,this.anchorPointY)}}co.prototype.size=20;class uo extends $a{get(t){return new co(this,t)}}Si("CollisionBoxArray",uo);class ho extends Ra{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]}}ho.prototype.size=48;class fo extends eo{get(t){return new ho(this,t)}}Si("PlacedSymbolArray",fo);class po extends Ra{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]}}po.prototype.size=64;class mo extends ro{get(t){return new po(this,t)}}Si("SymbolInstanceArray",mo);class go extends no{getoffsetX(t){return this.float32[1*t+0]}}Si("GlyphOffsetArray",go);class yo extends Ua{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Si("SymbolLineVertexArray",yo);class vo extends Ra{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]}}vo.prototype.size=12;class xo extends io{get(t){return new vo(this,t)}}Si("TextAnchorOffsetArray",xo);class _o extends Ra{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]}}_o.prototype.size=8;class bo extends ao{get(t){return new _o(this,t)}}Si("FeatureIndexArray",bo);class wo extends Na{}class To extends Na{}class ko extends Na{}class Ao extends qa{}class Mo extends Ha{}class So extends Ga{}class Eo extends Za{}class Co extends Wa{}class Io extends Ya{}class Lo extends Xa{}class Po extends Ka{}class zo extends Qa{}class Do extends to{}class Oo extends oo{}const Ro=ja([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fo}=Ro;class jo{constructor(t=[]){this.segments=t}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>jo.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${jo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>jo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,r,n){return new jo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function Bo(t,e){return 256*(t=b(Math.floor(t),0,255))+b(Math.floor(e),0,255)}jo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Si("SegmentVector",jo);const No=ja([{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 Uo={exports:{}},Vo={exports:function(t,e){var r,n,i,a,o,s,l,c;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,c=0;c>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}},qo={exports:function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}},Ho=Vo.exports,Go=qo.exports;Uo.exports=Ho,Uo.exports.murmur3=Ho,Uo.exports.murmur2=Go;var Zo=n(Uo.exports);class Wo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,r,n){this.ids.push(Yo(t)),this.positions.push(e,r,n)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=Yo(t);let r=0,n=this.ids.length-1;for(;r>1;this.ids[t]>=e?n=t:r=t+1}const i=[];for(;this.ids[r]===e;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(t,e){const r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Xo(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){const e=new Wo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Yo(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Zo(String(t))}function Xo(t,e,r,n){for(;r>1];let a=r-1,o=n+1;for(;;){do{a++}while(t[a]i);if(a>=o)break;$o(t,a,o),$o(e,3*a,3*o),$o(e,3*a+1,3*o+1),$o(e,3*a+2,3*o+2)}o-r`u_${t}`)),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return"color"===this.type?new ts(t,e):new Jo(t,e)}}class is{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)}getBinding(t,e,r){return"u_pattern"===r.substr(0,9)?new Qo(t,e):new Jo(t,e)}}class as{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,r,n,i){const a=this.paintVertexArray.length,o=this.expression.evaluate(new va(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)}_setPaintValue(t,e,r){if("color"===this.type){const n=rs(r);for(let r=t;r`u_${t}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(t,e,r,n,i){const a=this.expression.evaluate(new va(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new va(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)}_setPaintValue(t,e,r,n){if("color"===this.type){const i=rs(r),a=rs(n);for(let r=t;r`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof as||r instanceof os)for(let e=0;e!0){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new ls(n,e,r);this.needsUpload=!1,this._featureMap=new Wo,this._bufferOffset=0}populatePaintArrays(t,e,r,n,i,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(t,this._featureMap,e,i,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function us(t,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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function hs(t,e,r){const n={color:{source:Ga,composite:lo},number:{source:no,composite:Ga}},i={"line-pattern":{source:Eo,composite:Eo},"fill-pattern":{source:Eo,composite:Eo},"fill-extrusion-pattern":{source:Eo,composite:Eo}}[t];return i&&i[r]||n[e][r]}Si("ConstantBinder",ns),Si("CrossFadedConstantBinder",is),Si("SourceExpressionBinder",as),Si("CrossFadedCompositeBinder",ss),Si("CompositeExpressionBinder",os),Si("ProgramConfiguration",ls,{omit:["_buffers"]}),Si("ProgramConfigurationSet",cs);const fs=8192,ps=Math.pow(2,14)-1,ds=-ps-1;function ms(t){const e=fs/t.extent,r=t.loadGeometry();for(let t=0;tr.x+1||ar.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function gs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ms(t):[]}}function ys(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}class vs{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new To,this.indexArray=new Do,this.segments=new jo,this.programConfigurations=new cs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){const n=this.layers[0],i=[];let a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(const{feature:e,id:n,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=gs(e,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),c,r))continue;const u=o?a.evaluate(c,{},r):void 0,h={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ms(e),patterns:{},sortKey:u};i.push(h)}o&&i.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of i){const{geometry:i,index:a,sourceLayerIndex:o}=n,s=t[a].feature;this.addFeature(n,i,a,r),e.featureIndex.insert(s,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fo),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,e,r,n){for(const r of e)for(const e of r){const r=e.x,n=e.y;if(r<0||r>=fs||n<0||n>=fs)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=i.vertexLength;ys(this.layoutVertexArray,r,n,-1,-1),ys(this.layoutVertexArray,r,n,1,-1),ys(this.layoutVertexArray,r,n,1,1),ys(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)}}function xs(t,e){for(let r=0;r1){if(Ts(t,e))return!0;for(let n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Ss(t,e){let r,n,i,a=!1;for(let o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Es(t,e){let r=!1;for(let n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Cs(t,e,r){const n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;const a=I(t,e,r[0]);return a!==I(t,e,r[1])||a!==I(t,e,r[2])||a!==I(t,e,r[3])}function Is(t,e,r){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ls(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ps(t,e,r,n,i){if(!e[0]&&!e[1])return t;const a=o.convert(e)._mult(i);"viewport"===r&&a._rotate(-n);const s=[];for(let e=0;eHs(t,p)))),f=u?c*o:c;var p;for(const t of n)for(const e of t){const t=u?e:Hs(e,s);let r=f;const n=Vs([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),_s(h,t,r))return!0}return!1}}function Hs(t,e){const r=Vs([],[t.x,t.y,0,1],e);return new o(r[0]/r[3],r[1]/r[3])}class Gs extends vs{}let Zs;Si("HeatmapBucket",Gs,{omit:["layers"]});var Ws={get paint(){return Zs=Zs||new Pa({"heatmap-radius":new Ea(J.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ea(J.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Sa(J.paint_heatmap["heatmap-intensity"]),"heatmap-color":new La(J.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Sa(J.paint_heatmap["heatmap-opacity"])})}};function Ys(t,{width:e,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`)}else i=new Uint8Array(e*r*n);return t.width=e,t.height=r,t.data=i,t}function Xs(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;const i=Ys({},{width:e,height:r},n);$s(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function $s(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=a;const o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(let e=0,i=0;e80*r){s=1/0,l=1/0;let e=-1/0,n=-1/0;for(let a=r;ae&&(e=r),i>n&&(n=i)}c=Math.max(e-s,n-l),c=0!==c?32767/c:0}return ul(a,o,r,s,l,c,0),o}function ll(t,e,r,n,i){let a;if(i===function(t,e,r,n){let i=0;for(let a=e,o=r-n;a0)for(let i=e;i=e;i-=n)a=Cl(i/n|0,t[i],t[i+1],a);return a&&Tl(a,a.next)&&(Il(a),a=a.next),a}function cl(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!Tl(n,n.next)&&0!==wl(n.prev,n,n.next))n=n.next;else{if(Il(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function ul(t,e,r,n,i,a,o){if(!t)return;!o&&a&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=vl(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let a=null;for(e=0;i;){e++;let o=i,s=0;for(let t=0;t0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,a);let s=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?fl(t,n,i,a):hl(t))e.push(l.i,t.i,c.i),Il(t),t=c.next,s=c.next;else if((t=c)===s){o?1===o?ul(t=pl(cl(t),e),e,r,n,i,a,2):2===o&&dl(t,e,r,n,i,a):ul(cl(t),e,r,n,i,a,1);break}}}function hl(t){const e=t.prev,r=t,n=t.next;if(wl(e,r,n)>=0)return!1;const i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c;let d=n.next;for(;d!==e;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&_l(i,s,a,l,o,c,d.x,d.y)&&wl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function fl(t,e,r,n){const i=t.prev,a=t,o=t.next;if(wl(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,p=sl?s>c?s:c:l>c?l:c,g=u>h?u>f?u:f:h>f?h:f,y=vl(p,d,e,r,n),v=vl(m,g,e,r,n);let x=t.prevZ,_=t.nextZ;for(;x&&x.z>=y&&_&&_.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,f,x.x,x.y)&&wl(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&_l(s,u,l,h,c,f,_.x,_.y)&&wl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,f,x.x,x.y)&&wl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=v;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&_l(s,u,l,h,c,f,_.x,_.y)&&wl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function pl(t,e){let r=t;do{const n=r.prev,i=r.next.next;!Tl(n,i)&&kl(n,r,r.next,i)&&Sl(n,i)&&Sl(i,n)&&(e.push(n.i,r.i,i.i),Il(r),Il(r.next),r=t=i),r=r.next}while(r!==t);return cl(r)}function dl(t,e,r,n,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&bl(o,t)){let s=El(o,t);return o=cl(o,o.next),s=cl(s,s.next),ul(o,e,r,n,i,a,0),void ul(s,e,r,n,i,a,0)}t=t.next}o=o.next}while(o!==t)}function ml(t,e){return t.x-e.x}function gl(t,e){const r=function(t,e){let r=e;const n=t.x,i=t.y;let a,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>o&&(o=t,a=r.x=r.x&&r.x>=l&&n!==r.x&&_l(ia.x||r.x===a.x&&yl(a,r)))&&(a=r,u=e)}r=r.next}while(r!==s);return a}(t,e);if(!r)return e;const n=El(r,t);return cl(n,n.next),cl(r,r.next)}function yl(t,e){return wl(t.prev,t,e.prev)<0&&wl(e.next,t,t.next)<0}function vl(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function xl(t){let e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function bl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&kl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Sl(t,e)&&Sl(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(wl(t.prev,t,e.prev)||wl(t,e.prev,e))||Tl(t,e)&&wl(t.prev,t,t.next)>0&&wl(e.prev,e,e.next)>0)}function wl(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Tl(t,e){return t.x===e.x&&t.y===e.y}function kl(t,e,r,n){const i=Ml(wl(t,e,r)),a=Ml(wl(t,e,n)),o=Ml(wl(r,n,t)),s=Ml(wl(r,n,e));return i!==a&&o!==s||!(0!==i||!Al(t,r,e))||!(0!==a||!Al(t,n,e))||!(0!==o||!Al(r,t,n))||!(0!==s||!Al(r,e,n))}function Al(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ml(t){return t>0?1:t<0?-1:0}function Sl(t,e){return wl(t.prev,t,t.next)<0?wl(t,e,t.next)>=0&&wl(t,t.prev,e)>=0:wl(t,e,t.prev)<0||wl(t,t.next,e)<0}function El(t,e){const r=Ll(t.i,t.x,t.y),n=Ll(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Cl(t,e,r,n){const i=Ll(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Il(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ll(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Pl(t,e,r){const n=r.patternDependencies;let i=!1;for(const r of e){const e=r.paint.get(`${t}-pattern`);e.isConstant()||(i=!0);const a=e.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function zl(t,e,r,n,i){const a=i.patternDependencies;for(const o of e){const e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},r,{},i.availableImages),s=e.evaluate({zoom:n},r,{},i.availableImages),l=e.evaluate({zoom:n+1},r,{},i.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[t]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:t,mid:s,max:l}}}return r}class Dl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ko,this.indexArray=new Do,this.indexArray2=new Oo,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new jo,this.segments2=new jo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=Pl("fill",this.layers,e);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,u=gs(o,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;const h=i?n.evaluate(u,{},r,e.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:ms(o),patterns:{},sortKey:h};a.push(f)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of a){const{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){const t=zl("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ol),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,e,r,n,i){for(const t of kr(e,500)){let e=0;for(const r of t)e+=r.length;const r=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],a=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&a.push(i.length/2);const r=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),i.push(e[0].x),i.push(e[0].y);for(let t=1;t>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new ql(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},Gl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Gl.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Gl.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}$l.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Yl(this._pbf,e,this.extent,this._keys,this._values)};var Jl=Xl;function Ql(t,e,r){if(3===t){var n=new Jl(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Vl.VectorTile=function(t,e){this.layers=t.readFields(Ql,{},e)},Vl.VectorTileFeature=Hl,Vl.VectorTileLayer=Xl;const tc=Vl.VectorTileFeature.types,ec=Math.pow(2,13);function rc(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*ec)+o,i*ec*2,a*ec*2,Math.round(s))}class nc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ao,this.centroidVertexArray=new wo,this.indexArray=new Do,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new jo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.features=[],this.hasPattern=Pl("fill-extrusion",this.layers,e);for(const{feature:n,id:i,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,s=gs(n,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),s,r))continue;const l={id:i,sourceLayerIndex:o,index:a,geometry:t?s.geometry:ms(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(zl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,a,r,{}),e.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(t,e,r){for(const t of this.features){const{geometry:n}=t;this.addFeature(t,n,t.index,e,r)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ul),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Nl.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,e,r,n,i){for(const r of kr(e,500)){const e={x:0,y:0,vertexCount:0};let n=0;for(const t of r)n+=t.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const t of r){if(0===t.length)continue;if(ac(t))continue;let r=0;for(let n=0;n=1){const o=t[n-1];if(!ic(a,o)){i.vertexLength+4>jo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=a.sub(o)._perp()._unit(),n=o.dist(a);r+n>32768&&(r=0),rc(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,r),rc(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,r),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2,r+=n,rc(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,r),rc(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,1,r),e.x+=2*o.x,e.y+=2*o.y,e.vertexCount+=2;const s=i.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+n>jo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray)),"Polygon"!==tc[t.type])continue;const a=[],o=[],s=i.vertexLength;for(const t of r)if(0!==t.length){t!==r[0]&&o.push(a.length/2);for(let r=0;rfs)||t.y===e.y&&(t.y<0||t.y>fs)}function ac(t){return t.every((t=>t.x<0))||t.every((t=>t.x>fs))||t.every((t=>t.y<0))||t.every((t=>t.y>fs))}let oc;Si("FillExtrusionBucket",nc,{omit:["layers","features"]});var sc={get paint(){return oc=oc||new Pa({"fill-extrusion-opacity":new Sa(J["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ea(J["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Sa(J["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Sa(J["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ca(J["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ea(J["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ea(J["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Sa(J["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class lc extends Da{constructor(t){super(t,sc)}createBucket(t){return new nc(t)}queryRadius(){return Ls(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,r,n,i,a,s,l){const c=Ps(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),f=function(t,e){const r=[];for(const n of t){const t=[n.x,n.y,0,1];Vs(t,t,e),r.push(new o(t[0]/t[3],t[1]/t[3]))}return r}(c,l),p=function(t,e,r,n){const i=[],a=[],s=n[8]*e,l=n[9]*e,c=n[10]*e,u=n[11]*e,h=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r;for(const e of t){const t=[],r=[];for(const i of e){const e=i.x,a=i.y,m=n[0]*e+n[4]*a+n[12],g=n[1]*e+n[5]*a+n[13],y=n[2]*e+n[6]*a+n[14],v=n[3]*e+n[7]*a+n[15],x=y+c,_=v+u,b=m+h,w=g+f,T=y+p,k=v+d,A=new o((m+s)/_,(g+l)/_);A.z=x/_,t.push(A);const M=new o(b/k,w/k);M.z=T/k,r.push(M)}i.push(t),a.push(r)}return[i,a]}(n,h,u,l);return function(t,e,r){let n=1/0;bs(r,e)&&(n=uc(r,e[0]));for(let i=0;it.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Mo,this.layoutVertexArray2=new So,this.indexArray=new Do,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new jo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=Pl("line",this.layers,e);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(const{feature:e,id:o,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=gs(e,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),c,r))continue;const u=i?n.evaluate(c,{},r):void 0,h={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ms(e),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of a){const{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){const t=zl("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,dc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fc),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,e,r,n,i){const a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const r of e)this.addLine(r,t,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}addLine(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l0;if(b&&e>l){const t=h.dist(f);if(t>2*c){const e=h.sub(h.sub(f)._mult(c/t)._round());this.updateDistance(f,e),this.addCurrentVertex(e,d,0,0,u),f=e}}const T=f&&p;let k=T?r:o?"butt":n;if(T&&"round"===k&&(xi&&(k="bevel"),"bevel"===k&&(x>2&&(k="flipbevel"),x100)g=m.mult(-1);else{const t=x*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===k||"fakeround"===k){const t=-Math.sqrt(x*x-1),e=w?t:0,r=w?0:t;if(f&&this.addCurrentVertex(h,d,e,r,u),"fakeround"===k){const t=Math.round(180*_/Math.PI/20);for(let e=1;e2*c){const e=h.add(p.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}}}addCurrentVertex(t,e,r,n,i,a=!1){const o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>yc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,n,i,a))}addHalfVertex({x:t,y:e},r,n,i,a,o,s){const l=.5*(this.lineClips?this.scaledDistance*(yc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),a?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}let xc,_c;Si("LineBucket",vc,{omit:["layers","patternFeatures"]});var bc={get paint(){return _c=_c||new Pa({"line-opacity":new Ea(J.paint_line["line-opacity"]),"line-color":new Ea(J.paint_line["line-color"]),"line-translate":new Sa(J.paint_line["line-translate"]),"line-translate-anchor":new Sa(J.paint_line["line-translate-anchor"]),"line-width":new Ea(J.paint_line["line-width"]),"line-gap-width":new Ea(J.paint_line["line-gap-width"]),"line-offset":new Ea(J.paint_line["line-offset"]),"line-blur":new Ea(J.paint_line["line-blur"]),"line-dasharray":new Ia(J.paint_line["line-dasharray"]),"line-pattern":new Ca(J.paint_line["line-pattern"]),"line-gradient":new La(J.paint_line["line-gradient"])})},get layout(){return xc=xc||new Pa({"line-cap":new Sa(J.layout_line["line-cap"]),"line-join":new Ea(J.layout_line["line-join"]),"line-miter-limit":new Sa(J.layout_line["line-miter-limit"]),"line-round-limit":new Sa(J.layout_line["line-round-limit"]),"line-sort-key":new Ea(J.layout_line["line-sort-key"])})}};class wc extends Ea{possiblyEvaluate(t,e){return e=new va(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=T({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}let Tc;class kc extends Da{constructor(t){super(t,bc),this.gradientVersion=0,Tc||(Tc=new wc(bc.paint.properties["line-width"].specification),Tc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!(void 0===t._styleExpression)&&t._styleExpression.expression instanceof Ce,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Tc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new vc(t)}queryRadius(t){const e=t,r=Ac(Is("line-width",this,e),Is("line-gap-width",this,e)),n=Is("line-offset",this,e);return r/2+Math.abs(n)+Ls(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,a,s){const l=Ps(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*Ac(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){const r=[];for(let n=0;n=3)for(let e=0;e0?e+2*t:t}const Mc=ja([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Sc=ja([{name:"a_projected_pos",components:3,type:"Float32"}],4);ja([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ec=ja([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ja([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Cc=ja([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ic=ja([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Lc(t,e,r){return t.sections.forEach((t=>{t.text=function(t,e,r){const n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ya.applyArabicShaping&&(t=ya.applyArabicShaping(t)),t}(t.text,e,r)})),t}ja([{name:"triangle",components:3,type:"Uint16"}]),ja([{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"}]),ja([{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"}]),ja([{type:"Float32",name:"offsetX"}]),ja([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ja([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Pc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var zc=24,Dc=Fc,Oc=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Rc=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m};function Fc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Fc.Varint=0,Fc.Fixed64=1,Fc.Bytes=2,Fc.Fixed32=5;var jc=4294967296,Bc=1/jc,Nc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Uc(t){return t.type===Fc.Bytes?t.readVarint()+t.pos:t.pos+1}function Vc(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function qc(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Hc(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function eu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Fc.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Qc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=eu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Qc(this.buf,this.pos)+Qc(this.buf,this.pos+4)*jc;return this.pos+=8,t},readSFixed64:function(){var t=Qc(this.buf,this.pos)+eu(this.buf,this.pos+4)*jc;return this.pos+=8,t},readFloat:function(){var t=Oc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Oc(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return Vc(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return Vc(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t,e,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Nc?(t=this.buf,e=i,r=n,Nc.decode(t.subarray(e,r))):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Fc.Bytes)return t.push(this.readVarint(e));var r=Uc(this);for(t=t||[];this.pos127;);else if(e===Fc.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Fc.Fixed32)this.pos+=4;else{if(e!==Fc.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n,i,a;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=r,(a=e).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&qc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Rc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Rc(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&qc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Fc.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Hc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Gc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Yc,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Zc,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Wc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Xc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,$c,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Kc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Jc,e)},writeBytesField:function(t,e){this.writeTag(t,Fc.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Fc.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Fc.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Fc.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Fc.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Fc.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Fc.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Fc.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Fc.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Fc.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ru,nu=n(Dc);function iu(t,e,r){1===t&&r.readMessage(au,e)}function au(t,e,r){if(3===t){const{id:t,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(ou,{});e.push({id:t,bitmap:new Ks({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function ou(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function su(t){let e=0,r=0;for(const n of t)e+=n.w*n.h,r=Math.max(r,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let i=0,a=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const r=n[t];if(!(e.w>r.w||e.h>r.h)){if(e.x=r.x,e.y=r.y,a=Math.max(a,e.y+e.h),i=Math.max(i,e.x+e.w),e.w===r.w&&e.h===r.h){const e=n.pop();t=0&&r>=t&&du[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const r=new fu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(hu.forText(t.scale,t.fontStack||e));const r=this.sections.length-1;for(let e=0;e=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function pu(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){const g=fu.fromFeature(e,a);let y;f===t.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:x}=ya;if(v&&1===g.sections.length){y=[];const t=v(g.toString(),wu(g,u,o,r,i,d));for(const e of t){const t=new fu;t.text=e,t.sections=g.sections;for(let r=0;r0&&n>w&&(w=n)}else{const t=n[m.fontStack],e=t&&t[y];if(e&&e.rect)T=e.rect,_=e.metrics;else{const t=r[m.fontStack],e=t&&t[y];if(!e)continue;_=e.metrics}v=(a-m.scale)*zc}M?(e.verticalizable=!0,b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=A*m.scale+u):(b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=_.advance*m.scale+u)}0!==b.length&&(m=Math.max(p-u,m),ku(b,0,b.length-1,y,w)),p=0;const T=o*a+w;_.lineOffset=Math.max(w,l),d+=T,g=Math.max(T,g),++v}var x;const _=d-uu,{horizontalAlign:b,verticalAlign:w}=Tu(s);(function(t,e,r,n,i,a,o,s,l){const c=(e-r)*i;let u=0;u=a!==o?-s*n-uu:(-n*l+.5)*o;for(const e of t)for(const t of e.positionedGlyphs)t.x+=c,t.y+=u})(e.positionedLines,y,b,w,m,g,o,_,a.length),e.top+=-w*_,e.bottom=e.top+_,e.left+=-b*m,e.right=e.left+m}(b,r,n,i,y,s,l,c,f,u,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(_)&&b}const du={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},mu={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},gu={40:!0};function yu(t,e,r,n,i,a){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*zc/a+i:0}{const n=r[e.fontStack],a=n&&n[t];return a?a.metrics.advance*e.scale+i:0}}function vu(t,e,r,n){const i=Math.pow(t-e,2);return n?t=0;let c=0;for(let r=0;rc){const t=Math.ceil(a/c);i*=t/o,o=t}return{x1:n,y1:i,x2:n+a,y2:i+o}}function Su(t,e,r,n,i,a){const o=t.image;let s;if(o.content){const t=o.content,e=o.pixelRatio||1;s=[t[0]/e,t[1]/e,o.displaySize[0]-t[2]/e,o.displaySize[1]-t[3]/e]}const l=e.left*a,c=e.right*a;let u,h,f,p;"width"===r||"both"===r?(p=i[0]+l-n[3],h=i[0]+c+n[1]):(p=i[0]+(l+c-o.displaySize[0])/2,h=p+o.displaySize[0]);const d=e.top*a,m=e.bottom*a;return"height"===r||"both"===r?(u=i[1]+d-n[0],f=i[1]+m+n[2]):(u=i[1]+(d+m-o.displaySize[1])/2,f=u+o.displaySize[1]),{image:o,top:u,right:h,bottom:f,left:p,collisionPadding:s}}const Eu=128,Cu=32640;function Iu(t,e){const{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new va(t+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=r;let i=0;for(;it.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=js([]),this.placementViewportMatrix=js([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Iu(this.zoom,r["text-size"]),this.iconSizeData=Iu(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==Lu(n,"text-overlap","text-allow-overlap")||"never"!==Lu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((e=>t.ah[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Fu(new cs(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Fu(new cs(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new go,this.lineVertexArray=new yo,this.symbolInstances=new mo,this.textAnchorOffsets=new xo}calculateGlyphDependencies(t,e,r,n,i){for(let a=0;a0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const f=r.iconDependencies,p=r.glyphDependencies,d=r.availableImages,m=new va(this.zoom);for(const{feature:r,id:s,index:l,sourceLayerIndex:g}of e){const e=i._featureFilter.needGeometry,y=gs(r,e);if(!i._featureFilter.filter(m,y,n))continue;let v,x;if(e||(y.geometry=ms(r)),c){const t=i.getValueAndResolveTokens("text-field",y,n,d),e=re.factory(t),r=this.hasRTLText=this.hasRTLText||Ru(e);(!r||"unavailable"===ya.getRTLTextPluginStatus()||r&&ya.isParsed())&&(v=Lc(e,i,y))}if(u){const t=i.getValueAndResolveTokens("icon-image",y,n,d);x=t instanceof oe?t:oe.fromString(t)}if(!v&&!x)continue;const _=this.sortFeaturesByKey?h.evaluate(y,{},n):void 0;if(this.features.push({id:s,text:v,icon:x,index:l,sourceLayerIndex:g,geometry:y.geometry,properties:r.properties,type:Pu[r.type],sortKey:_}),x&&(f[x.name]=!0),v){const e=o.evaluate(y,{},n).join(","),r="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(const t of v.sections)if(t.image)f[t.image.name]=!0;else{const n=aa(v.toString()),i=t.fontStack||e,a=p[i]=p[i]||{};this.calculateGlyphDependencies(t.text,a,r,this.allowVerticalPlacement,n)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){const e={},r={},n=[];let i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){const a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){const a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){const n=r?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;ct.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!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,e){const r=this.lineVertexArray.length;if(void 0!==t.segment){let r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]);const i={};for(let n=t.segment+1;n=0;r--)i[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=e[r-1].dist(e[r]));for(let t=0;t0}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,e){const r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let e=r.vertexStartIndex;en[t]-n[e]||i[e]-i[t])),a}addToSortKeyRanges(t,e){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,r)=>{t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Nu,Uu;Si("SymbolBucket",Bu,{omit:["layers","collisionBoxArray","features","compareText"]}),Bu.MAX_GLYPHS=65535,Bu.addDynamicAttributes=Ou;var Vu={get paint(){return Uu=Uu||new Pa({"icon-opacity":new Ea(J.paint_symbol["icon-opacity"]),"icon-color":new Ea(J.paint_symbol["icon-color"]),"icon-halo-color":new Ea(J.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ea(J.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ea(J.paint_symbol["icon-halo-blur"]),"icon-translate":new Sa(J.paint_symbol["icon-translate"]),"icon-translate-anchor":new Sa(J.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ea(J.paint_symbol["text-opacity"]),"text-color":new Ea(J.paint_symbol["text-color"],{runtimeType:vt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ea(J.paint_symbol["text-halo-color"]),"text-halo-width":new Ea(J.paint_symbol["text-halo-width"]),"text-halo-blur":new Ea(J.paint_symbol["text-halo-blur"]),"text-translate":new Sa(J.paint_symbol["text-translate"]),"text-translate-anchor":new Sa(J.paint_symbol["text-translate-anchor"])})},get layout(){return Nu=Nu||new Pa({"symbol-placement":new Sa(J.layout_symbol["symbol-placement"]),"symbol-spacing":new Sa(J.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Sa(J.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ea(J.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Sa(J.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Sa(J.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Sa(J.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Sa(J.layout_symbol["icon-ignore-placement"]),"icon-optional":new Sa(J.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Sa(J.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ea(J.layout_symbol["icon-size"]),"icon-text-fit":new Sa(J.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Sa(J.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ea(J.layout_symbol["icon-image"]),"icon-rotate":new Ea(J.layout_symbol["icon-rotate"]),"icon-padding":new Ea(J.layout_symbol["icon-padding"]),"icon-keep-upright":new Sa(J.layout_symbol["icon-keep-upright"]),"icon-offset":new Ea(J.layout_symbol["icon-offset"]),"icon-anchor":new Ea(J.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Sa(J.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Sa(J.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Sa(J.layout_symbol["text-rotation-alignment"]),"text-field":new Ea(J.layout_symbol["text-field"]),"text-font":new Ea(J.layout_symbol["text-font"]),"text-size":new Ea(J.layout_symbol["text-size"]),"text-max-width":new Ea(J.layout_symbol["text-max-width"]),"text-line-height":new Sa(J.layout_symbol["text-line-height"]),"text-letter-spacing":new Ea(J.layout_symbol["text-letter-spacing"]),"text-justify":new Ea(J.layout_symbol["text-justify"]),"text-radial-offset":new Ea(J.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Sa(J.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ea(J.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ea(J.layout_symbol["text-anchor"]),"text-max-angle":new Sa(J.layout_symbol["text-max-angle"]),"text-writing-mode":new Sa(J.layout_symbol["text-writing-mode"]),"text-rotate":new Ea(J.layout_symbol["text-rotate"]),"text-padding":new Sa(J.layout_symbol["text-padding"]),"text-keep-upright":new Sa(J.layout_symbol["text-keep-upright"]),"text-transform":new Ea(J.layout_symbol["text-transform"]),"text-offset":new Ea(J.layout_symbol["text-offset"]),"text-allow-overlap":new Sa(J.layout_symbol["text-allow-overlap"]),"text-overlap":new Sa(J.layout_symbol["text-overlap"]),"text-ignore-placement":new Sa(J.layout_symbol["text-ignore-placement"]),"text-optional":new Sa(J.layout_symbol["text-optional"])})}};class qu{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.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}}Si("FormatSectionOverride",qu,{omit:["defaultValue"]});class Hu extends Da{constructor(t){super(t,Vu)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const r of t)e.indexOf(r)<0&&e.push(r);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,r,n){const i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||An(a.value)||!i?i:(o=e.properties,i.replace(/{([^{}]+)}/g,((t,e)=>o&&e in o?String(o[e]):"")));var o}createBucket(t){return new Bu(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Vu.paint.overridableProperties){if(!Hu.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),r=new qu(e),n=new kn(r,e.property.specification);let i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Sn("source",n):new En("composite",n,e.value.zoomStops),this.paint._values[t]=new Aa(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&Hu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const r=t.get("text-field"),n=Vu.paint.properties[e];let i=!1;const a=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof re)a(r.value.value.sections);else if("source"===r.value.kind){const t=e=>{i||(e instanceof he&&ce(e.value)===wt?a(e.value.sections):e instanceof Ke?a(e.sections):e.eachChild(t))},e=r.value;e._styleExpression&&t(e._styleExpression.expression)}return i}}let Gu;var Zu={get paint(){return Gu=Gu||new Pa({"background-color":new Sa(J.paint_background["background-color"]),"background-pattern":new Ia(J.paint_background["background-pattern"]),"background-opacity":new Sa(J.paint_background["background-opacity"])})}};class Wu extends Da{constructor(t){super(t,Zu)}}let Yu;var Xu={get paint(){return Yu=Yu||new Pa({"raster-opacity":new Sa(J.paint_raster["raster-opacity"]),"raster-hue-rotate":new Sa(J.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Sa(J.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Sa(J.paint_raster["raster-brightness-max"]),"raster-saturation":new Sa(J.paint_raster["raster-saturation"]),"raster-contrast":new Sa(J.paint_raster["raster-contrast"]),"raster-resampling":new Sa(J.paint_raster["raster-resampling"]),"raster-fade-duration":new Sa(J.paint_raster["raster-fade-duration"])})}};class $u extends Da{constructor(t){super(t,Xu)}}class Ku extends Da{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Ju{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(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=()=>{}}}const Qu=6371008.8;class th{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new th(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Qu*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof th)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new th(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new th(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 [, ]")}}const eh=2*Math.PI*Qu;function rh(t){return eh*Math.cos(t*Math.PI/180)}function nh(t){return(180+t)/360}function ih(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ah(t,e){return t/rh(e)}function oh(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class sh{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r}static fromLngLat(t,e=0){const r=th.convert(t);return new sh(nh(r.lng),ih(r.lat),ah(e,r.lat))}toLngLat(){return new th(360*this.x-180,oh(this.y))}toAltitude(){return this.z*rh(oh(this.y))}meterInMercatorCoordinateUnits(){return 1/eh*(t=oh(this.y),1/Math.cos(t*Math.PI/180));var t}}function lh(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ch{constructor(t,e,r){if(i=e,a=r,(n=t)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);var n,i,a;this.z=t,this.x=e,this.y=r,this.key=fh(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){const n=(a=this.y,o=this.z,s=lh(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=lh(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;const c=function(t,e,r){let n,i="";for(let a=t;a>0;a--)n=1<1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new o((t.x*e-this.x)*fs,(t.y*e-this.y)*fs)}toString(){return`${this.z}/${this.x}/${this.y}`}}class uh{constructor(t,e){this.wrap=t,this.canonical=e,this.key=fh(t,e.z,e.z,e.x,e.y)}}class hh{constructor(t,e,r,n,i){if(t= z; overscaledZ = ${t}; z = ${r}`);this.overscaledZ=t,this.wrap=e,this.canonical=new ch(r,+n,+i),this.key=fh(e,t,r,n,i)}clone(){return new hh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new hh(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new hh(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?fh(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):fh(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new hh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new hh(e,this.wrap,e,r,n),new hh(e,this.wrap,e,r+1,n),new hh(e,this.wrap,e,r,n+1),new hh(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=r),r=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,r){return t*this.redFactor+e*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Js({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}const s=-e*this.dim,l=-r*this.dim;for(let e=a;e=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 mh{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class gh{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ai(fs,16,0),this.grid3D=new Ai(fs,16,0),this.featureIndexArray=new bo,this.promoteId=e}insert(t,e,r,n,i,a){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const s=a?this.grid3D:this.grid;for(let t=0;t=0&&n[3]>=0&&s.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Vl.VectorTile(new nu(this.rawTileData)).layers,this.sourceLayerCoder=new dh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();const i=t.params||{},a=fs/t.tileSize/t.scale,s=Dn(i.filter),l=t.queryGeometry,c=t.queryPadding*a,u=vh(l),h=this.grid.query(u.minX-c,u.minY-c,u.maxX+c,u.maxY+c),f=vh(t.cameraQueryGeometry),p=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,((e,r,n,i)=>function(t,e,r,n,i){for(const a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;const a=[new o(e,r),new o(e,i),new o(n,i),new o(n,r)];if(t.length>2)for(const e of a)if(Es(t,e))return!0;for(let e=0;e(f||(f=ms(e)),r.queryIntersectsFeature(l,e,n,f,this.z,t.transform,a,t.pixelPosMatrix))))}return d}loadMatchingFeature(t,e,r,n,i,a,o,s,l,c,u){const h=this.bucketLayerIDs[e];if(a&&!function(t,e){for(let r=0;r=0)return!0;return!1}(a,h))return;const f=this.sourceLayerCoder.decode(r),p=this.vtLayers[f].feature(n);if(i.needGeometry){const t=gs(p,!0);if(!i.filter(new va(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new va(this.tileID.overscaledZ),p))return;const d=this.getId(p,f);for(let e=0;e{const o=e instanceof Ma?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function vh(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:e,minY:r,maxX:n,maxY:i}}function xh(t,e){return e-t}function _h(t,e,r,n,i){const a=[];for(let s=0;s=n&&u.x>=n||(s.x>=n?s=new o(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x>=n&&(u=new o(n,s.y+(n-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y>=i&&u.y>=i||(s.y>=i?s=new o(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round():u.y>=i&&(u=new o(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round()),c&&s.equals(c[c.length-1])||(c=[s],a.push(c)),c.push(u)))))}}return a}Si("FeatureIndex",gh,{omit:["rawTileData","sourceLayerCoder"]});class bh extends o{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new bh(this.x,this.y,this.angle,this.segment)}}function wh(t,e,r,n,i){if(void 0===e.segment||0===r)return!0;let a=e,o=e.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;const l=[];let c=0;for(;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=e.dist(r)}return!0}function Th(t){let e=0;for(let r=0;rc){const u=(c-l)/a,h=Re.number(n.x,i.x,u),f=Re.number(n.y,i.y,u),p=new bh(h,f,i.angleTo(n),r);return p._round(),!o||wh(t,p,s,o,e)?p:void 0}l+=a}}function Sh(t,e,r,n,i,a,o,s,l){const c=kh(n,a,o),u=Ah(n,i),h=u*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&y=0&&v=0&&f+c<=u){const r=new bh(y,v,m,e);r._round(),n&&!wh(t,r,a,n,i)||p.push(r)}}h+=d}return s||p.length||o||(p=Eh(t,h/2,r,n,i,a,o,!0,l)),p}function Ch(t,e,r,n){const i=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,c=a.paddedRect.h-2;let u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const h=a.stretchX||[[0,l]],f=a.stretchY||[[0,c]],p=(t,e)=>t+e[1]-e[0],d=h.reduce(p,0),m=f.reduce(p,0),g=l-d,y=c-m;let v=0,x=d,_=0,b=m,w=0,T=g,k=0,A=y;if(a.content&&n){const e=a.content,r=e[2]-e[0],n=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(u=Mu(t)),v=Ih(h,0,e[0]),_=Ih(f,0,e[1]),x=Ih(h,e[0],e[2]),b=Ih(f,e[1],e[3]),w=e[0]-v,k=e[1]-_,T=r-x,A=n-b}const M=u.x1,S=u.y1,E=u.x2-M,C=u.y2-S,I=(t,n,i,l)=>{const c=Ph(t.stretch-v,x,E,M),u=zh(t.fixed-w,T,t.stretch,d),h=Ph(n.stretch-_,b,C,S),f=zh(n.fixed-k,A,n.stretch,m),p=Ph(i.stretch-v,x,E,M),g=zh(i.fixed-w,T,i.stretch,d),y=Ph(l.stretch-_,b,C,S),I=zh(l.fixed-k,A,l.stretch,m),L=new o(c,h),P=new o(p,h),z=new o(p,y),D=new o(c,y),O=new o(u/s,f/s),R=new o(g/s,I/s),F=e*Math.PI/180;if(F){const t=Math.sin(F),e=Math.cos(F),r=[e,-t,t,e];L._matMult(r),P._matMult(r),D._matMult(r),z._matMult(r)}const j=t.stretch+t.fixed,B=n.stretch+n.fixed;return{tl:L,tr:P,bl:D,br:z,tex:{x:a.paddedRect.x+1+j,y:a.paddedRect.y+1+B,w:i.stretch+i.fixed-j,h:l.stretch+l.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/s/E,minFontScaleY:A/s/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const t=Lh(h,g,d),e=Lh(f,y,m);for(let r=0;r0&&(n=Math.max(10,n),this.circleDiameter=n)}else{const c=(null===(h=a.image)||void 0===h?void 0:h.content)&&(a.image.textFitWidth||a.image.textFitHeight)?Mu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-l[0],c.y2=c.y2*s+l[2],c.x1=c.x1*s-l[3],c.x2=c.x2*s+l[1];const f=a.collisionPadding;if(f&&(c.x1-=f[0]*s,c.y1-=f[1]*s,c.x2+=f[2]*s,c.y2+=f[3]*s),u){const t=new o(c.x1,c.y1),e=new o(c.x2,c.y1),r=new o(c.x1,c.y2),n=new o(c.x2,c.y2),i=u*Math.PI/180;t._rotate(i),e._rotate(i),r._rotate(i),n._rotate(i),c.x1=Math.min(t.x,e.x,r.x,n.x),c.x2=Math.max(t.x,e.x,r.x,n.x),c.y1=Math.min(t.y,e.y,r.y,n.y),c.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,n,i)}this.boxEndIndex=t.length}}class Oh{constructor(t=[],e=(t,e)=>te?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=e[n],t=n}e[t]=i}}function Rh(t,e=1,r=!1){let n=1/0,i=1/0,a=-1/0,s=-1/0;const l=t[0];for(let t=0;ta)&&(a=e.x),(!t||e.y>s)&&(s=e.y)}const c=Math.min(a-n,s-i);let u=c/2;const h=new Oh([],Fh);if(0===c)return new o(n,i);for(let e=n;ef.d||!f.d)&&(f=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-f.d<=e||(u=n.h/2,h.push(new jh(n.p.x-u,n.p.y-u,u,t)),h.push(new jh(n.p.x+u,n.p.y-u,u,t)),h.push(new jh(n.p.x-u,n.p.y+u,u,t)),h.push(new jh(n.p.x+u,n.p.y+u,u,t)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${f.d}`)),f.p}function Fh(t,e){return e.max-t.max}function jh(t,e,r,n){this.p=new o(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;it.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,Ms(t,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Bh;t.aq=void 0,(Bh=t.aq||(t.aq={}))[Bh.center=1]="center",Bh[Bh.left=2]="left",Bh[Bh.right=3]="right",Bh[Bh.top=4]="top",Bh[Bh.bottom=5]="bottom",Bh[Bh["top-left"]=6]="top-left",Bh[Bh["top-right"]=7]="top-right",Bh[Bh["bottom-left"]=8]="bottom-left",Bh[Bh["bottom-right"]=9]="bottom-right";const Nh=Number.POSITIVE_INFINITY;function Uh(t,e){return e[1]!==Nh?function(t,e,r){let n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){let r=0,n=0;e<0&&(e=0);const i=e/Math.SQRT2;switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Vh(t,e,r){var n;const i=t.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(e,{},r);if(a){const t=a.values,e=[];for(let r=0;rt*zc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),e[r+1]=i}return new ae(e)}const o=i.get("text-variable-anchor");if(o){let n;n=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(e,{},r)*zc,Nh]:i.get("text-offset").evaluate(e,{},r).map((t=>t*zc));const a=[];for(const t of o)a.push(t,Uh(t,n));return new ae(a)}return null}function qh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Hh(e,r,n,i,a,o,s,l,c,u,h){let f=o.textMaxSize.evaluate(r,{});void 0===f&&(f=s);const p=e.layers[0].layout,d=p.get("icon-offset").evaluate(r,{},h),m=Zh(n.horizontal),g=s/24,y=e.tilePixelRatio*g,v=e.tilePixelRatio*f/24,x=e.tilePixelRatio*l,_=e.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*e.tilePixelRatio,w=function(t,e,r,n=1){const i=t.get("icon-padding").evaluate(e,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(p,r,h,e.tilePixelRatio),T=p.get("text-max-angle")/180*Math.PI,k="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),A="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),M=p.get("symbol-placement"),S=_/2,E=p.get("icon-text-fit");let I;i&&"none"!==E&&(e.allowVerticalPlacement&&n.vertical&&(I=Su(i,n.vertical,E,p.get("icon-text-fit-padding"),d,g)),m&&(i=Su(i,m,E,p.get("icon-text-fit-padding"),d,g)));const L=(l,f)=>{f.x<0||f.x>=fs||f.y<0||f.y>=fs||function(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A){const M=e.addToLineVertexArray(r,n);let S,E,I,L,P=0,z=0,D=0,O=0,R=-1,F=-1;const j={};let B=Zo("");if(e.allowVerticalPlacement&&i.vertical){const t=l.layout.get("text-rotate").evaluate(b,{},k)+90;I=new Dh(c,r,u,h,f,i.vertical,p,d,m,t),s&&(L=new Dh(c,r,u,h,f,s,y,v,m,t))}if(a){const n=l.layout.get("icon-rotate").evaluate(b,{}),i="none"!==l.layout.get("icon-text-fit"),o=Ch(a,n,T,i),p=s?Ch(s,n,T,i):void 0;E=new Dh(c,r,u,h,f,a,y,v,!1,n),P=4*o.length;const d=e.iconSizeData;let m=null;"source"===d.kind?(m=[Eu*l.layout.get("icon-size").evaluate(b,{})],m[0]>Cu&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(m=[Eu*w.compositeIconSizes[0].evaluate(b,{},k),Eu*w.compositeIconSizes[1].evaluate(b,{},k)],(m[0]>Cu||m[1]>Cu)&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,m,_,x,b,t.ah.none,r,M.lineStartIndex,M.lineLength,-1,k),R=e.icon.placedSymbolArray.length-1,p&&(z=4*p.length,e.addSymbols(e.icon,p,m,_,x,b,t.ah.vertical,r,M.lineStartIndex,M.lineLength,-1,k),F=e.icon.placedSymbolArray.length-1)}const N=Object.keys(i.horizontal);for(const n of N){const a=i.horizontal[n];if(!S){B=Zo(a.text);const t=l.layout.get("text-rotate").evaluate(b,{},k);S=new Dh(c,r,u,h,f,a,p,d,m,t)}const s=1===a.positionedLines.length;if(D+=Gh(e,r,a,o,l,m,b,g,M,i.vertical?t.ah.horizontal:t.ah.horizontalOnly,s?N:[n],j,R,w,k),s)break}i.vertical&&(O+=Gh(e,r,i.vertical,o,l,m,b,g,M,t.ah.vertical,["vertical"],j,F,w,k));const U=S?S.boxStartIndex:e.collisionBoxArray.length,V=S?S.boxEndIndex:e.collisionBoxArray.length,q=I?I.boxStartIndex:e.collisionBoxArray.length,H=I?I.boxEndIndex:e.collisionBoxArray.length,G=E?E.boxStartIndex:e.collisionBoxArray.length,Z=E?E.boxEndIndex:e.collisionBoxArray.length,W=L?L.boxStartIndex:e.collisionBoxArray.length,Y=L?L.boxEndIndex:e.collisionBoxArray.length;let X=-1;const $=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;X=$(S,X),X=$(I,X),X=$(E,X),X=$(L,X);const K=X>-1?1:0;K&&(X*=A/zc),e.glyphOffsetArray.length>=Bu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);const J=Vh(l,b,k),[Q,tt]=function(e,r){const n=e.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let r=0;r=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical||-1,R,F,B,U,V,q,H,G,Z,W,Y,u,D,O,P,z,K,0,p,X,Q,tt)}(e,f,l,n,i,a,I,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,y,[b,b,b,b],k,c,x,w,A,d,r,o,u,h,s)};if("line"===M)for(const t of _h(r.geometry,0,0,fs,fs)){const r=Sh(t,_,T,n.vertical||m,i,24,v,e.overscaling,fs);for(const n of r)m&&Wh(e,m.text,S,n)||L(t,n)}else if("line-center"===M){for(const t of r.geometry)if(t.length>1){const e=Mh(t,T,n.vertical||m,i,24,v);e&&L(t,e)}}else if("Polygon"===r.type)for(const t of kr(r.geometry,0)){const e=Rh(t,16);L(t[0],new bh(e.x,e.y,0))}else if("LineString"===r.type)for(const t of r.geometry)L(t,new bh(t[0].x,t[0].y,0));else if("Point"===r.type)for(const t of r.geometry)for(const e of t)L([e],new bh(e.x,e.y,0))}function Gh(t,e,r,n,i,a,s,l,c,u,h,f,p,d,m){const g=function(t,e,r,n,i,a,s,l){const c=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(const t of e.positionedLines)for(const n of t.positionedGlyphs){if(!n.rect)continue;const a=n.rect||{};let h=4,f=!0,p=1,d=0;const m=(i||l)&&n.vertical,g=n.metrics.advance*n.scale/2;if(l&&e.verticalizable&&(d=t.lineOffset/2-(n.imageName?-(zc-n.metrics.width*n.scale)/2:(n.scale-1)*zc)),n.imageName){const t=s[n.imageName];f=t.sdf,p=t.pixelRatio,h=1/p}const y=i?[n.x+g,n.y]:[0,0];let v=i?[0,0]:[n.x+g+r[0],n.y+r[1]-d],x=[0,0];m&&(x=v,v=[0,0]);const _=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-h)*n.scale-g+v[0],w=(-n.metrics.top-h)*n.scale+v[1],T=b+a.w/_*n.scale/p,k=w+a.h/_*n.scale/p,A=new o(b,w),M=new o(T,w),S=new o(b,k),E=new o(T,k);if(m){const t=new o(-g,g-uu),e=-Math.PI/2,r=12-g,i=new o(22-r,-(n.imageName?r:0)),a=new o(...x);A._rotateAround(e,t)._add(i)._add(a),M._rotateAround(e,t)._add(i)._add(a),S._rotateAround(e,t)._add(i)._add(a),E._rotateAround(e,t)._add(i)._add(a)}if(c){const t=Math.sin(c),e=Math.cos(c),r=[e,-t,t,e];A._matMult(r),M._matMult(r),S._matMult(r),E._matMult(r)}const C=new o(0,0),I=new o(0,0);u.push({tl:A,tr:M,bl:S,br:E,tex:a,writingMode:e.writingMode,glyphOffset:y,sectionIndex:n.sectionIndex,isSDF:f,pixelOffsetTL:C,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,l,i,a,s,n,t.allowVerticalPlacement),y=t.textSizeData;let v=null;"source"===y.kind?(v=[Eu*i.layout.get("text-size").evaluate(s,{})],v[0]>Cu&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Eu*d.compositeTextSizes[0].evaluate(s,{},m),Eu*d.compositeTextSizes[1].evaluate(s,{},m)],(v[0]>Cu||v[1]>Cu)&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,v,l,a,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(const e of h)f[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function Zh(t){for(const e in t)return t[e];return null}function Wh(t,e,r,n){const i=t.compareText;if(e in i){const t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=Yh[15&r];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new Xh(o,a,i,t)}constructor(t,e=64,r=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Yh.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return $h(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){const s=a[2*o],c=a[2*o+1];s>=t&&s<=r&&c>=e&&c<=n&&l.push(i[o])}continue}const f=h+u>>1,p=a[2*f],d=a[2*f+1];p>=t&&p<=r&&d>=e&&d<=n&&l.push(i[f]),(0===c?t<=p:e<=d)&&(s.push(h),s.push(f-1),s.push(1-c)),(0===c?r>=p:n>=d)&&(s.push(f+1),s.push(u),s.push(1-c))}return l}within(t,e,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){const c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)tf(i[2*r],i[2*r+1],t,e)<=l&&s.push(n[r]);continue}const f=h+u>>1,p=i[2*f],d=i[2*f+1];tf(p,d,t,e)<=l&&s.push(n[f]),(0===c?t-r<=p:e-r<=d)&&(o.push(h),o.push(f-1),o.push(1-c)),(0===c?t+r>=p:e+r>=d)&&(o.push(f+1),o.push(u),o.push(1-c))}return s}}function $h(t,e,r,n,i,a){if(i-n<=r)return;const o=n+i>>1;Kh(t,e,o,n,i,a),$h(t,e,r,n,o-1,1-a),$h(t,e,r,o+1,i,1-a)}function Kh(t,e,r,n,i,a){for(;i>n;){if(i-n>600){const o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);Kh(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}const o=e[2*r+a];let s=n,l=i;for(Jh(t,e,n,r),e[2*i+a]>o&&Jh(t,e,n,i);so;)l--}e[2*n+a]===o?Jh(t,e,n,l):(l++,Jh(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Jh(t,e,r,n){Qh(t,r,n),Qh(e,2*r,2*n),Qh(e,2*r+1,2*n+1)}function Qh(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tf(t,e,r,n){const i=t-r,a=e-n;return i*i+a*a}var ef;t.bg=void 0,(ef=t.bg||(t.bg={})).create="create",ef.load="load",ef.fullLoad="fullLoad";let rf=null,nf=[];const af=1e3/60,of="loadTime",sf="fullLoadTime",lf={mark(t){performance.mark(t)},frame(t){const e=t;null!=rf&&nf.push(e-rf),rf=e},clearMetrics(){rf=null,nf=[],performance.clearMeasures(of),performance.clearMeasures(sf);for(const e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(of,t.bg.create,t.bg.load),performance.measure(sf,t.bg.create,t.bg.fullLoad);const e=performance.getEntriesByName(of)[0].duration,r=performance.getEntriesByName(sf)[0].duration,n=nf.length,i=1/(nf.reduce(((t,e)=>t+e),0)/n/1e3),a=nf.filter((t=>t>af)).reduce(((t,e)=>t+(e-af)/af),0);return{loadTime:e,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};t.$=class extends Va{},t.A=Fs,t.B=bi,t.C=function(t){if(null==P){const e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P},t.D=Sa,t.E=K,t.F=class{constructor(t,e){var r,n,i;this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Ju((()=>this.process())),this.subscription=(r=this.target,n="message",i=t=>this.receive(t),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=L(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise(((r,n)=>{const i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},e&&e.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];const e={id:i,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),{once:!0});const a=[],o=Object.assign(Object.assign({},t),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Li(t.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(t){const e=t.data,r=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(""===e.type){delete this.tasks[r];const t=this.abortControllers[r];return delete this.abortControllers[r],void(t&&t.abort())}if(L(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return r(this,void 0,void 0,(function*(){if(""===e.type){const r=this.resolveRejects[t];if(delete this.resolveRejects[t],!r)return;return void(e.error?r.reject(Pi(e.error)):r.resolve(Pi(e.data)))}if(!this.messageHandlers[e.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=Pi(e.data),n=new AbortController;this.abortControllers[t]=n;try{const i=yield this.messageHandlers[e.type](e.sourceMapId,r,n);this.completeTask(t,null,i)}catch(e){this.completeTask(t,e)}}))}completeTask(t,e,r){const n=[];delete this.abortControllers[t];const i={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Li(e):null,data:Li(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=V,t.H=function(){var t=new Fs(16);return Fs!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=lu,t.J=function(t,e,r){var n,i,a,o,s,l,c,u,h,f,p,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+f*y+e[13],t[14]=a*m+c*g+p*y+e[14],t[15]=o*m+u*g+d*y+e[15]),t},t.K=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=Bs,t.M=function(t,e){const r={};for(let n=0;n{const e=window.document.createElement("video");return e.muted=!0,new Promise((r=>{e.onloadstart=()=>{r(e)};for(const r of t){const t=window.document.createElement("source");Z(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}}))},t.a4=function(){return k++},t.a5=uo,t.a6=Bu,t.a7=Dn,t.a8=gs,t.a9=mh,t.aA=function(t){if("custom"===t.type)return new Ku(t);switch(t.type){case"background":return new Wu(t);case"circle":return new qs(t);case"fill":return new jl(t);case"fill-extrusion":return new lc(t);case"heatmap":return new el(t);case"hillshade":return new il(t);case"line":return new kc(t);case"raster":return new $u(t);case"symbol":return new Hu(t)}},t.aB=S,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let r=[];try{if(!et(t.version,e.version))return[{command:"setStyle",args:[e]}];et(t.center,e.center)||r.push({command:"setCenter",args:[e.center]}),et(t.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),et(t.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),et(t.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),et(t.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),et(t.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),et(t.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),et(t.light,e.light)||r.push({command:"setLight",args:[e.light]}),et(t.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),et(t.sky,e.sky)||r.push({command:"setSky",args:[e.sky]}),et(t.projection,e.projection)||r.push({command:"setProjection",args:[e.projection]});const n={},i=[];!function(t,e,r,n){let i;for(i in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)||it(i,r,n));for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)?et(t[i],e[i])||("geojson"===t[i].type&&"geojson"===e[i].type&&ot(t,e,i)?rt(r,{command:"setGeoJSONSourceData",args:[i,e[i].data]}):at(i,e,r,n)):nt(i,e,r))}(t.sources,e.sources,i,n);const a=[];t.layers&&t.layers.forEach((t=>{"source"in t&&n[t.source]?r.push({command:"removeLayer",args:[t.id]}):a.push(t)})),r=r.concat(i),function(t,e,r){e=e||[];const n=(t=t||[]).map(lt),i=e.map(lt),a=t.reduce(ct,{}),o=e.reduce(ct,{}),s=n.slice(),l=Object.create(null);let c,u,h,f,p;for(let t=0,e=0;t@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{const a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){const r=[];for(const n in t)n in e||r.push(n);return r},t.ac=b,t.ad=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},t.ae=function(t){var e=new Fs(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=Vs,t.ag=function(t,e){let r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:i,minZoom:a,maxZoom:o}=t,s=i?b(Fe.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=Re.number(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}},t.ai=function(t,{uSize:e,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===t.kind?n/Eu:"composite"===t.kind?Re.number(n/Eu,i/Eu,r):e},t.aj=Ou,t.ak=function(t,e,r,n){const i=e.y-t.y,a=e.x-t.x,s=n.y-r.y,l=n.x-r.x,c=s*a-l*i;if(0===c)return null;const u=(l*(t.y-r.y)-s*(t.x-r.x))/c;return new o(t.x+u*a,t.y+u*i)},t.al=_h,t.am=xs,t.an=js,t.ao=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[e,r,n,i]},t.ap=zc,t.ar=Lu,t.as=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*m-h*d,A=u*g-f*d,M=u*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(t[0]=(s*C-l*E+c*S)*(I=1/I),t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(f*w-h*T-p*b)*I,t[4]=(l*M-o*C-c*A)*I,t[5]=(r*C-i*M+a*A)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-f*_+p*x)*I,t[8]=(o*E-s*M+c*k)*I,t[9]=(n*M-r*E-a*k)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-p*v)*I,t[12]=(s*A-o*S-l*k)*I,t[13]=(r*S-n*A+i*k)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*b-h*x+f*v)*I,t):null},t.at=qh,t.au=Tu,t.av=Xh,t.aw=function(){const t={},e=J.$version;for(const r in J.$root){const n=J.$root[r];if(n.required){let i=null;i="version"===r?e:"array"===n.type?[]:{},null!=i&&(t[r]=i)}}return t},t.ax=zi,t.ay=H,t.az=function(t){t=t.slice();const e=Object.create(null);for(let r=0;r25||n<0||n>=1||r<0||r>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends Ua{},t.be=Qu,t.bf=lf,t.bh=q,t.bi=function(t,e){N.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete N.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){const r={};for(let n=0;nt*zc))}let x=s?"center":n.get("text-justify").evaluate(i,{},e.canonical);const _="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(i,{},e.canonical)*zc:1/0,b=()=>{e.bucket.allowVerticalPlacement&&aa(a)&&(d.vertical=pu(m,e.glyphMap,e.glyphPositions,e.imagePositions,u,_,o,g,"left",p,y,t.ah.vertical,!0,f,h))};if(!s&&v){const r=new Set;if("auto"===x)for(let t=0;tr(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),t.e=T,t.f=t=>new Promise(((e,r)=>{const n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=D}))},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."));const i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):D})),t.g=U,t.h=(t,e)=>G(T(t,{type:"json"}),e),t.i=L,t.j=$,t.k=X,t.l=(t,e)=>G(T(t,{type:"arrayBuffer"}),e),t.m=G,t.n=function(t){return new nu(t).readFields(iu,[])},t.o=Ks,t.p=su,t.q=Pa,t.r=_i,t.s=Z,t.t=ki,t.u=xi,t.v=J,t.w=C,t.x=function([t,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(r),y:t*Math.sin(e)*Math.sin(r),z:t*Math.cos(r)}},t.y=Re,t.z=va})),n("worker",0,(function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,r){for(const r of e){this._layerConfigs[r.id]=r;const e=this._layers[r.id]=t.aA(r);e._featureFilter=t.a7(e.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(const t of r)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const n=t.bk(Object.values(this._layerConfigs),this.keyCache);for(const t of n){const e=t.map((t=>this._layers[t.id])),r=e[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const a=r.sourceLayer||"_geojsonTileLayer";let o=i[a];o||(o=i[a]=[]),o.push(e)}}}class r{constructor(e){const r={},n=[];for(const t in e){const i=e[t],a=r[t]={};for(const t in i){const e=i[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const r={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(r),a[t]={rect:r,metrics:e.metrics}}}const{w:i,h:a}=t.p(n),o=new t.o({width:i||1,height:a||1});for(const n in e){const i=e[n];for(const e in i){const a=i[+e];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;const s=r[n][e].rect;t.o.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=r}}t.bl("GlyphAtlas",r);class n{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,n,a,o){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;const s=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(const r in h){const n=e.layers[r];if(!n)continue;1===n.version&&t.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=s.encode(r),f=[];for(let t=0;t=r.maxzoom||"none"!==r.visibility&&(i(e,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(f,u,this.tileID.canonical),l.bucketLayerIDs.push(e.map((t=>t.id))))}}const f=t.aF(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>null==t?void 0:t.abort())),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(f).length){const t=new AbortController;this.inFlightDependencies.push(t),p=o.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const d=Object.keys(u.iconDependencies);let m=Promise.resolve({});if(d.length){const t=new AbortController;this.inFlightDependencies.push(t),m=o.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"icons"}},t)}const g=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(g.length){const t=new AbortController;this.inFlightDependencies.push(t),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const[v,x,_]=yield Promise.all([p,m,y]),b=new r(v),w=new t.bo(x,_);for(const e in c){const r=c[e];r instanceof t.a6?(i(r.layers,this.zoom,a),t.bp({bucket:r,glyphMap:v,glyphPositions:b.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof t.bq||r instanceof t.br||r instanceof t.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((t=>!t.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?b.positions:null}}))}}function i(e,r,n){const i=new t.z(r);for(const t of e)t.recalculate(i,n)}class a{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,r){return t._(this,void 0,void 0,(function*(){const n=yield t.l(e.request,r);try{return{vectorTile:new t.bt.VectorTile(new t.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(t){const r=new Uint8Array(n.data);let i=`Unable to parse the tile at ${e.request.url}, `;throw i+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(i)}}))}loadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.uid,i=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),a=new n(e);this.loading[r]=a;const o=new AbortController;a.abort=o;try{const n=yield this.loadVectorTile(e,o);if(delete this.loading[r],!n)return null;const s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(i){const t=i.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}a.vectorTile=n.vectorTile;const u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{const e=yield u;return t.e({rawTileData:s.slice(0)},e,l,c)}finally{delete this.fetching[r]}}catch(t){throw delete this.loading[r],a.status="done",this.loaded[r]=a,t}}))}reloadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status){const e=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);let i;if(this.fetching[r]){const{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],i=t.e({rawTileData:n.slice(0)},e,a,o)}else i=e;return i}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){const t=this.loading,r=e.uid;t&&t[r]&&t[r].abort&&(t[r].abort.abort(),delete t[r])}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}))}}class o{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=e,c=i.width+2,u=i.height+2,h=t.b(i)?new t.R({width:c,height:u},yield t.bw(i,-1,-1,c,u)):i,f=new t.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=f,f}))}removeTile(t){const e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]}}function s(t,e){if(0!==t.length){l(t[0],e);for(var r=1;r=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}var c=t.by((function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n>31}function A(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;st},C=Math.fround||(I=new Float32Array(1),t=>(I[0]=+t,I[0]));var I;class L{constructor(t){this.options=Object.assign(Object.create(E),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const a=[];for(let e=0;e=r;t--){const r=+Date.now();o=this.trees[t]=this._createTree(this._cluster(o,t)),e&&console.log("z%d: %d clusters in %dms",t,o.numItems,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let i=180===t[2]?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){const t=this.getClusters([r,n,180,a],e),o=this.getClusters([-180,n,i,a],e);return t.concat(o)}const o=this.trees[this._limitZoom(e)],s=o.range(D(r),O(a),D(i),O(n)),l=o.data,c=[];for(const t of s){const e=this.stride*t;c.push(l[e+5]>1?P(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const a=i.data;if(e*this.stride>=a.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[e*this.stride],a[e*this.stride+1],o),l=[];for(const e of s){const r=e*this.stride;a[r+4]===t&&l.push(a[r+5]>1?P(a,r,this.clusterProps):this.points[a[r+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,r){const n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.data,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,i){const a=this.getChildren(e);for(const e of a){const a=e.properties;if(a&&a.cluster?i+a.point_count<=n?i+=a.point_count:i=this._appendLeaves(t,a.cluster_id,r,n,i):i1;let l,c,u;if(s)l=z(e,t,this.clusterProps),c=e[t],u=e[t+1];else{const r=this.points[e[t+3]];l=r.properties;const[n,i]=r.geometry.coordinates;c=D(n),u=O(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let f;f=s||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==f&&(h.id=f),a.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,e)),s=t.data,l=[],c=this.stride;for(let r=0;re&&(p+=s[r+5])}if(p>f&&p>=a){let t,a=n*f,o=u*f,d=-1;const m=(r/c<<5)+(e+1)+this.points.length;for(const n of h){const l=n*c;if(s[l+2]<=e)continue;s[l+2]=e;const u=s[l+5];a+=s[l]*u,o+=s[l+1]*u,s[l+4]=m,i&&(t||(t=this._map(s,r,!0),d=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(s,l)))}s[r+4]=m,l.push(a/p,o/p,1/0,m,-1,p),i&&l.push(d)}else{for(let t=0;t1)for(const t of h){const r=t*c;if(!(s[r+2]<=e)){s[r+2]=e;for(let t=0;t>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function P(t,e,r){return{type:"Feature",id:t[e+3],properties:z(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),R(t[e+1])]}};var n}function z(t,e,r){const n=t[e+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=t[e+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:i})}function D(t){return t/360+.5}function O(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function R(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function F(t,e,r,n){let i=n;const a=e+(r-e>>1);let o,s=r-e;const l=t[e],c=t[e+1],u=t[r],h=t[r+1];for(let n=e+3;ni)o=n,i=e;else if(e===i){const t=Math.abs(n-a);tn&&(o-e>3&&F(t,e,o,n),t[o+2]=i,r-o>3&&F(t,o,r,n))}function j(t,e,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){const l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=t-r,s=e-n,o*o+s*s}function B(t,e,r,n){const i={id:null==t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)N(i,r);else if("Polygon"===e)N(i,r[0]);else if("MultiLineString"===e)for(const t of r)N(i,t);else if("MultiPolygon"===e)for(const t of r)N(i,t[0]);return i}function N(t,e){for(let r=0;r0&&(o+=n?(i*l-s*a)/2:Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2))),i=s,a=l}const s=e.length-3;e[2]=1,F(e,0,s,r),e[s+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function H(t,e,r,n){for(let i=0;i1?1:r}function W(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;const l=[];for(const e of t){const t=e.geometry;let a=e.type;const o=0===i?e.minX:e.minY,c=0===i?e.maxX:e.maxY;if(o>=r&&c=n)continue;let u=[];if("Point"===a||"MultiPoint"===a)Y(t,u,r,n,i);else if("LineString"===a)X(t,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===a)K(t,u,r,n,i,!1);else if("Polygon"===a)K(t,u,r,n,i,!0);else if("MultiPolygon"===a)for(const e of t){const t=[];K(e,t,r,n,i,!0),t.length&&u.push(t)}if(u.length){if(s.lineMetrics&&"LineString"===a){for(const t of u)l.push(B(e.id,a,t,e.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===u.length?(a="LineString",u=u[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===u.length?"Point":"MultiPoint"),l.push(B(e.id,a,u,e.tags))}}return l.length?l:null}function Y(t,e,r,n,i){for(let a=0;a=r&&o<=n&&J(e,t[a],t[a+1],t[a+2])}}function X(t,e,r,n,i,a,o){let s=$(t);const l=0===i?Q:tt;let c,u,h=t.start;for(let f=0;fr&&(u=l(s,p,d,g,y,r),o&&(s.start=h+c*u)):v>n?x=r&&(u=l(s,p,d,g,y,r),_=!0),x>n&&v<=n&&(u=l(s,p,d,g,y,n),_=!0),!a&&_&&(o&&(s.end=h+c*u),e.push(s),s=$(t)),o&&(h+=c)}let f=t.length-3;const p=t[f],d=t[f+1],m=0===i?p:d;m>=r&&m<=n&&J(s,p,d,t[f+2]),f=s.length-3,a&&f>=3&&(s[f]!==s[0]||s[f+1]!==s[1])&&J(s,s[0],s[1],s[2]),s.length&&e.push(s)}function $(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function K(t,e,r,n,i,a){for(const o of t)X(o,e,r,n,i,a,!1)}function J(t,e,r,n){t.push(e,r,n)}function Q(t,e,r,n,i,a){const o=(a-e)/(n-e);return J(t,a,r+(i-r)*o,1),o}function tt(t,e,r,n,i,a){const o=(a-r)/(i-r);return J(t,e+(n-e)*o,a,1),o}function et(t,e){const r=[];for(let n=0;n0&&e.size<(i?o:n))return void(r.numPoints+=e.length/3);const s=[];for(let t=0;to)&&(r.numSimplified++,s.push(e[t],e[t+1])),r.numPoints++;i&&function(t,e){let r=0;for(let e=0,n=t.length,i=n-2;e0===e)for(let e=0,r=t.length;e24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(t,e){const r=[];if("FeatureCollection"===t.type)for(let n=0;n1&&console.time("creation"),f=this.tiles[h]=at(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(r!==a>>t||n!==o>>t)continue}}if(f.source=null,0===t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,d=.5-p,m=.5+p,g=1+p;let y=null,v=null,x=null,_=null,b=W(t,u,r-p,r+m,0,f.minX,f.maxX,l),w=W(t,u,r+d,r+g,0,f.minX,f.maxX,l);t=null,b&&(y=W(b,u,n-p,n+m,1,f.minY,f.maxY,l),v=W(b,u,n+d,n+g,1,f.minY,f.maxY,l),b=null),w&&(x=W(w,u,n-p,n+m,1,f.minY,f.maxY,l),_=W(w,u,n+d,n+g,1,f.minY,f.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*n),s.push(v||[],e+1,2*r,2*n+1),s.push(x||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}getTile(t,e,r){t=+t,e=+e,r=+r;const n=this.options,{extent:i,debug:a}=n;if(t<0||t>24)return null;const o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let l,c=t,u=e,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ut(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nt(this.tiles[s],i):null):null}}function ut(t,e,r){return 32*((1<{o.properties=t;const e={};for(const t of s)e[t]=n[t].evaluate(a,o);return e},e.reduce=(t,e)=>{o.properties=e;for(const e of s)a.accumulated=t[e],t[e]=i[e].evaluate(a,o)},e}(e)).load((yield this._pendingData).features):(i=yield this._pendingData,new ct(i,e.geojsonVtOptions)),this.loaded={};const r={};if(n){const t=n.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return r}catch(e){if(delete this._pendingRequest,t.bB(e))return{abandoned:!0};throw e}var i}))}getData(){return t._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(t){const e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(e,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(c(n,!0),e.filter){const r=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const i=n.features.filter((t=>r.value.evaluate({zoom:0},t)));n={type:"FeatureCollection",features:i}}return n}))}loadGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){const{promoteId:n}=e;if(e.request){const i=yield t.h(e.request,r);return this._dataUpdateable=ft(i.data,n)?pt(i.data,n):void 0,i.data}if("string"==typeof e.data)try{const t=JSON.parse(e.data);return this._dataUpdateable=ft(t,n)?pt(t,n):void 0,t}catch(t){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,r){var n,i,a,o;if(e.removeAll&&t.clear(),e.remove)for(const r of e.remove)t.delete(r);if(e.add)for(const n of e.add){const e=ht(n,r);null!=e&&t.set(e,n)}if(e.update)for(const r of e.update){let e=t.get(r.id);if(null==e)continue;const s=!r.removeAllProperties&&((null===(n=r.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=r.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((r.newGeometry||r.removeAllProperties||s)&&(e=Object.assign({},e),t.set(r.id,e),s&&(e.properties=Object.assign({},e.properties))),r.newGeometry&&(e.geometry=r.newGeometry),r.removeAllProperties)e.properties={};else if((null===(a=r.removeProperties)||void 0===a?void 0:a.length)>0)for(const t of r.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(o=r.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(const{key:t,value:n}of r.addOrUpdateProperties)e.properties[t]=n}}(this._dataUpdateable,e.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(e){return t._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class mt{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,r)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("GD",((t,e)=>this._getWorkerSource(t,e.type,e.source).getData())),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,r)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][r.type]||!this.workerSources[e][r.type][r.source])return;const t=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],void 0!==t.removeSource&&t.removeSource(r)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})))),this.actor.registerMessageHandler("SR",((e,r)=>t._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,r)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(r)}))))}_setImages(e,r){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=r;for(const t in this.workerSources[e]){const n=this.workerSources[e][t];for(const t in n)n[t].availableImages=r}}))}_syncRTLPluginState(e,r){return t._(this,void 0,void 0,(function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==r.pluginStatus)return t.bD.setState(r),r;const e=r.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){const r={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(r),r}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let r=this.layerIndexes[t];return r||(r=this.layerIndexes[t]=new e),r}_getWorkerSource(t,e,r){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){const n={sendAsync:(e,r)=>(e.targetMapId=t,this.actor.sendAsync(e,r))};switch(e){case"vector":this.workerSources[t][e][r]=new a(n,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new dt(n,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](n,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new mt(self)),mt})),n("index",0,(function(t,e){var r="4.7.1";let n,i;const a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise(((r,n)=>{const i=requestAnimationFrame(r);t.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(e.c())}))})),getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const 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=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(t){if(!o.docStyle)return t[0];for(let e=0;e{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,r,n){const i=r.boundingClientRect;return new e.P((n.clientX-i.left)/r.x-t.clientLeft,(n.clientY-i.top)/r.y-t.clientTop)}static mousePos(t,e){const r=o.getScale(t);return o.getPoint(t,r,e)}static touchPos(t,e){const r=[],n=o.getScale(t);for(let i=0;i{l&&f(l),l=null,h=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let r,n,i,a;t.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},t.addThrottleControl=t=>{const e=i++;return a[e]=t,e},t.removeThrottleControl=t=>{delete a[t],l()},t.getImage=(t,n,i=!0)=>new Promise(((a,o)=>{s.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),r.push({abortController:n,requestParameters:t,supportImageRefresh:i,state:"queued",onError:t=>{o(t)},onSuccess:t=>{a(t)}}),l()}));const o=t=>e._(this,void 0,void 0,(function*(){t.state="running";const{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:s}=t,u=!1===i&&!e.i(self)&&!e.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((t,e)=>t&&"accept"===e),!0));n++;const h=u?c(r,s):e.m(r,s);try{const r=yield h;delete t.abortController,t.state="completed",r.data instanceof HTMLImageElement||e.b(r.data)?o(r):r.data&&o({data:yield(f=r.data,"function"==typeof createImageBitmap?e.d(f):e.f(f)),cacheControl:r.cacheControl,expires:r.expires})}catch(e){delete t.abortController,a(e)}finally{n--,l()}var f})),l=()=>{const t=(()=>{for(const t of Object.keys(a))if(a[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=n;e0;e++){const t=r.shift();t.abortController.signal.aborted?e--:o(t)}},c=(t,r)=>new Promise(((n,i)=>{const a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(e.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o}))}(p||(p={})),p.resetRequestQueue();class d{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var r=new e.A(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}var g,y=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};g=new e.A(3),e.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v,x=function(t){var e=t[0],r=t[1];return e*e+r*r};function _(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const r=[];for(const{id:n,url:i}of t){const t=`${n}${i}`;-1===r.indexOf(t)&&(r.push(t),e.push({id:n,url:i}))}}return e}function b(t,e,r){const n=t.split("?");return n[0]+=`${e}${r}`,n.join("?")}v=new e.A(2),e.A!=Float32Array&&(v[0]=0,v[1]=0);class w{constructor(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,r,n){const{width:i,height:a}=t,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,t.data);else{const{x:r,y:o}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,r){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function T(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class k extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const r=this.images[t];if(r&&!r.data&&r.spriteData){const t=r.spriteData;r.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,r){let n=!0;const i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let r=0;for(const n of t){if(n[0]{let n=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(n=!1);this.isLoaded()||n?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){const r={};for(const n of t){let t=this.getImage(n);t||(this.fire(new e.k("styleimagemissing",{id:n})),t=this.getImage(n)),t?r[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${n}" 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 r}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.I(r,n);this.patterns[t]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new w(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:r,h:n}=e.p(t),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const t in this.patterns){const{bin:r}=this.patterns[t],n=r.x+1,a=r.y+1,o=this.getImage(t).data,s=o.width,l=o.height;e.R.copy(o,i,{x:0,y:0},{x:n,y:a},{width:s,height:l}),e.R.copy(o,i,{x:0,y:l-1},{x:n,y:a-1},{width:s,height:1}),e.R.copy(o,i,{x:0,y:0},{x:n,y:a+l},{width:s,height:1}),e.R.copy(o,i,{x:s-1,y:0},{x:n-1,y:a},{width:1,height:l}),e.R.copy(o,i,{x:0,y:0},{x:n+s,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const r of t){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const t=this.getImage(r);t||e.w(`Image with ID: "${r}" was not found`),T(t)&&this.updateImage(r,t)}}}const A=1e20;function M(t,e,r,n,i,a,o,s,l){for(let c=e;c-1);l++,a[l]=s,o[l]=c,o[l+1]=A}for(let s=0,l=0;s65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[i])return{stack:t,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[i]){const r=E.loadGlyphRange(t,i,this.url,this.requestManager);e.requests[i]=r}const a=yield e.requests[i];for(const t in a)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=a[+t]);return e.ranges[i]=!0,{stack:t,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(t))}_tinySDF(t,r,n){const i=this.localIdeographFontFamily;if(!i)return;if(!this._doesCharSupportLocalGlyph(n))return;let a=t.tinySDF;if(!a){let e="400";/bold/i.test(r)?e="900":/medium/i.test(r)?e="500":/light/i.test(r)&&(e="200"),a=t.tinySDF=new E.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:e})}const o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new e.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}E.loadGlyphRange=function(t,r,n,i){return e._(this,void 0,void 0,(function*(){const a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",t).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield e.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);const c={};for(const t of e.n(l.data))c[t.id]=t;return c}))},E.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=r;const s=this.size=t+4*e,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${t}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(t),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),f=new Uint8ClampedArray(h),p={data:f,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:d,buffer:m,gridInner:g,gridOuter:y}=this;d.clearRect(m,m,s,l),d.fillText(t,m,m+o);const v=d.getImageData(m,m,s,l);y.fill(A,0,h),g.fill(0,0,h);for(let t=0;t0?t*t:0,g[n]=t<0?t*t:0}}M(y,0,0,c,u,c,this.f,this.v,this.z),M(g,m,m,s,l,c,this.f,this.v,this.z);for(let t=0;t1&&(o=t[++a]);const l=Math.abs(s-o.left),c=Math.abs(s-o.right),u=Math.min(l,c);let h;const f=e/r*(n+1);if(o.isDash){const t=n-Math.abs(f);h=Math.sqrt(u*u+t*t)}else h=n-Math.sqrt(u*u+f*f);this.data[i+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){const r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}const e=t[0],r=t[t.length-1];e.isDash===r.isDash&&(e.left=r.left-this.width,r.right=e.right+this.width);const n=this.width*this.nextRow;let i=0,a=t[i];for(let e=0;e1&&(a=t[++i]);const r=Math.abs(e-a.left),o=Math.abs(e-a.right),s=Math.min(r,o);this.data[n+e]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(t,r){const n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.w("LineAtlas out of space"),null;let a=0;for(let e=0;e{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}const F=Math.floor(a.hardwareConcurrency/2);let j,B;function N(){return j||(j=new R),j}R.workerCount=e.C(globalThis)?Math.max(Math.min(F,3),1):1;class U{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=r;const n=this.workerPool.acquire(r);for(let t=0;t{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const r of this.actors)r.registerMessageHandler(t,e)}}function V(){return B||(B=new U(N(),e.G),B.registerMessageHandler("GR",((t,r,n)=>e.m(r,n)))),B}function q(t,r){const n=e.H();return e.J(n,n,[1,1,0]),e.K(n,n,[.5*t.width,.5*t.height,1]),e.L(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function H(t,e,r,n,i,a){const o=function(t,e,r){if(t)for(const n of t){const t=e[n];if(t&&t.source===r&&"fill-extrusion"===t.type)return!0}else for(const t in e){const n=e[t];if(n.source===r&&"fill-extrusion"===n.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(G);const c=[];for(const n of l)c.push({wrappedTileID:n.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,r,t._state,n.queryGeometry,n.cameraQueryGeometry,n.scale,i,a,s,q(t.transform,n.tileID))});const u=function(t){const e={},r={};for(const n of t){const t=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(const r in t){const n=t[r],i=a[r]=a[r]||{},o=e[r]=e[r]||[];for(const t of n)i[t.featureIndex]||(i[t.featureIndex]=!0,o.push(t))}}return e}(c);for(const e in u)u[e].forEach((e=>{const r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function G(t,e){const r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function Z(t,r,n){return e._(this,void 0,void 0,(function*(){let i=t;if(t.url?i=(yield e.h(r.transformRequest(t.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;const o=e.M(e.e(i,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map((t=>t.id))),o}))}class W{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?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 e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){const r=this._sw,n=this._ne;let i,a;if(t instanceof e.N)i=t,a=t;else{if(!(t instanceof W))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(i=t._sw,a=t._ne,!i||!a)return this}return r||n?(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(a.lng,n.lng),n.lat=Math.max(a.lat,n.lat)):(this._sw=new e.N(i.lng,i.lat),this._ne=new e.N(a.lng,a.lat)),this}getCenter(){return new e.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 e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.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(t){const{lng:r,lat:n}=e.N.convert(t);let i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(t){return t instanceof W?t:t?new W(t):t}static fromLngLat(t,r=0){const n=360*r/40075017,i=n/Math.cos(Math.PI/180*t.lat);return new W(new e.N(t.lng-i,t.lat-n),new e.N(t.lng+i,t.lat+n))}adjustAntiMeridian(){const t=new e.N(this._sw.lng,this._sw.lat),r=new e.N(this._ne.lng,this._ne.lat);return new W(t,t.lng>r.lng?new e.N(r.lng+360,r.lat):r)}}class Y{constructor(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const r=Math.pow(2,t.z),n=Math.floor(e.O(this.bounds.getWest())*r),i=Math.floor(e.Q(this.bounds.getNorth())*r),a=Math.ceil(e.O(this.bounds.getEast())*r),o=Math.ceil(e.Q(this.bounds.getSouth())*r);return t.x>=n&&t.x=i&&t.y{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(e,"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};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,r)=>{t.reloadPromise={resolve:e,reject:r}}))}else t.actor=this.dispatcher.getActor(),n="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:n,data:r},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}}))}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class $ extends e.E{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},r),e.e(this,e.M(r,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Z(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Y(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const r=yield p.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const e=this.map.painter.context,n=e.gl,i=r.data;t.texture=this.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new w(e,i,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class K extends ${constructor(t,r,n,i){super(t,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const r=yield p.getImage(n,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){const n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=e.b(n)&&e.U()?n:yield this.readImageNow(n),a={type:this.type,uid:t.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.V()){const r=t.width+2,n=t.height+2;try{return new e.R({width:r,height:n},yield e.W(t,-1,-1,r,n))}catch(t){}}return a.getImageData(t,1)}))}_getNeighboringTiles(t){const r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&e.e(i,{resourceTiming:n}),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(t))}}))}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const r={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.abortController=new AbortController;const n=yield this.actor.sendAsync({type:e,data:r},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(n,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.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 e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Q=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class tt extends e.E{constructor(t,e,r,n){super(),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,this.fire(new e.j(t))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const r=t.map(e.Z.fromLngLat);this.tileID=function(t){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(const e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);const o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new e.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const n=r.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new e.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,e.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,e.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new w(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class et extends tt{constructor(t,e,r,n){super(t,e,r,n),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.j(t))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const r=this.video.seekable;tr.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.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)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new w(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.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 rt extends tt{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`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 e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return e._(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 e.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(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new w(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const nt={},it=t=>{switch(t){case"geojson":return J;case"image":return tt;case"raster":return $;case"raster-dem":return K;case"vector":return X;case"video":return et;case"canvas":return rt}return nt[t]},at="RTLPluginLoaded";class ot extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=a.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(at))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let st=null;function lt(){return st||(st=new ot),st}class ct{constructor(t,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=r,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){const e=t+this.timeAdded;ee.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)r[e.id]=n}}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.a6&&r.hasRTLText){this.hasRTLText=!0,lt().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const 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(const e in this.buckets){const r=this.buckets[e];r.uploadPending()&&r.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new w(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new w(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}}querySourceFeatures(t,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;const s=e.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let r=0;rt)e=!1;else if(r)if(this.expirationTime{this.remove(t,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}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){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const r in this.data)for(const n of this.data[r])t(n.value)||e.push(n);for(const t of e)this.remove(t.value.tileID,t)}}class ht{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,n){const i=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.e(this.stateChanges[t][i],n),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(const e in this.state[t][i])n[e]||(this.deletedStates[t][i][e]=null)}else for(const e in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(t,e,r){if(null===this.deletedStates[t])return;const n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,r){const n=String(r),i=e.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][r];if(null===e)return{};for(const t in e)delete i[t]}return i}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,r){const n={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const r={};for(const n in this.stateChanges[t])this.state[t][n]||(this.state[t][n]={}),e.e(this.state[t][n],this.stateChanges[t][n]),r[n]=this.state[t][n];n[t]=r}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const r={};if(null===this.deletedStates[t])for(const e in this.state[t])r[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(const r of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][r];r[e]=this.state[t][e]}n[t]=n[t]||{},e.e(n[t],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const e in t)t[e].setFeatureState(n,r)}}class ft extends e.E{constructor(t,e,r){super(),this.id=t,this.dispatcher=r,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,r,n)=>{const i=new(it(e.type))(t,e,r,n);if(i.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${i.id}`);return i})(t,e,r,this),this._tiles={},this._cache=new ut(0,(t=>this._unloadTile(t))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ht,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)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,r,n){return e._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,r,n)}catch(r){t.state="errored",404!==r.status?this._source.fire(new e.j(r,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("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(const e in this._tiles){const r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(pt).map((t=>t.key))}getRenderableIds(t){const r=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&r.push(this._tiles[e]);return t?r.sort(((t,r)=>{const n=t.tileID,i=r.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((t=>t.tileID.key)):r.map((t=>t.tileID)).sort(pt).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,r){return e._(this,void 0,void 0,(function*(){const e=this._tiles[t];e&&("loading"!==e.state&&(e.state=r),yield this._loadTile(e,t,r))}))}_tileLoaded(t,r,n){t.timeAdded=a.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,r,n){for(const i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>e+1;){const t=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[t.key],a&&a.hasData()&&(o=t)}let s=o;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){n[o.key]=o;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(let r=t.overscaledZ-1;r>=e;r--){const e=t.scaledTo(r),n=this._getLoadedTile(e);if(n)return n}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const r=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(t,e,r,n,i,o){const s={},l={},c=Object.keys(t),u=a.now();for(const r of c){const n=t[r],i=this._tiles[r];if(!i||0!==i.fadeEndTime&&i.fadeEndTime<=u)continue;const a=this.findLoadedParent(n,e),o=this.findLoadedSibling(n),c=a||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[r]=n}this._retainLoadedChildren(l,n,r,t);for(const e in s)t[e]||(this._coveredTiles[e]=!0,t[e]=s[e]);if(o){const e={},r={};for(const t of i)this._tiles[t.key].hasData()?e[t.key]=t:r[t.key]=t;for(const n in r){const i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(e[i[0].key]=t[i[0].key]=i[0],e[i[1].key]=t[i[1].key]=i[1],e[i[2].key]=t[i[2].key]=i[2],e[i[3].key]=t[i[3].key]=i[3],delete r[n])}for(const n in r){const i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){e[s.tileID.key]=t[s.tileID.key]=s.tileID;for(const t in e)e[t].isChildOf(s.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=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:r}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];const i=t.coveringZoomLevel(this._source),a=Math.max(i-ft.maxOverzooming,this._source.minzoom),o=Math.max(i+ft.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const t={};for(const e of n)if(e.canonical.z>this._source.minzoom){const r=e.scaledTo(e.canonical.z-1);t[r.key]=r;const n=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[n.key]=n}n=n.concat(Object.values(t))}const s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(n,i);dt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(const t in l)this._tiles[t].clearFadeHold();const c=e.ab(this._tiles,l);for(const t of c){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var r;const n={},i={},a=Math.max(e-ft.maxOverzooming,this._source.minzoom),o=Math.max(e+ft.maxUnderzooming,this._source.minzoom),s={};for(const r of t){const t=this._addTile(r);n[r.key]=r,t.hasData()||ethis._source.maxzoom){const t=o.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){n[t.key]=t;continue}}else{const t=o.children(this._source.maxzoom);if(n[t[0].key]&&n[t[1].key]&&n[t[2].key]&&n[t[3].key])continue}let s=t.wasRequested();for(let e=o.overscaledZ-1;e>=a;--e){const a=o.scaledTo(e);if(i[a.key])break;if(i[a.key]=!0,t=this.getTile(a),!t&&s&&(t=this._addTile(a)),t){const e=t.hasData();if((e||!(null===(r=this.map)||void 0===r?void 0:r.cancelPendingTileRequestsWhileZooming)||s)&&(n[a.key]=a),s=t.wasRequested(),e)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let r,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(t),r)break;n=t}for(const t of e)this._loadedParentTiles[t]=r}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const e=this._tiles[t].tileID,r=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));const n=r;return r||(r=new ct(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state)),r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),r))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){const e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,r,n){const i=[],a=this.transform;if(!a)return i;const o=n?a.getCameraQueryGeometry(t):t,s=t.map((t=>a.pointCoordinate(t,this.terrain))),l=o.map((t=>a.pointCoordinate(t,this.terrain))),c=this.getIds();let u=1/0,h=1/0,f=-1/0,p=-1/0;for(const t of l)u=Math.min(u,t.x),h=Math.min(h,t.y),f=Math.max(f,t.x),p=Math.max(p,t.y);for(let t=0;t=0&&g[1].y+m>=0){const t=s.map((t=>o.getTilePoint(t))),e=l.map((t=>o.getTilePoint(t)));i.push({tile:n,tileID:o,queryGeometry:t,cameraQueryGeometry:e,scale:d})}}return i}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(dt(this._source.type)){const t=a.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)}removeFeatureState(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,r){const n=this._tiles[t];n&&n.setDependencies(e,r)}reloadTilesForDependencies(t,e){for(const r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(t,e)))}}function pt(t,e){const r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function dt(t){return"raster"===t||"image"===t||"video"===t}ft.maxOverzooming=10,ft.maxUnderzooming=3;class mt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function gt(t,e){let r=!0;return"always"===t||"never"!==t&&"never"!==e||(r=!1),r}class yt{constructor(t,e,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(let t=0;tthis.width||n<0||e>this.height)return[];const s=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:t,y1:e,x2:r,y2:n}];for(let t=0;t0}hitTestCircle(t,e,r,n,i){const a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(t,e,r,n,i,a,o,s){const{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const i=this.bboxes;for(const o of h)if(!l.box[o]){l.box[o]=!0;const h=4*o,f=this.boxKeys[o];if(t<=i[h+2]&&e<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(f))&&(!c||!gt(u,f.overlapMode))&&(a.push({key:f,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}const f=this.circleCells[i];if(null!==f){const i=this.circles;for(const o of f)if(!l.circle[o]){l.circle[o]=!0;const h=3*o,f=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],t,e,r,n)&&(!s||s(f))&&(!c||!gt(u,f.overlapMode))){const t=i[h],e=i[h+1],r=i[h+2];if(a.push({key:f,x1:t-r,y1:e-r,x2:t+r,y2:e+r}),c)return!0}}}return!1}_queryCellCircle(t,e,r,n,i,a,o,s){const{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const t=this.bboxes;for(const e of h)if(!c.box[e]){c.box[e]=!0;const r=4*e,n=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[r+0],t[r+1],t[r+2],t[r+3])&&(!s||s(n))&&!gt(u,n.overlapMode))return a.push(!0),!0}}const f=this.circleCells[i];if(null!==f){const t=this.circles;for(const e of f)if(!c.circle[e]){c.circle[e]=!0;const r=3*e,n=this.circleKeys[e];if(this._circlesCollide(t[r],t[r+1],t[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!gt(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,r,n,i,a,o,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++)if(i.call(this,t,e,r,n,this.xCellCount*l+f,a,o,s))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,e,r,n,i,a){const o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(t,e,r,n,i,a,o){const s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;const c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const h=l-s,f=u-c;return h*h+f*f<=r*r}}function vt(t,r,n,i,a){const o=e.H();return r?(e.K(o,o,[1/a,1/a,1]),n||e.ad(o,o,i.angle)):e.L(o,i.labelPlaneMatrix,t),o}function xt(t,r,n,i,a){if(r){const r=e.ae(t);return e.K(r,r,[a,a,1]),n||e.ad(r,r,-i.angle),r}return i.glCoordMatrix}function _t(t,r,n,i){let a;i?(a=[t,r,i(t,r),1],e.af(a,a,n)):(a=[t,r,0,1],Ot(a,a,n));const o=a[3];return{point:new e.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function bt(t,e){return.5+t/e*.5}function wt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function Tt(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m){const g=i?t.textSizeData:t.iconSizeData,y=e.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();const _=t.lineVertexArray,b=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=n.transform.width/n.transform.height;let T=!1;for(let i=0;iMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.ah.vertical?r.yn.x)?{needsFlipping:!0}:null}function Mt(t,r,n,i,a,o,s,l,c,u,h){const f=n/24,p=r.lineOffsetX*f,d=r.lineOffsetY*f;let m;if(r.numGlyphs>1){const e=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=kt(f,l,p,d,i,r,h,t);if(!c)return{notEnoughRoom:!0};const g=_t(c.first.point.x,c.first.point.y,s,t.getElevation).point,y=_t(c.last.point.x,c.last.point.y,s,t.getElevation).point;if(a&&!i){const t=At(r.writingMode,g,y,u);if(t)return t}m=[c.first];for(let a=r.glyphStartIndex+1;a0?s.point:St(t.tileAnchorPoint,a,n,1,o,t),c=At(r.writingMode,n,l,u);if(c)return c}const n=Pt(f*l.getoffsetX(r.glyphStartIndex),p,d,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,h);if(!n||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[n]}for(const t of m)e.aj(c,t.point,t.angle);return{}}function St(t,e,r,n,i,a){const o=t.add(t.sub(e)._unit()),s=void 0!==i?_t(o.x,o.y,i,a.getElevation).point:Ct(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Et(t,r,n){const i=r.projectionCache;if(i.projections[t])return i.projections[t];const a=new e.P(r.lineVertexArray.getx(t),r.lineVertexArray.gety(t)),o=Ct(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[t]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;const s=t-n.direction;return l=0===n.distanceFromAnchor?r.tileAnchorPoint:new e.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),c=a,u=n.previousVertex,h=n.absOffsetX-n.distanceFromAnchor+1,St(l,c,u,h,void 0,r);var l,c,u,h}function Ct(t,e,r){const n=t+r.translation[0],i=e+r.translation[1];let a;return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(a=r.projection.projectTileCoordinates(n,i,r.unwrappedTileID,r.getElevation),a.point.x=(.5*a.point.x+.5)*r.width,a.point.y=(.5*-a.point.y+.5)*r.height):(a=_t(n,i,r.labelPlaneMatrix,r.getElevation),a.isOccluded=!1),a}function It(t,e,r){return t._unit()._perp()._mult(e*r)}function Lt(t,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const u=n.add(r);if(t+c.direction=a)return l.projectionCache.offsets[t]=u,u;const h=Et(t+c.direction,l,c),f=It(h.sub(n),s,c.direction),p=n.add(f),d=h.add(f);return l.projectionCache.offsets[t]=e.ak(o,u,p,d)||u,l.projectionCache.offsets[t]}function Pt(t,e,r,n,i,a,o,s,l){const c=n?t-e:t+e;let u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let f,p=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=Ct(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let d,m,g=f,y=f,v=0,x=0;const _=Math.abs(c),b=[];let w;for(;v+x<=_;){if(p+=u,p=o)return null;v+=x,y=g,m=d;const t={absOffsetX:_,direction:u,distanceFromAnchor:v,previousVertex:y};if(g=Et(p,s,t),0===r)b.push(y),w=g.sub(y);else{let e;const n=g.sub(y);e=0===n.mag()?It(Et(p+u,s,t).sub(g),r,u):It(n,r,u),m||(m=y.add(e)),d=Lt(p,e,g,a,o,m,r,s,t),b.push(m),w=d.sub(m)}x=w.mag()}const T=w._mult((_-v)/x)._add(m||y),k=h+Math.atan2(g.y-y.y,g.x-y.x);return b.push(T),{point:T,angle:l?k:0,path:b}}const zt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dt(t,e){for(let r=0;r=1;t--)l.push(o.path[t]);for(let t=1;tt.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let m=[];if(l.length>0){const t=l[0].clone(),r=l[0].clone();for(let e=1;e=n.x&&r.x<=i.x&&t.y>=n.y&&r.y<=i.y?[l]:r.xi.x||r.yi.y?[]:e.al([l],n.x,n.y,i.x,i.y)}for(const e of m){a.reset(e,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let e=0;e_t(t.x,t.y,r,e.getElevation)))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,a=-1/0,o=-1/0;for(const s of t){const t=new e.P(s.x+Rt,s.y+Rt);n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y),r.push(t)}const s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(const t of s){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const i=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.am(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(t,e,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,r,n,i,a){const o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e};for(let e=0;e=this.screenRightBoundary||nthis.screenBottomBoundary}isInsideGrid(t,e,r,n){return r>=0&&t=0&&ethis.projectAndGetPerspectiveRatio(n,t.x,t.y,i,c)));k=t.some((t=>!t.isOccluded)),T=t.map((t=>t.point))}else k=!0;return{box:e.ao(T),allPointsOccluded:!k}}}function jt(t,r,n){return r*(e.X/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}class Bt{constructor(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Nt{constructor(t,e,r,n,i){this.text=new Bt(t?t.text:null,e,r,i),this.icon=new Bt(t?t.icon:null,e,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ut{constructor(t,e,r){this.text=t,this.icon=e,this.skipFade=r}}class Vt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class qt{constructor(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Ht{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function Gt(t,r,n,i,a){const{horizontalAlign:o,verticalAlign:s}=e.au(t);return new e.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Zt{constructor(t,e,r,n,i,a){this.transform=t.clone(),this.terrain=r,this.collisionIndex=new Ft(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Ht(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(r,n)=>e.getElevation(t,r,n):null}getBucketParts(t,r,n,i){const a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;const s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/e.X,f=n.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(f),d="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=jt(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=vt(p,d,m,this.transform,g);let _=null;if(d){const t=xt(p,d,m,this.transform,g);_=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[a.bucketInstanceId]=new qt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);const b={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:p,unwrappedTileID:f,textLabelPlaneMatrix:x,labelToScreenMatrix:_,scale:u,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(const e of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:b})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x){const _=e.aq[t.textAnchor],b=[t.textOffset0,t.textOffset1],w=Gt(_,n,i,b,a),T=this.collisionIndex.placeCollisionBox(r,f,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,f,l,c,u,s,o,y,h.predicate,x,w).placeable)&&T.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:n,height:i,anchor:_,textBoxScale:a,prevAnchor:t},this.markUsedJustification(d,_,p,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,r,n){const{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:f,holdingForFade:p,collisionBoxArray:d,partiallyEvaluatedTextSize:m,collisionGroup:g}=t.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=e.ar(a,"text-overlap","text-allow-overlap"),_="always"===x,b=e.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===b,T="map"===a.get("text-rotation-alignment"),k="map"===a.get("text-pitch-alignment"),A="none"!==a.get("icon-text-fit"),M="viewport-y"===a.get("symbol-z-order"),S=_&&(w||!i.hasIconData()||v),E=w&&(_||!i.hasTextData()||y);!i.collisionArrays&&d&&i.deserializeCollisionBoxes(d);const C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),I=(t,d,w)=>{var M,I;if(r[t.crossTileID])return;if(p)return void(this.placements[t.crossTileID]=new Ut(!1,!1,!1));let L=!1,P=!1,z=!0,D=null,O={box:null,placeable:!1,offscreen:null},R={box:null,placeable:!1,offscreen:null},F=null,j=null,B=null,N=0,U=0,V=0;d.textFeatureIndex?N=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),d.verticalTextFeatureIndex&&(U=d.verticalTextFeatureIndex);const q=d.textBox;if(q){const r=r=>{let n=e.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,n=e,this.markUsedOrientation(i,n,t))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(const t of i.writingModes)if(t===e.ah.vertical?(O=n(),R=O):O=r(),O&&O.placeable)break}else O=r()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){const n=(e,r)=>{const n=this.collisionIndex.placeCollisionBox(e,x,f,l,c,k,T,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,t),this.placedOrientations[t.crossTileID]=r),n};a((()=>n(q,e.ah.horizontal)),(()=>{const r=d.verticalTextBox;return i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?n(r,e.ah.vertical):{box:null,offscreen:null}})),r(O&&O.placeable)}else{let p=e.aq[null===(I=null===(M=this.prevPlacement)||void 0===M?void 0:M.variableOffsets[t.crossTileID])||void 0===I?void 0:I.anchor];const m=(r,a,d)=>{const m=r.x2-r.x1,y=r.y2-r.y1,v=t.textBoxScale,_=A&&"never"===b?a:null;let w=null,M="never"===x?1:2,S="never";p&&M++;for(let e=0;em(q,d.iconBox,e.ah.horizontal)),(()=>{const r=d.verticalTextBox;return i.allowVerticalPlacement&&(!O||!O.placeable)&&t.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}})),O&&(L=O.placeable,z=O.offscreen);const y=r(O&&O.placeable);if(!L&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(i,e.anchor,t,y))}}}if(F=O,L=F&&F.placeable,z=F&&F.offscreen,t.useRuntimeCollisionCircles){const r=i.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ai(i.textSizeData,m,r),f=a.get("text-padding");j=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,k,g.predicate,t.collisionCircleDiameter,f,o,C),j.circles.length&&j.collisionDetected&&!n&&e.w("Collisions detected, but collision boxes are not shown"),L=_||j.circles.length>0&&!j.collisionDetected,z=z&&j.offscreen}if(d.iconFeatureIndex&&(V=d.iconFeatureIndex),d.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,b,f,l,c,k,T,s,g.predicate,C,A&&D?D:void 0);R&&R.placeable&&d.verticalIconBox?(B=t(d.verticalIconBox),P=B.placeable):(B=t(d.iconBox),P=B.placeable),z=z&&B.offscreen}const H=y||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=v||0===t.numIconVertices;H||G?G?H||(P=P&&L):L=P&&L:P=L=P&&L;const Z=P&&B.placeable;if(L&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:N,g.ID),Z&&this.collisionIndex.insertCollisionBox(B.box,b,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),j&&L&&this.collisionIndex.insertCollisionCircles(j.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,d,F,B,j),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Ut(L||S,P||E,z||i.justReloaded),r[t.crossTileID]=!0};if(M){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=i.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const r=e[t];I(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let e=t.symbolInstanceStart;e=0&&(t.text.placedSymbolArray.get(e).crossTileID=a>=0&&e!==a?0:n.crossTileID)}markUsedOrientation(t,r,n){const i=r===e.ah.horizontal||r===e.ah.horizontalOnly?r:0,a=r===e.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const e of o)t.text.placedSymbolArray.get(e).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],a=i[t];a?(this.opacities[t]=new Nt(a,n,e.text,e.icon),r=r||e.text!==a.text.placed||e.icon!==a.icon.placed):(this.opacities[t]=new Nt(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(const t in i){const e=i[t];if(!this.opacities[t]){const i=new Nt(e,n,!1,!1);i.isHidden()||(this.opacities[t]=i,r=r||e.text.placed||e.icon.placed)}}for(const t in a)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=a[t]);for(const t in o)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=o[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const r={};for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(t,r,n,i){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();const a=t.layers[0],o=a.layout,s=new Nt(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),f="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),d=new Nt(null,0,l&&(c||!t.hasIconData()||o.get("icon-optional")),c&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const m=(t,e,r)=>{for(let n=0;n0,v=this.placedOrientations[i.crossTileID],x=v===e.ah.vertical,_=v===e.ah.horizontal||v===e.ah.horizontalOnly;if(a>0||o>0){const e=ee(c.text);m(t.text,a,x?re:e),m(t.text,o,_?re:e);const r=c.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||x?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||_?1:0);const n=this.variableOffsets[i.crossTileID];n&&this.markUsedJustification(t,n.anchor,i,v);const s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(t,"left",i,s),this.markUsedOrientation(t,s,i))}if(y){const e=ee(c.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&x);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:re),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=c.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?re:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=c.icon.isHidden())}const b=g&&g.has(r)?g.get(r):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const n=t.collisionArrays[r];if(n){let r=new e.P(0,0);if(n.textBox||n.verticalTextBox){let e=!0;if(u){const t=this.variableOffsets[l];t?(r=Gt(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&r._rotate(f?this.transform.angle:-this.transform.angle)):e=!1}if(n.textBox||n.verticalTextBox){let i;n.textBox&&(i=x),n.verticalTextBox&&(i=_),Wt(t.textCollisionBox.collisionVertexArray,c.text.placed,!e||i,b.text,r.x,r.y)}}if(n.iconBox||n.verticalIconBox){const e=Boolean(!_&&n.verticalIconBox);let i;n.iconBox&&(i=e),n.verticalIconBox&&(i=!e),Wt(t.iconCollisionBox.collisionVertexArray,c.icon.placed,i,b.icon,p?r.x:0,p?r.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){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?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 Wt(t,e,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);const o=n[0]-Rt,s=n[1]-Rt,l=n[2]-Rt,c=n[3]-Rt;t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,c),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,c)}const Yt=Math.pow(2,25),Xt=Math.pow(2,24),$t=Math.pow(2,17),Kt=Math.pow(2,16),Jt=Math.pow(2,9),Qt=Math.pow(2,8),te=Math.pow(2,1);function ee(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Yt+e*Xt+r*$t+e*Kt+r*Jt+e*Qt+r*te+e}const re=0;function ne(){return{isOccluded:(t,e,r)=>!1,getPitchedTextCorrection:(t,e,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,r,n){throw new Error("Not implemented.")},translatePosition:(t,e,r,n)=>function(t,e,r,n,i=!1){if(!r[0]&&!r[1])return[0,0];const a=i?"map"===n?t.angle:0:"viewport"===n?-t.angle:0;if(a){const t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}return[i?r[0]:jt(e,r[0],t.zoom),i?r[1]:jt(e,r[1],t.zoom)]}(t,e,r,n),getCircleRadiusCorrection:t=>1}}class ie{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,r,n,i){const a=this._bucketParts;for(;this._currentTileIndext.sortKey-e.sortKey)));this._currentPartIndex!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){const n=e[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new ie(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const oe=512/e.X/2;class se{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};const i=new Map;for(let t=0;t({x:Math.floor(t.anchorX*oe),y:Math.floor(t.anchorY*oe)}))),crossTileIDs:r.map((t=>t.crossTileID))};if(n.positions.length>128){const t=new e.av(n.positions.length,16,Uint16Array);for(const{x:e,y:r}of n.positions)t.add(e,r);t.finish(),delete n.positions,n.index=t}this._symbolsByKey[t]=n}}getScaledCoordinates(t,r){const{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=oe/Math.pow(2,l-a),u=(s*e.X+t.anchorY)*c,h=i*e.X*oe;return{x:Math.floor((o*e.X+t.anchorX)*c-n*e.X*oe),y:Math.floor(u-h)}}findMatches(t,e,r){const n=this.tileID.canonical.zt))}}class le{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ce{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const r=this.indexes[t],n={};for(const t in r){const i=r[t];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}this.indexes[t]=n}this.lng=t}addBucket(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;tt.overscaledZ)for(const r in i){const a=i[r];a.tileID.isChildOf(t)&&a.findMatches(e.symbolInstances,t,n)}else{const a=i[t.scaledTo(Number(r)).key];a&&a.findMatches(e.symbolInstances,t,n)}}for(let t=0;t{e[t]=!0}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}const he=(t,r)=>e.t(t,r&&r.filter((t=>"source.canvas"!==t.identifier))),fe=e.aw();class pe extends e.E{constructor(t,r={}){super(),this._rtlPluginLoaded=()=>{for(const t in this.sourceCaches){const e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new U(N(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new E(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new ue,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),lt().on(at,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const r=e.getSource();if(r&&r.vectorLayerIds)for(const t in this._layers){const e=this._layers[t];e.source===r.id&&this._validateLayer(e)}}))}loadURL(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;const i=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const a=this._loadStyleRequest;e.h(i,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,r,n)})).catch((t=>{this._loadStyleRequest=null,t&&!a.signal.aborted&&this.fire(new e.j(t))}))}loadJSON(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(t,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(fe,{validate:!1})}_load(t,r,n){var i;const a=r.transformStyle?r.transformStyle(n,t):t;if(!r.validate||!he(this,e.u(a))){this._loaded=!0,this.stylesheet=a;for(const t in a.sources)this.addSource(t,a.sources[t],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new z(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(const r of t){const t=e.aA(r);t.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=t}}_loadSprite(t,r=!1,n=void 0){let i;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,r,n,i){return e._(this,void 0,void 0,(function*(){const o=_(t),s=n>1?"@2x":"",l={},c={};for(const{id:t,url:n}of o){const a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[t]=e.h(a,i);const o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[t]=p.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,r){return e._(this,void 0,void 0,(function*(){const e={};for(const n in t){e[n]={};const i=a.getImageCanvasContext((yield r[n]).data),o=(yield t[n]).data;for(const t in o){const{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m}=o[t];e[n][t]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return e}))}(l,c)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const n=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(const t of n)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const n in t[e]){const i="default"===e?n:`${e}:${n}`;this._spritesImagesIds[e].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,t[e][n],!1):this.imageManager.addImage(i,t[e][n]),r&&(this._changedImages[i]=!0)}}})).catch((t=>{this._spriteRequest=null,i=t,this.fire(new e.j(i))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),n&&n(i)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){const r=this.sourceCaches[t.source];if(!r)return;const n=t.sourceLayer;if(!n)return;const i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,r=!1){const n=this._serializedAllLayers();if(!t||0===t.length)return Object.values(r?e.aB(n):n);const i=[];for(const a of t)if(n[a]){const t=r?e.aB(n[a]):n[a];i.push(t)}return i}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const r of e){const e=this._layers[r];"custom"!==e.type&&(t[r]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const 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;const r=this._changed;if(r){const e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const n={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(const e of this._order){const r=this._layers[e];r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const t in n){const r=this.sourceCaches[t];!!n[t]!=!!r.used&&r.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,r&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,r={}){var n;this._checkLoaded();const i=this.serialize();if(t=r.transformStyle?r.transformStyle(i,t):t,(null===(n=r.validate)||void 0===n||n)&&he(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);const a=e.aC(i,t),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(const t of o.operations)t();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const e=[],r=[];for(const n of t)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":e.push((()=>{}));break;default:r.push(n.command)}return{operations:e,unimplemented:r}}addImage(t,r){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r,n={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.u.source,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=this.sourceCaches[t]=new ft(t,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:t}))),i.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));const r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const r=this.sourceCaches[t].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,r,n={}){this._checkLoaded();const i=t.id;if(this.getLayer(i))return void this.fire(new e.j(new Error(`Layer "${i}" already exists on this map.`)));let a;if("custom"===t.type){if(he(this,e.aD(t)))return;a=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(i,t.source),t=e.aB(t),t=e.e(t,{source:i})),this._validate(e.u.layer,`layers.${i}`,t,{arrayIndex:-1},n))return;a=e.aA(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}const o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.j(new Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){const t=this._removedLayers[i];delete this._removedLayers[i],t.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;const n=this._order.indexOf(t);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${r}".`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const r=this._layers[t];if(!r)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));r.setEventedParent(null);const n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,r,n){this._checkLoaded();const i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r,n={}){this._checkLoaded();const i=this.getLayer(t);if(i){if(!e.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=e.aB(r),this._updateLayer(i)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,r,n,i={}){this._checkLoaded();const a=this.getLayer(t);a?e.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){const n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,n,i={}){this._checkLoaded();const a=this.getLayer(t);a?e.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,r){this._checkLoaded();const n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));const o=a.getSource().type;"geojson"===o&&i?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,r){this._checkLoaded();const n=t.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));const a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.aF(this.sourceCaches,(t=>t.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return e.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:t,layers:r,terrain:n},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,r={},n=[];for(let i=this._order.length-1;i>=0;i--){const a=this._order[i];if(e(a)){r[a]=i;for(const e of t){const t=e[a];if(t)for(const e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const i=[];for(let a=this._order.length-1;a>=0;a--){const o=this._order[a];if(e(o))for(let t=n.length-1;t>=0;t--){const e=n[t].feature;if(r[e.layer.id]{const n=r.featureSortOrder;if(n){const r=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(const t of i)e.push(t)}}for(const e in s)s[e].forEach((n=>{const i=n.feature,a=r[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}));return s}(this._layers,o,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",r.filter,null,r);const n=this.sourceCaches[t];return n?function(t,e){const r=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],i={};for(let t=0;tt.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const n=this.crossTileSymbolIndex.addLayer(r,l[r.source],t.center.lng);o=o||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),t.zoom))&&(this.pauseablePlacement=new ae(t,this.map.terrain,this._order,i,e,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,r){return e._(this,void 0,void 0,(function*(){const t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,r.icons),t}))}getGlyphs(t,r){return e._(this,void 0,void 0,(function*(){const t=yield this.glyphManager.getGlyphs(r.stacks),e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,r={}){this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,r,n={},i){this._checkLoaded();const a=[{id:t,url:r}],o=[..._(this.stylesheet.sprite),...a];this._validate(e.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(t){this._checkLoaded();const r=_(this.stylesheet.sprite);if(r.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;r.splice(r.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return _(this.stylesheet.sprite)}setSprite(t,r={},n){this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,r)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}var de=e.Y([{name:"a_pos",type:"Int16",components:2}]);const me={prelude:ge("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:ge("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ge("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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:ge("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:ge("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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:ge("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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:ge("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:ge("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:ge("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:ge("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:ge("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:ge("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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:ge("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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:ge("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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\n? a_pos\n: 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:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:ge("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:ge("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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:ge("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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:ge("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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:ge("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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:ge("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:ge("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:ge("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:ge("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 ge(t,e){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,((t,e,r,n,i)=>(s[i]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:e=e.replace(r,((t,e,r,n,i)=>{const a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class ye{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,r,n,i,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t({u_matrix:t,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function xe(t){const e=[];for(let r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const we=(t,r,n,i)=>{const a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=(c=new e.A(9),e.A!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[5]=0,c[6]=0,c[7]=0),c[0]=1,c[4]=1,c[8]=1,c);var c;"viewport"===a.properties.get("anchor")&&function(t,e){var r=Math.sin(e),n=Math.cos(e);t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-r.transform.angle),function(t,e,r){var n=e[0],i=e[1],a=e[2];t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);const u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Te=(t,r,n,i,a,o,s)=>e.e(we(t,r,n,i),be(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ke=t=>({u_matrix:t}),Ae=(t,r,n,i)=>e.e(ke(t),be(n,r,i)),Me=(t,e)=>({u_matrix:t,u_world:e}),Se=(t,r,n,i,a)=>e.e(Ae(t,r,n,i),{u_world:a}),Ee=(t,e,r,n)=>{const i=t.transform;let a,o;if("map"===n.paint.get("circle-pitch-alignment")){const t=jt(r,1,i.zoom);a=!0,o=[t,t]}else a=!1,o=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:o}},Ce=(t,e,r)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ie=(t,e,r=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}),Le=t=>({u_matrix:t}),Pe=(t,e,r,n)=>({u_matrix:t,u_extrude_scale:jt(e,1,r),u_intensity:n}),ze=(t,r,n,i)=>{const a=e.H();e.aP(a,0,t.width,t.height,0,0,1);const o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function De(t,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.Z(0,i/n).toLngLat().lat,new e.Z(0,(i+1)/n).toLngLat().lat]}const Oe=(t,e,r,n)=>{const i=t.transform;return{u_matrix:Ne(t,e,r,n),u_ratio:1/jt(e,1,i.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Re=(t,r,n,i,a)=>e.e(Oe(t,r,n,a),{u_image:0,u_image_height:i}),Fe=(t,e,r,n,i)=>{const a=t.transform,o=Be(e,a);return{u_matrix:Ne(t,e,r,i),u_texsize:e.imageAtlasTexture.size,u_ratio:1/jt(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},je=(t,r,n,i,a,o)=>{const s=t.lineAtlas,l=Be(r,t.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return e.e(Oe(t,r,n,o),{u_patternscale_a:[l/f,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Be(t,e){return 1/jt(t,1,e.tileZoom)}function Ne(t,e,r,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Ue=(t,e,r,n,i)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ve(i.paint.get("raster-hue-rotate"))};var a,o};function Ve(t){t*=Math.PI/180;const e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}const qe=(t,e,r,n,i,a,o,s,l,c,u,h,f,p)=>{const d=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:d.width/d.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:f,u_texture:0,u_translation:u,u_pitched_scale:p}},He=(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m)=>{const g=s.transform;return e.e(qe(t,r,n,i,a,o,s,l,c,u,h,f,p,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+d})},Ge=(t,r,n,i,a,o,s,l,c,u,h,f,p,d)=>e.e(He(t,r,n,i,a,o,s,l,c,u,h,!0,f,!0,d),{u_texsize_icon:p,u_texture_icon:1}),Ze=(t,e,r)=>({u_matrix:t,u_opacity:e,u_color:r}),We=(t,r,n,i,a,o)=>e.e(function(t,e,r,n){const i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/jt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:t,u_opacity:r}),Ye={fillExtrusion:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_opacity:new e.aI(t,r.u_opacity)}),fillExtrusionPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_height_factor:new e.aI(t,r.u_height_factor),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade),u_opacity:new e.aI(t,r.u_opacity)}),fill:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),fillPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),fillOutline:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world)}),fillOutlinePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),circle:(t,r)=>({u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,r.u_scale_with_map),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_extrude_scale:new e.aO(t,r.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_matrix:new e.aJ(t,r.u_matrix)}),collisionBox:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_pixel_extrude_scale:new e.aO(t,r.u_pixel_extrude_scale)}),collisionCircle:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_inv_matrix:new e.aJ(t,r.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_viewport_size:new e.aO(t,r.u_viewport_size)}),debug:(t,r)=>({u_color:new e.aL(t,r.u_color),u_matrix:new e.aJ(t,r.u_matrix),u_overlay:new e.aH(t,r.u_overlay),u_overlay_scale:new e.aI(t,r.u_overlay_scale)}),clippingMask:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),heatmap:(t,r)=>({u_extrude_scale:new e.aI(t,r.u_extrude_scale),u_intensity:new e.aI(t,r.u_intensity),u_matrix:new e.aJ(t,r.u_matrix)}),heatmapTexture:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_color_ramp:new e.aH(t,r.u_color_ramp),u_opacity:new e.aI(t,r.u_opacity)}),hillshade:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_latrange:new e.aO(t,r.u_latrange),u_light:new e.aO(t,r.u_light),u_shadow:new e.aL(t,r.u_shadow),u_highlight:new e.aL(t,r.u_highlight),u_accent:new e.aL(t,r.u_accent)}),hillshadePrepare:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_dimension:new e.aO(t,r.u_dimension),u_zoom:new e.aI(t,r.u_zoom),u_unpack:new e.aK(t,r.u_unpack)}),line:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels)}),lineGradient:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_image:new e.aH(t,r.u_image),u_image_height:new e.aI(t,r.u_image_height)}),linePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texsize:new e.aO(t,r.u_texsize),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_image:new e.aH(t,r.u_image),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),lineSDF:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_patternscale_a:new e.aO(t,r.u_patternscale_a),u_patternscale_b:new e.aO(t,r.u_patternscale_b),u_sdfgamma:new e.aI(t,r.u_sdfgamma),u_image:new e.aH(t,r.u_image),u_tex_y_a:new e.aI(t,r.u_tex_y_a),u_tex_y_b:new e.aI(t,r.u_tex_y_b),u_mix:new e.aI(t,r.u_mix)}),raster:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_tl_parent:new e.aO(t,r.u_tl_parent),u_scale_parent:new e.aI(t,r.u_scale_parent),u_buffer_scale:new e.aI(t,r.u_buffer_scale),u_fade_t:new e.aI(t,r.u_fade_t),u_opacity:new e.aI(t,r.u_opacity),u_image0:new e.aH(t,r.u_image0),u_image1:new e.aH(t,r.u_image1),u_brightness_low:new e.aI(t,r.u_brightness_low),u_brightness_high:new e.aI(t,r.u_brightness_high),u_saturation_factor:new e.aI(t,r.u_saturation_factor),u_contrast_factor:new e.aI(t,r.u_contrast_factor),u_spin_weights:new e.aN(t,r.u_spin_weights)}),symbolIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolSDF:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolTextAndIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texsize_icon:new e.aO(t,r.u_texsize_icon),u_texture:new e.aH(t,r.u_texture),u_texture_icon:new e.aH(t,r.u_texture_icon),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),background:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_color:new e.aL(t,r.u_color)}),backgroundPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_image:new e.aH(t,r.u_image),u_pattern_tl_a:new e.aO(t,r.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,r.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,r.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,r.u_pattern_br_b),u_texsize:new e.aO(t,r.u_texsize),u_mix:new e.aI(t,r.u_mix),u_pattern_size_a:new e.aO(t,r.u_pattern_size_a),u_pattern_size_b:new e.aO(t,r.u_pattern_size_b),u_scale_a:new e.aI(t,r.u_scale_a),u_scale_b:new e.aI(t,r.u_scale_b),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,r.u_tile_units_to_pixels)}),terrain:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_ele_delta:new e.aI(t,r.u_ele_delta),u_fog_matrix:new e.aJ(t,r.u_fog_matrix),u_fog_color:new e.aL(t,r.u_fog_color),u_fog_ground_blend:new e.aI(t,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,r.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon_fog_blend:new e.aI(t,r.u_horizon_fog_blend)}),terrainDepth:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ele_delta:new e.aI(t,r.u_ele_delta)}),terrainCoords:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_terrain_coords_id:new e.aI(t,r.u_terrain_coords_id),u_ele_delta:new e.aI(t,r.u_ele_delta)}),sky:(t,r)=>({u_sky_color:new e.aL(t,r.u_sky_color),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon:new e.aI(t,r.u_horizon),u_sky_horizon_blend:new e.aI(t,r.u_sky_horizon_blend)})};class Xe{constructor(t,e,r){this.context=t;const n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const $e={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ke{constructor(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;const i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.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}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let r=0;r0){const r=e.H();e.aQ(r,m.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(r,r,m.placementViewportMatrix),c.push({circleArray:y,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=y.length/4,h=u}g&&l.draw(o,s.LINES,Br.disabled,Ur.disabled,t.colorModeForRenderPass(),Vr.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(f=t.transform).width,1/f.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}var f;if(!a||!c.length)return;const p=t.useProgram("collisionCircle"),d=new e.aR;d.resize(4*u),d._trim();let m=0;for(const t of c)for(let e=0;e=0&&(v[x.associatedIconIndex]={shiftedAnchor:I,angle:L})}else Dt(x.numGlyphs,g)}if(u){y.clear();const r=t.icon.placedSymbolArray;for(let t=0;tt.style.map.terrain.getElevation(l,e,r):null,r="map"===n.layout.get("text-rotation-alignment");Tt(c,l.posMatrix,t,a,N,V,v,u,r,g,l.toUnwrapped(),m.width,m.height,q,e)}const Z=l.posMatrix,W=a&&A||G,Y=x||W?Gr:N,X=U,$=p&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let K;K=p?c.iconsInText?Ge(k.kind,I,_,v,x,W,t,Z,Y,X,q,P,R,S):He(k.kind,I,_,v,x,W,t,Z,Y,X,q,a,P,!0,S):qe(k.kind,I,_,v,x,W,t,Z,Y,X,q,a,P,S);const J={program:C,buffers:h,uniformValues:K,atlasTexture:z,atlasTextureIcon:F,atlasInterpolation:D,atlasInterpolationIcon:O,isSDF:p,hasHalo:$};if(w&&c.canOverlap){T=!0;const t=h.segments.get();for(const r of t)M.push({segments:new e.a0([r]),sortKey:r.sortKey,state:J,terrainData:L})}else M.push({segments:h.segments,sortKey:0,state:J,terrainData:L})}T&&M.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of M){const r=e.state;if(p.activeTexture.set(d.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,d.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Kr(r.buffers,e.segments,n,t,r.program,k,h,f,i,e.terrainData)),i.u_is_halo=0}Kr(r.buffers,e.segments,n,t,r.program,k,h,f,r.uniformValues,e.terrainData)}}function Kr(t,e,r,n,i,a,o,s,l,c){const u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Vr.disabled,l,c,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Jr(t,r,n,i){const a=t.context,o=a.gl,s=Ur.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;const u=i.key;let h=n.heatmapFbos.get(u);h||(h=tn(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:e.aM.transparent});const f=c.programConfigurations.get(n.id),p=t.useProgram("heatmap",f),d=t.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,Br.disabled,s,l,Vr.disabled,Pe(i.posMatrix,r,t.transform.zoom,n.paint.get("heatmap-intensity")),d,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,t.transform.zoom,f)}function Qr(t,e,r){const n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());const a=en(n,e),o=r.key,s=e.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Br.disabled,Ur.disabled,t.colorModeForRenderPass(),Vr.disabled,ze(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),s.destroy(),e.heatmapFbos.delete(o))}function tn(t,e,r){var n,i;const a=t.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const s=null!==(n=t.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=t.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,e,r,0,a.RGBA,s,null);const c=t.createFramebuffer(e,r,!1,!1);return c.colorAttachment.set(o),c}function en(t,e){return e.colorRampTexture||(e.colorRampTexture=new w(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function rn(t,e,r,n,i){if(!r||!n||!n.imageAtlas)return;const a=n.imageAtlas.patternPositions;let o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){const t=i.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function nn(t,e,r,n,i,a,o){const s=t.context.gl,l="fill-pattern",c=r.paint.get(l),u=c&&c.constantOr(1),h=r.getCrossfadeParameters();let f,p,d,m,g;o?(p=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",f=s.LINES):(p=u?"fillPattern":"fill",f=s.TRIANGLES);const y=c.constantOr(null);for(const c of n){const n=e.getTile(c);if(u&&!n.patternsLoaded())continue;const v=n.getBucket(r);if(!v)continue;const x=v.programConfigurations.get(r.id),_=t.useProgram(p,x),b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c);u&&(t.context.activeTexture.set(s.TEXTURE0),n.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),x.updatePaintBuffers(h)),rn(x,l,y,n,r);const w=b?c:null,T=t.translatePosMatrix(w?w.posMatrix:c.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){m=v.indexBuffer2,g=v.segments2;const e=[s.drawingBufferWidth,s.drawingBufferHeight];d="fillOutlinePattern"===p&&u?Se(T,t,h,n,e):Me(T,e)}else m=v.indexBuffer,g=v.segments,d=u?Ae(T,t,h,n):ke(T);_.draw(t.context,f,i,t.stencilModeForClipping(c),a,Vr.disabled,d,b,r.id,v.layoutVertexBuffer,m,g,r.paint,t.transform.zoom,x)}}function an(t,e,r,n,i,a,o){const s=t.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=u.constantOr(null);for(const u of n){const n=e.getTile(u),m=n.getBucket(r);if(!m)continue;const g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(u),y=m.programConfigurations.get(r.id),v=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(f)),rn(y,c,d,n,r);const x=t.translatePosMatrix(u.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),_=r.paint.get("fill-extrusion-vertical-gradient"),b=h?Te(x,t,_,p,u,f,n):we(x,t,_,p);v.draw(s,s.gl.TRIANGLES,i,a,o,Vr.backCCW,b,g,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,t.transform.zoom,y,t.style.map.terrain&&m.centroidVertexBuffer)}}function on(t,e,r,n,i,a,o){const s=t.context,l=s.gl,c=r.fbo;if(!c)return;const u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,Vr.disabled,((t,e,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);const l=!t.options.moving;return{u_matrix:n?n.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:De(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(t,r,n,h?e:null),h,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function sn(t,r,n,i,a,o){const s=t.context,l=s.gl,c=r.dem;if(c&&c.data){const u=c.dim,h=c.stride,f=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){const t=r.demTexture;t.update(f,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new w(s,f,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){const t=new w(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=s.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Vr.disabled,((t,r)=>{const n=r.stride,i=e.H();return e.aP(i,0,e.X,-e.X,0,0,1),e.J(i,i,[0,-e.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(t,r,n,i,o,s){const l=i.paint.get("raster-fade-duration");if(!s&&l>0){const i=a.now(),s=(i-t.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),p=f&&t.refreshedUponExpiration?1:e.ac(f?s:1-c,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const cn=new e.aM(1,0,0,1),un=new e.aM(0,1,0,1),hn=new e.aM(0,0,1,1),fn=new e.aM(1,0,1,1),pn=new e.aM(0,1,1,1);function dn(t,e,r,n){gn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){gn(t,e-r/2,0,r,t.transform.height,n)}function gn(t,e,r,n,i,a){const o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio,i*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function yn(t,r,n){const i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Br.disabled,c=Ur.disabled,u=t.colorModeForRenderPass(),h="$debug",f=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);const p=r.getTileByID(n.key).latestRawTileData,d=Math.floor((p&&p.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5;let y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${y} ${d}kB`),s.draw(i,a.TRIANGLES,l,c,Fr.alphaBlended,Vr.disabled,Ie(o,e.aM.transparent,g),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,Vr.disabled,Ie(o,e.aM.red),f,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function vn(t,e,r){const n=t.context,i=n.gl,a=t.colorModeForRenderPass(),o=new Br(i.LEQUAL,Br.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]);for(const c of r){const r=t.renderToTexture.getTexture(c),u=e.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);const h=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),f=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(c.tileID.toUnwrapped()),d=ve(h,f,p,t.style.sky,t.transform.pitch);s.draw(n,i.TRIANGLES,o,Ur.disabled,a,Vr.backCCW,d,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class xn{constructor(t,e,r){this.vertexBuffer=t,this.indexBuffer=e,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class _n{constructor(t,r){this.context=new jr(t),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ft.maxUnderzooming+ft.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ue}resize(t,e,r){if(this.width=Math.floor(t*r),this.height=Math.floor(e*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style._order)this.style._layers[t].resize()}setup(){const t=this.context,r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(r,de.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const n=new e.aX;n.emplaceBack(0,0),n.emplaceBack(e.X,0),n.emplaceBack(0,e.X),n.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(n,de.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const i=new e.$;i.emplaceBack(0,0,0,0),i.emplaceBack(e.X,0,e.X,0),i.emplaceBack(0,e.X,0,e.X),i.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(i,Q.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,de.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const o=new e.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);const s=new e.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const l=this.context.gl;this.stencilClearMode=new Ur({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=e.H();e.aP(n,0,this.width,this.height,0,0,1),e.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Br.disabled,this.stencilClearMode,Fr.disabled,Vr.disabled,Le(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;const r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Fr.disabled),r.setDepthMode(Br.disabled);const i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of e){const e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);i.draw(r,n.TRIANGLES,Br.disabled,new Ur({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),Fr.disabled,Vr.disabled,Le(t.posMatrix),a,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new Ur({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new Ur({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,r=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const t={};for(let r=0;r=0;this.currentLayer--){const t=this.style._layers[n[this.currentLayer]],e=i[t.source],r=o[t.source];this._renderTileClippingMasks(t,r),this.renderLayer(this,e,t,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerr.source&&!r.isHidden(e)?[t.sourceCaches[r.source]]:[])),i=n.filter((t=>"vector"===t.getSource().type)),a=n.filter((t=>"vector"!==t.getSource().type)),o=t=>{(!r||r.getSource().maxzoomo(t))),r||a.forEach((t=>o(t))),r}(this.style,this.transform.zoom);t&&function(t,e,r){for(let n=0;n0),i&&(e.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){const n=t.context,i=n.gl,a=Fr.unblended,o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1});for(const e of l){const l=r.getTerrainData(e.tileID),u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};c.draw(n,i.TRIANGLES,o,Ur.disabled,a,Vr.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,r){const n=t.context,i=n.gl,a=Fr.unblended,o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1}),r.coordsIndex=[];for(const e of c){const c=r.getTerrainData(e.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);const h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};u.draw(n,i.TRIANGLES,o,Ur.disabled,a,Vr.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(e.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,r,n,i,a){if("translucent"!==t.renderPass)return;const o=Ur.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,r,n,i,a,o,s,l,c){const u=r.transform,h=ne(),f="map"===a,p="map"===o;for(const a of t){const t=i.getTile(a),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const d=e.ag(o.textSizeData,u.zoom),m=jt(t,1,r.transform.zoom),g=vt(a.posMatrix,p,f,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(d){const e=Math.pow(2,u.zoom-t.tileID.overscaledZ),n=r.style.map.terrain?(t,e)=>r.style.map.terrain.getElevation(a,t,e):null,i=h.translatePosition(u,t,s,l);Yr(o,f,p,c,u,g,a.posMatrix,e,d,y,h,i,a.toUnwrapped(),n)}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&$r(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&$r(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Hr(t,r,n,i,!0),Hr(t,r,n,i,!1))}(t,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(t,r,n,i){if("translucent"!==t.renderPass)return;const a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.depthModeForSublayer(0,Br.ReadOnly),f=Ur.disabled,p=t.colorModeForRenderPass(),d=[];for(let a=0;at.sortKey-e.sortKey));for(const e of d){const{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;i.draw(c,u.TRIANGLES,h,f,p,Vr.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,r)}}(t,r,n,i);break;case"heatmap":!function(t,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;const a=t.context;if(t.style.map.terrain){for(const e of i){const i=r.getTile(e);r.hasRenderableParent(e)||("offscreen"===t.renderPass?Jr(t,i,n,e):"translucent"===t.renderPass&&Qr(t,n,e))}a.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,r,n,i){const a=t.context,o=a.gl,s=Ur.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,r,n){const i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(e.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=tn(t,r.width/4,r.height/4),n.heatmapFbos.set(e.aU,a))})(a,t,n),a.clear({color:e.aM.transparent});for(let e=0;e20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);const _=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n),b=_?n:null,w=b?b.posMatrix:t.transform.calculatePosMatrix(n.toUnwrapped(),f),T=Ue(w,v||[0,0],y||1,g,r);o instanceof tt?s.draw(i,a.TRIANGLES,u,Ur.disabled,l,Vr.disabled,T,_,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,u,c[n.overscaledZ],l,Vr.disabled,T,_,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,r,n,i);break;case"background":!function(t,e,r,n){const i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const o=t.context,s=o.gl,l=t.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(t.isPatternMissing(u))return;const h=!u&&1===i.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;const f=Ur.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Br.ReadWrite:Br.ReadOnly),d=t.colorModeForRenderPass(),m=t.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));const y=r.getCrossfadeParameters();for(const e of g){const l=n?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),h=u?We(l,a,t,u,{tileID:e,tileSize:c},y):Ze(l,a,i),g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);m.draw(o,s.TRIANGLES,p,f,d,Vr.disabled,h,g,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,i);break;case"custom":!function(t,e,r){const n=t.context,i=r.implementation;if("offscreen"===t.renderPass){const e=i.prerender;e&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),e.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Ur.disabled);const e="3d"===i.renderingMode?new Br(t.context.gl.LEQUAL,Br.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Br.ReadOnly);n.setDepthMode(e),i.render(n.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}(t,0,n)}}translatePosMatrix(t,r,n,i,a){if(!n[0]&&!n[1])return t;const o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){const t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}const s=[a?n[0]:jt(r,n[0],this.transform.zoom),a?n[1]:jt(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,s),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r}useProgram(t,e){this.cache=this.cache||{};const r=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new _e(this.context,me[t],e,Ye[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new w(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class bn{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,r,n){const i=Math.pow(2,n),a=[[-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((n=>{const a=1/(n=e.af([],n,t))[3]/r*i;return e.b1(n,n,[a,a,1/n[3],a])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}([],(n=[],i=y([],a[t[0]],a[t[1]]),o=y([],a[t[2]],a[t[1]]),s=i[0],l=i[1],c=i[2],u=o[0],h=o[1],f=o[2],n[0]=l*f-c*h,n[1]=c*u-s*f,n[2]=s*h-l*u,n)),r=-((p=e)[0]*(d=a[t[1]])[0]+p[1]*d[1]+p[2]*d[2]);var n,i,o,s,l,c,u,h,f,p,d;return e.concat(r)}));return new bn(a,o)}}class wn{constructor(t,e){var r,n,i;this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(t){const e=[t%2==0,t<2],r=m(this.min),n=m(this.max);for(let t=0;t=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;ithis.max[e]-this.min[e])return 0}return 1}}class Tn{constructor(t=0,e=0,r=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.y.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.y.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.y.number(t.right,r.right,n)),this}getCenter(t,r){const n=e.ac((this.left+t-this.right)/2,0,t),i=e.ac((this.top+r-this.bottom)/2,0,r);return new e.P(n,i)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Tn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const kn=85.051129;class An{constructor(t,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new An(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.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.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){void 0===t?t=!0:null===t&&(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 e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const r=-e.b3(t,-180,180)*Math.PI/180;var n;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new e.A(4),e.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const r=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,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){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),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,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){const r=[new e.b4(0,t)];if(this._renderWorldCopies){const n=this.pointCoordinate(new e.P(0,0)),i=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let n=s-c;n<=l+c;n++)0!==n&&r.push(new e.b4(n,t))}return r}coveringTiles(t){var r,n;let i=this.coveringZoomLevel(t);const a=i;if(void 0!==t.minzoom&&it.maxzoom&&(i=t.maxzoom);const o=this.pointCoordinate(this.getCameraPoint()),s=e.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i);let f=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(f=i);const p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,d=t=>({aabb:new wn([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],g=[],y=i,v=t.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(d(-t)),m.push(d(t));for(m.push(d(0));m.length>0;){const i=m.pop(),a=i.x,o=i.y;let s=i.fullyVisible;if(!s){const t=i.aabb.intersects(h);if(0===t)continue;s=2===t}const l=t.terrain?c:u,d=i.aabb.distanceX(l),_=i.aabb.distanceY(l),b=Math.max(Math.abs(d),Math.abs(_));if(i.zoom===y||b>p+(1<=f){const t=y-i.zoom,r=c[0]-.5-(a<>1),h=i.zoom+1;let f=i.aabb.quadrant(l);if(t.terrain){const a=new e.S(h,i.wrap,h,c,u),o=t.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,l=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;f=new wn([f.min[0],f.min[1],s],[f.max[0],f.max[1],l])}m.push({aabb:f,zoom:h,x:c,y:u,wrap:i.wrap,fullyVisible:s})}}return g.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],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){const r=e.ac(t.lat,-85.051129,kn);return new e.P(e.O(t.lng)*this.worldSize,e.Q(r)*this.worldSize)}unproject(t){return new e.Z(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){const r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;const o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/e.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(t,r){const n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,r){if(r){const e=r.pointCoordinate(t);if(null!=e)return e}const n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(i,i,this.pixelMatrixInverse);const a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new e.Z(e.y.number(n[0]/a,i[0]/o,h)/this.worldSize,e.y.number(s,l,h)/this.worldSize)}coordinatePoint(t,r=0,n=this.pixelMatrix){const i=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.af(i,i,n),new e.P(i[0]/i[3],i[1]/i[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([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=[-85.051129,kn])}calculateTileMatrix(t){const r=t.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*t.wrap,a=e.an(new Float64Array(16));return e.J(a,a,[i*n,r.y*n,0]),e.K(a,a,[n/e.X,n/e.X,1]),a}calculatePosMatrix(t,r=!1){const n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];const a=this.calculateTileMatrix(t);return e.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(t){const r=t.key,n=this._fogMatrixCache;if(n[r])return n[r];const i=this.calculateTileMatrix(t);return e.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,r){r=e.ac(+r,this.minZoom,this.maxZoom);const n={center:new e.N(t.lng,t.lat),zoom:r};let i=this.lngRange;if(!this._renderWorldCopies&&null===i){const t=180-1e-10;i=[-t,t]}const a=this.tileSize*this.zoomScale(n.zoom);let o=0,s=a,l=0,c=a,u=0,h=0;const{x:f,y:p}=this.size;if(this.latRange){const t=this.latRange;o=e.Q(t[1])*a,s=e.Q(t[0])*a,s-os&&(y=s-t)}if(i){const t=(l+c)/2;let r=d;this._renderWorldCopies&&(r=e.b3(d,t-a/2,t+a/2));const n=f/2;r-nc&&(g=c-n)}if(void 0!==g||void 0!==y){const t=new e.P(null!=g?g:d,null!=y?y:m);n.center=this.unproject.call({worldSize:a},t).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=r,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let i=e.an(new Float64Array(16));e.K(i,i,[this.width/2,-this.height/2,1]),e.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=e.an(new Float64Array(16)),e.K(i,i,[1,-1,1]),e.J(i,i,[-1,-1,0]),e.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),h=Math.sin(u)*l/Math.sin(e.ac(Math.PI-c-u,.01,Math.PI-.01)),f=this.getHorizon(),p=2*Math.atan(f/this.cameraToCenterDistance)*(.5+t.y/(2*f)),d=Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(h,d);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),e.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.projectionMatrix=e.ae(i),e.K(i,i,[1,-1,1]),e.J(i,i,[0,0,-this.cameraToCenterDistance]),e.b7(i,i,this._pitch),e.ad(i,i,this.angle),e.J(i,i,[-r,-n,0]),this.mercatorMatrix=e.K([],i,[this.worldSize,this.worldSize,this.worldSize]),e.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,i),e.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=e.as([],i),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,i);const g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),_=r-Math.round(r)+v*g+x*y,b=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(e.J(w,w,[_>.5?_-1:_,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,i=e.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new e.P(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){const r=this.getCameraPoint();if(1===t.length)return[t[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(const e of t)n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,i),new e.P(a,i),new e.P(a,o),new e.P(n,o),new e.P(n,i)]}}lngLatToCameraDepth(t,r){const n=this.locationCoordinate(t),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return e.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Mn(t,e){let r,n=!1,i=null,a=null;const o=()=>{i=null,n&&(t.apply(a,r),i=setTimeout(o,e),n=!1)};return(...t)=>(n=!0,a=this,r=t,i||o(),i)}class Sn{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let r=e;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${e}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Mn(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===t?(e=!0,`${n}=${c}`):r})).filter((t=>t));return e||r.push(`${t}=${c}`),`#${r.join("&")}`}return`#${c}`}}const En={linearity:.3,easing:e.b8(0,0,.3,1)},Cn=e.e({deceleration:2500,maxSpeed:1400},En),In=e.e({deceleration:20,maxSpeed:1400},En),Ln=e.e({deceleration:1e3,maxSpeed:360},En),Pn=e.e({deceleration:1e3,maxSpeed:90},En);class zn{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=a.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const a=On(r.pan.mag(),n,e.e({},Cn,t||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,Dn(i,a)}if(r.zoom){const t=On(r.zoom,n,In);i.zoom=this._map.transform.zoom+t.amount,Dn(i,t)}if(r.bearing){const t=On(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),Dn(i,t)}if(r.pitch){const t=On(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+t.amount,Dn(i,t)}if(i.zoom||i.bearing){const t=void 0===r.pinchAround?r.around:r.pinchAround;i.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(i,{noMoveStart:!0})}}function Dn(t,e){(!t.duration||t.durationr.unproject(t))),l=a.reduce(((t,e,r,n)=>t.add(e.div(n.length))),new e.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class jn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,r){super(t,{originalEvent:r}),this._defaultPrevented=!1}}class Bn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new jn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Rn(t.type,this._map,t))}mouseup(t){this._map.fire(new Rn(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Rn(t.type,this._map,t))}mouseover(t){this._map.fire(new Rn(t.type,this._map,t))}mouseout(t){this._map.fire(new Rn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Fn(t.type,this._map,t))}touchmove(t){this._map.fire(new Fn(t.type,this._map,t))}touchend(t){this._map.fire(new Fn(t.type,this._map,t))}touchcancel(t){this._map.fire(new Fn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Rn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{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(e.P.convert(t),this._map.terrain)}}class Vn{constructor(t,e){this._map=t,this._tr=new Un(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const r=e;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)t.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.k(t,{originalEvent:r}))}}function qn(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const r={};for(let n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const r=new e.P(0,0);for(const e of t)r._add(e);return r.div(t.length)}(r),this.touches=qn(n,r)))}touchmove(t,e,r){if(this.aborted||!this.centroid)return;const n=qn(r,e);for(const t in this.touches){const e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class Gn{constructor(t){this.singleTap=new Hn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,r){this.singleTap.touchstart(t,e,r)}touchmove(t,e,r){this.singleTap.touchmove(t,e,r)}touchend(t,e,r){const n=this.singleTap.touchend(t,e,r);if(n){const e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Zn{constructor(t){this._tr=new Un(t),this._zoomIn=new Gn({numTouches:1,numTaps:2}),this._zoomOut=new Gn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)}touchmove(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)}touchend(t,e,r){const n=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):i?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{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 Wn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const n=e.length?e[0]:e;return!this._moved&&n.dist(r){t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Jn=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{const n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Kn})},Qn=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{const n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Kn})};class ti{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,r){return this._calculateTransform(t,e,r)}touchmove(t,e,r){if(this._active){if(!this._shouldBePrevented(r.length))return t.preventDefault(),this._calculateTransform(t,e,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,r){this._calculateTransform(t,e,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);const i=qn(n,r),a=new e.P(0,0),o=new e.P(0,0);let s=0;for(const t in i){const e=i[t],r=this._touches[t];r&&(a._add(e),o._add(e.sub(r)),s++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;const l=o.div(s);return this._sum._add(l),this._sum.mag()Math.abs(t.x)}class li extends ei{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,r){super.touchstart(t,e,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,si(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,r){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,i=e.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const a=t.y>0==e.y>0;return si(t)&&si(e)&&a}}const ci={panStep:100,bearingStep:15,pitchStep:10};class ui{constructor(t){this._tr=new Un(t);const e=ci;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{const s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.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 hi(t){return t*(2-t)}const fi=4.000244140625;class pi{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Un(t),this._triggerRenderFrame=e,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||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%fi==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,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);const r=o.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?e.N.convert(this._aroundCenter?n.center:n.unproject(r)):e.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>fi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:t.zoom,n=this._startZoom,i=this._easing;let o,s=!1;const l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&n&&i&&l){const t=Math.min(l/200,1),a=i(t);o=e.y.number(n,r,a),t<1?this._frameId||(this._frameId=!0):s=!0}else o=r,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.b9;if(this._prevEase){const t=this._prevEase,n=(a.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:t,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 mi{constructor(t){this._tr=new Un(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(){this._tap=new Gn({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,e,r){if(!this._swipePoint)if(this._tapTime){const n=e[0],i=t.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,e,r)}touchmove(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)}touchend(t,e,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{const n=this._tap.touchend(t,e,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yi{constructor(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}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 vi{constructor(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}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 xi{constructor(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,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()}}class _i{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);const i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.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(t){return t[this._bypassKey]}notifyGestureBlocked(t,r){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const bi=t=>t.zoom||t.drag||t.pitch||t.rotate;class wi extends e.k{}function Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class ki{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},i={},a={},s=t.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),t);for(const{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,u,o)?s.reset():s[e||t.type]&&(h=s[e||t.type](t,c,l),this.mergeHandlerResult(n,i,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}const u={};for(const t in this._previousActiveHandlers)a[t]||(u[t]=r);this._previousActiveHandlers=a,(Object.keys(u).length||Ti(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||Ti(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[t,e,r]of this._listeners)o.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(const[t,e,r]of this._listeners)o.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){const e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Bn(e,t));const n=e.boxZoom=new Vn(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();const i=e.cooperativeGestures=new _i(e,t.cooperativeGestures);this._add("cooperativeGestures",i),t.cooperativeGestures&&i.enable();const a=new Zn(e),s=new mi(e);e.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();const l=new gi;this._add("tapDragZoom",l);const c=e.touchPitch=new li(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);const u=Jn(t),h=Qn(t);e.dragRotate=new vi(t,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();const f=(({enable:t,clickTolerance:e})=>{const r=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&!t.ctrlKey});return new Wn({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:r,enable:t,assignEvents:Kn})})(t),p=new ti(t,e);e.dragPan=new yi(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);const d=new oi,m=new ii;e.touchZoomRotate=new xi(r,m,d,l),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);const g=e.scrollZoom=new pi(e,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);const y=e.keyboard=new ui(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new Nn(e))}_add(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(bi(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,r){for(const n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const r of t)this._el.contains(r.target)&&e.push(r);return e}mergeHandlerResult(t,r,n,i,a){if(!n)return;e.e(t,n);const o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){const t={},r={},n={};for(const[i,a,o]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.e(r,a),e.e(n,o);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,e,r){const n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(Ti(t)||a&&this._terrainMovement))return this._fireEvents(e,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=t;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;const f=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),a?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(f,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(f,u)):i.setLocationAtPoint(f,u),n._applyUpdatedTransform(i),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)}_fireEvents(t,r,n){const i=bi(this._eventsInProgress),o=bi(t),s={};for(const e in t){const{originalEvent:r}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:r}=t[e];this._fireEvent(e,r)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=r[e]||n,l[`${t}end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(n&&h){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=t=>0!==t&&-this._bearingSnap{delete this._frameId,this.handleEvent(new wi("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ai extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{const t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,r,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},r),n)}panTo(t,r,n){return this.easeTo(e.e({center:t},r),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,r,n){return this.easeTo(e.e({zoom:t},r),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,r,n){return this.easeTo(e.e({bearing:t},r),n)}resetNorth(t,r){return this.rotateTo(0,e.e({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(t,e){return Math.abs(this.getBearing()){if(this._zooming&&(i.zoom=e.y.number(o,y,n)),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,f,n),d=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),b)i.setLocationAtPoint(b,w);else{const t=i.zoomScale(i.zoom-o),e=y>o?Math.min(2,_):Math.max(.5,_),r=Math.pow(e,1-n),a=i.unproject(v.add(x.mult(n*r)).mult(t));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,d)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r,e)}),t),this}_prepareEase(t,r,n={}){this._moving=!0,r||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("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.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&r!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(r-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=r}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_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(t){const e=t.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitudethis._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;const r=t.clone();for(const t of e){const e=r.clone(),{center:n,zoom:i,pitch:a,bearing:o,elevation:s}=t(e);n&&(e.center=n),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==o&&(e.bearing=o),void 0!==s&&(e.elevation=s),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),i&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,r){var n;if(!t.essential&&a.prefersReducedMotion){const n=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:i.padding,p=e.P.convert(t.offset);let d=i.centerPoint.add(p);const m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.zoomScale(y-o),x=i.project(m),_=i.project(g).sub(x);let b=t.curve;const w=Math.max(i.width,i.height),T=w/v,k=_.mag();if("minZoom"in t){const r=e.ac(Math.min(t.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);b=Math.sqrt(n/k*2)}const A=b*b;function M(t){const e=(T*T-w*w+(t?-1:1)*A*A*k*k)/(2*(t?T:w)*A*k);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}const C=M(!1);let I=function(t){return E(C)/E(C+b*t)},L=function(t){return w*((E(C)*(S(e=C+b*t)/E(e))-S(C))/A)/k;var e},P=(M(!0)-C)/b;if(Math.abs(k)<1e-6||!isFinite(P)){if(Math.abs(w-T)<1e-6)return this.easeTo(t,r);const e=T0,I=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(f),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{const a=n*P,m=1/I(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,f,n),d=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);const v=1===n?g:i.unproject(x.add(_.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,d),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,r){t=e.b3(t,-180,180);const n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Mi={compact:!0,customAttribution:'MapLibre'};class Si{constructor(t=Mi){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=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.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(){o.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,e){const r=this._map._getUIString(`AttributionControl.${e}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.sourceCaches;for(const r in e){const n=e[r];if(n.used||n.usedForTerrain){const e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,r)=>{for(let n=r+1;n=0)return!1;return!0}));const r=t.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ei{constructor(t={}){this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.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=o.create("div","maplibregl-ctrl");const e=o.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ci{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,r=e?this._queue.concat(e):this._queue;for(const e of r)if(e.id===t)return void(e.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const r of e)if(!r.cancelled&&(r.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ii=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Li extends e.E{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,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];const n={};for(const i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),this._tiles[i.key]=new ct(i,this.tileSize));for(const t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(t){for(const e in this._tiles){const r=this._tiles[e];(!t||r.tileID.equals(t)||r.tileID.isChildOf(t)||t.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const r={};for(const n of this._renderableTilesKeys){const i=this._tiles[n].tileID;if(i.canonical.equals(t.canonical)){const i=t.clone();i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),r[n]=i}else if(i.canonical.isChildOf(t.canonical)){const a=t.clone();a.posMatrix=new Float64Array(16);const o=i.canonical.z-t.canonical.z,s=i.canonical.x-(i.canonical.x>>o<>o<>o;e.aP(a.posMatrix,0,c,0,c,0,1),e.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=a}else if(t.canonical.isChildOf(i.canonical)){const a=t.clone();a.posMatrix=new Float64Array(16);const o=t.canonical.z-i.canonical.z,s=t.canonical.x-(t.canonical.x>>o<>o<>o;e.aP(a.posMatrix,0,e.X,0,e.X,0,1),e.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),e.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(t,e){const r=this.sourceCache._source;let n=t.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(t.scaledTo(n--).key);return i}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter((e=>e.timeAdded>=t))}}class Pi{constructor(t,e,r){this.painter=t,this.sourceCache=new Li(e),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,r,n,i=e.X){var a;if(!(r>=0&&r=0&&nt.canonical.z&&(t.canonical.z>=n?i=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=t.canonical.x-(t.canonical.x>>i<>i<>8<<4|t>>8,r[e+3]=0;const n=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new w(t,n,t.gl.RGBA,{premultiply:!1});return i.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;const f=this._coordsTextureSize,p=(1<t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse))}}const Di={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new zi(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((r=>!t._layers[r].isHidden(e))),this._coordsDescendingInv={};for(const e in t.sourceCaches){this._coordsDescendingInv[e]={};const r=t.sourceCaches[e].getVisibleCoordinates();for(const t of r){const r=this.terrain.sourceCache.getTerrainCoords(t);for(const t in r)this._coordsDescendingInv[e][t]||(this._coordsDescendingInv[e][t]=[]),this._coordsDescendingInv[e][t].push(r[t])}}this._coordsDescendingInvStr={};for(const e of t._order){const r=t._layers[e],n=r.source;if(Di[r.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(const t in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map((t=>t.key)).sort().join()}}for(const t of this._renderableTiles)for(const e in this._coordsDescendingInvStr){const r=this._coordsDescendingInvStr[e][t.tileID.key];r&&r!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const r=t.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Di[r]&&(this._prevType&&Di[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(Di[this._prevType]||Di[r]&&i){this._prevType=r;const t=this._stacks.length-1,i=this._stacks[t]||[];for(const r of this._renderableTiles){if(this.pool.isFull()&&(vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[t]){const e=this.pool.getObjectForId(r.rtt[t].id);if(e.stamp===r.rtt[t].stamp){this.pool.useObject(e);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},Ni={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ui{constructor(t,r,n=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),o.mousePos(this.element,t)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,o.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&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;const i=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Jn({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{const n=new $n;return new Wn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Bi})})({clickTolerance:i,enable:!0}),this.map=t,n&&(this.mousePitch=Qn({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{const n=new $n;return new Wn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Bi})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),o.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),o.disableDrag()}moveMouse(t,e){const r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){const{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(t,e){const r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){const{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}off(){const t=this.element;o.removeEventListener(t,"mousedown",this.mousedown),o.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let Vi;function qi(t,r,n){const i=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),r){const i=new e.N(t.lng-360,t.lat),a=new e.N(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)180;){const e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==i.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:i}const Hi={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 Gi(t,e,r){const n=t.classList;for(const t in Hi)n.remove(`maplibregl-${r}-anchor-${t}`);n.add(`maplibregl-${r}-anchor-${e}`)}class Zi extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{const e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;const r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.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 n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${Hi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.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),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const t of c){const e=o.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.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"),u.appendChild(h);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");const p=o.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),f.appendChild(p);const d=o.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(f),s.appendChild(d),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),Gi(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),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("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),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,r=13.5,n=Math.abs(r)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-r+n)],"bottom-right":[-n,-1*(e-r+n)],left:[r,-1*(e-r)],right:[-r,-1*(e-r)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var r,n;if(!(null===(r=this._map)||void 0===r?void 0:r.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);const s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null===(n=this._popup)||void 0===n?void 0:n.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Yi=0,Xi=!1;const $i={maxWidth:100,unit:"metric"};function Ki(t,e,r){const n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){const r=3.2808*s;r>5280?Ji(e,n,r/5280,t._getUIString("ScaleControl.Miles")):Ji(e,n,r,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ji(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ji(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ji(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ji(t,e,r,n){const i=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r);t.style.width=e*(i/r)+"px",t.innerHTML=`${i} ${n}`}const Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ta=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(t){if(t){if("number"==typeof t){const r=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(r,r),"top-right":new e.P(-r,r),bottom:new e.P(0,-t),"bottom-left":new e.P(r,-r),"bottom-right":new e.P(-r,-r),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const r=e.P.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return ea(new e.P(0,0))}const ra=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Si,t.BoxZoomHandler=Vn,t.CanvasSource=rt,t.CooperativeGesturesHandler=_i,t.DoubleClickZoomHandler=di,t.DragPanHandler=yi,t.DragRotateHandler=vi,t.EdgeInsets=Tn,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.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(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.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()}},t.GeoJSONSource=J,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("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&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const r=new e.N(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.e({bearing:i},this.options.fitBoundsOptions),o=W.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const r=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).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(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Xi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zi({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",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))}))}},this.options=e.e({},Wi,t)}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function*(t=!1){if(void 0!==Vi&&!t)return Vi;if(void 0===window.navigator.permissions)return Vi=!!window.navigator.geolocation,Vi;try{const t=yield window.navigator.permissions.query({name:"geolocation"});Vi="denied"!==t.state}catch(t){Vi=!!window.navigator.geolocation}return Vi}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Yi=0,Xi=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.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(){const t=this._map.getBounds(),e=t.getSouthEast(),r=t.getNorthEast(),n=e.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return e.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 e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Yi--,Xi=!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 e.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 e.k("trackuserlocationstart")),this.fire(new e.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("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Yi++,Yi>1?(t={maximumAge:6e5,timeout:0},Xi=!0):(t=this.options.positionOptions,Xi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}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)}},t.Hash=Sn,t.ImageSource=tt,t.KeyboardHandler=ui,t.LngLatBounds=W,t.LogoControl=Ei,t.Map=class extends Ai{constructor(t){e.bf.mark(e.bg.create);const r=Object.assign(Object.assign({},ji),t);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new An(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("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=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Ri),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new d(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.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})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1;const e=Mn((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{t?e(r):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new Sn("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,e.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Si("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Ei,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,r,n)}resize(t){var r;const n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const e=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,e),this.painter.resize(i,a,e)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);const s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){const{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=t*i,o=e*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(W.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,r){if("mouseenter"===t||"mouseover"===t){let n=!1;const i=i=>{const a=e.filter((t=>this.getLayer(t))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(t,this,i.originalEvent,{features:o}))):n=!1};return{layers:e,listener:r,delegates:{mousemove:i,mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const i=i=>{const a=e.filter((t=>this.getLayer(t)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(t,this,i.originalEvent)))},a=e=>{n&&(n=!1,r.call(this,new Rn(t,this,e.originalEvent)))};return{layers:e,listener:r,delegates:{mousemove:i,mouseout:a}}}{const n=t=>{const n=e.filter((t=>this.getLayer(t))),i=0!==n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];i.length&&(t.features=i,r.call(this,t),delete t.features)};return{layers:e,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,r){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const n=this._delegatedListeners[t];for(let t=0;te.includes(t)))){for(const t in i.delegates)this.off(t,i.delegates[t]);return void n.splice(t,1)}}}on(t,e,r){if(void 0===r)return super.on(t,e);const n=this._createDelegatedListener(t,"string"==typeof e?[e]:e,r);this._saveDelegatedListener(t,n);for(const t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,r){if(void 0===r)return super.once(t,e);const n="string"==typeof e?[e]:e,i=this._createDelegatedListener(t,n,r);for(const e in i.delegates){const a=i.delegates[e];i.delegates[e]=(...e)=>{this._removeDelegatedListener(t,n,r),a(...e)}}this._saveDelegatedListener(t,i);for(const t in i.delegates)this.once(t,i.delegates[t]);return this}off(t,e,r){return void 0===r?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,r),this)}queryRenderedFeatures(t,r){if(!this.style)return[];let n;const i=t instanceof e.P||Array.isArray(t),a=i?t:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{const t=e.P.convert(a[0]),r=e.P.convert(a[1]);n=[t,new e.P(r.x,t.y),r,new e.P(t.x,r.y),t]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,r){return!1!==(r=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));const r=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new pe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,r):this.style.loadJSON(t,e,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){const n=this._requestManager.transformRequest(t,"Style");e.h(n,new AbortController).then((t=>{this._updateDiff(t.data,r)})).catch((t=>{t&&this.fire(new e.j(t))}))}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t,r)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const r=this.style.sourceCaches[t.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&r.reload();for(const r in this.style._layers){const n=this.style._layers[r];"hillshade"===n.type&&n.source===t.source&&e.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 Pi(this.painter,r,t),this.painter.renderToTexture=new Oi(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=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.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(e.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 e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.sourceCaches;for(const e in t){const r=t[e]._tiles;for(const t in r){const e=r[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,r,n={}){const{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||e.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:n,height:a,data:f}=r,p=r;return this.style.addImage(t,{data:new e.R({width:n,height:a},new Uint8Array(f)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:n,height:f,data:p}=a.getImageData(r);this.style.addImage(t,{data:new e.R({width:n,height:f},p),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(t,r){const n=this.style.getImage(t);if(!n)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof HTMLImageElement||e.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new e.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!==n.data.width||s!==n.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(r instanceof HTMLImageElement||e.b(r));return n.data.replace(l,c),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)}setFilter(t,e,r={}){return this.style.setFilter(t,e,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,r,n={}){return this.style.setPaintProperty(t,e,r,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,r,n={}){return this.style.setLayoutProperty(t,e,r,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,r,(t=>{t||this._update(!0)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(!0)})),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=o.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=o.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");const r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);const i=this._controlContainer=o.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{a[t]=o.create("div",`maplibregl-ctrl-${t} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{e={requestedAttributes:t},r&&(e.statusMessage=r.statusMessage,e.type=r.type)}),{once:!0});const r=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!r){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new _n(r,this.transform),s.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=a.now();this.style.zoomHistory.update(t,i);const o=new e.z(t,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}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,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const t of this._controls)t.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),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return Fi}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Rn,t.MapTouchEvent=Fn,t.MapWheelEvent=jn,t.Marker=Zi,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{const 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,e)=>{const r=this._map._getUIString(`NavigationControl.${e}`);t.title=r,t.setAttribute("aria-label",r)},this.options=e.e({},Ni,t),this._container=o.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}))),o.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}))),o.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=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,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 Ui(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.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(t,e){const r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.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 e.k("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=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);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?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;const r=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor;const i=ea(this.options.offset);if(!n){const t=this._container.offsetWidth,e=this._container.offsetHeight;let a;a=r.y+i.bottom.ythis._map.transform.height-e?["bottom"]:[],r.xthis._map.transform.width-t/2&&a.push("right"),n=0===a.length?"bottom":a.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${Hi[n]} translate(${a.x}px,${a.y}px)`),Gi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Qi),t)}addTo(t){return this._map&&this.remove(),this._map=t,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 e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),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(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),r=document.createElement("body");let n;for(r.innerHTML=t;n=r.firstChild,n;)e.appendChild(n);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.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;const t=this._container.querySelector(ta);t&&t.focus()}},t.RasterDEMTileSource=K,t.RasterTileSource=$,t.ScaleControl=class{constructor(t){this._onMove=()=>{Ki(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ki(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},$i),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=pi,t.Style=pe,t.TerrainControl=class{constructor(t){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=t}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.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(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=li,t.TwoFingersTouchRotateHandler=oi,t.TwoFingersTouchZoomHandler=ii,t.TwoFingersTouchZoomRotateHandler=xi,t.VectorTileSource=X,t.VideoSource=et,t.addSourceType=(t,r)=>e._(void 0,void 0,void 0,(function*(){if(it(t))throw new Error(`A source type called "${t}" already exists.`);var e;e=r,nt[t]=e})),t.clearPrewarmedResources=function(){const t=j;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(O),j=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()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return lt().getRTLTextPluginStatus()},t.getVersion=function(){return ra},t.getWorkerCount=function(){return R.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return V().broadcast("IS",t)},t.prewarm=function(){N().acquire(O)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return lt().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){R.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}})),t},"object"==typeof t&&void 0!==i?i.exports=o():void 0===(a="function"==typeof(n=o)?n.call(t,r,t,i):n)||(i.exports=a)}}),Y_=d({"src/plots/map/layers.js"(t,e){var r=se(),n=Me().sanitizeHTML,i=U_(),a=O_();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;ex/2){var _=m.split("|").join("
");y.text(_).attr("data-unformatted",_).call(l.convertToTspans,t),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>x&&(b=x/(v.width+6));var w=[c.l+c.w*p.x[1],c.t+c.h*(1-p.y[0])];g.attr("transform",r(w[0],w[1])+n(b))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[u],n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),ib=d({"src/traces/choroplethmap/index.js"(t,e){e.exports={attributes:tb(),supplyDefaults:eb(),colorbar:No(),calc:Tg(),plot:nb(),hoverPoints:Mg(),eventData:Sg(),selectPoints:Eg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),hb=d({"src/traces/densitymap/hover.js"(t,e){var r=nr(),n=H_().hoverPoints,i=H_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),fb=d({"src/traces/densitymap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),pb=d({"src/traces/densitymap/index.js"(t,e){e.exports={attributes:ob(),supplyDefaults:sb(),colorbar:No(),formatLabels:N_(),calc:lb(),plot:ub(),hoverPoints:hb(),eventData:fb(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(g);var _=new Array(v);for(d=0;dx&&(x=l.source[e]),l.target[e]>x&&(x=l.target[e]);var _,b=x+1;t.node._count=b;var w=t.node.groups,T={};for(e=0;e0&&o(C,b)&&o(I,b)&&(!T.hasOwnProperty(C)||!T.hasOwnProperty(I)||T[C]!==T[I])){T.hasOwnProperty(I)&&(I=T[I]),T.hasOwnProperty(C)&&(C=T[C]),I=+I,p[C=+C]=p[I]=!0;var L="";l.label&&l.label[e]&&(L=l.label[e]);var P=null;L&&d.hasOwnProperty(L)&&(P=d[L]),c.push({pointNumber:e,label:L,color:u?l.color[e]:l.color,hovercolor:h?l.hovercolor[e]:l.hovercolor,customdata:f?l.customdata[e]:l.customdata,concentrationscale:P,source:C,target:I,value:+E}),S.source.push(C),S.target.push(I)}}var z=b+w.length,D=a(i.color),O=a(i.customdata),R=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:F,color:D?i.color[e]:i.color,customdata:O?i.customdata[e]:i.customdata})}var j=!1;return function(t,e,i){for(var a=n.init2dArray(t,0),o=0;o1}))}(z,S.source,S.target)&&(j=!0),{circular:j,links:c,nodes:R,groups:w,groupLookup:T}}e.exports=function(t,e){var r=l(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}}}),xb=d({"node_modules/d3-quadtree/dist/d3-quadtree.js"(t,e){var r;r=function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,h,f,p=t._root,d={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=u<<1|c]))return i[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),n=0;nt||t>=i||n>e||e>=a;)switch(s=(ep||(o=c.y0)>d||(s=c.x1)=v)<<1|t>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=x*x+_*_;if(b=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=l.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var s,c,h,f=-1,p=r.length,d=l[i++],m=n(),g=a();++fl.length)return t;var n,i=c[r-1];return null!=e&&r>=l.length?n=t.entries():(n=[],t.each((function(t,e){n.push({key:e,values:h(t,r)})}))),null!=i?n.sort((function(t,e){return i(t.key,e.key)})):n}return r={object:function(t){return u(t,0,i,a)},map:function(t){return u(t,0,o,s)},entries:function(t){return h(u(t,0,o,s),0)},key:function(t){return l.push(t),r},sortKeys:function(t){return c[l.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}},t.set=u,t.map=n,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),bb=d({"node_modules/d3-dispatch/dist/d3-dispatch.js"(t,e){var r;r=function(t){var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var r,n,i=new Array(r),a=0;a=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var t,n,i=e,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,v(a)}(),s=0}}function y(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),Tb=d({"node_modules/d3-force/dist/d3-force.js"(t,e){var o;o=function(t,e,r,n,i){function a(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function f(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;nf+c||np+c||au.index){var h=f-s.x-s.vx,g=p-s.y-s.vy,y=h*h+g*g;yt.r&&(t.r=t[e].r)}function f(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;an)if(Math.abs(f*c-u*h)>n&&o){var d=i-s,m=a-l,g=c*c+u*u,y=d*d+m*m,v=Math.sqrt(g),x=Math.sqrt(p),_=o*Math.tan((e-Math.acos((g+p-y)/(2*v*x)))/2),b=_/x,w=_/v;Math.abs(b-1)>n&&(this._+="L"+(t+b*h)+","+(r+b*f)),this._+="A"+o+","+o+",0,0,"+ +(f*d>h*m)+","+(this._x1=t+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,o,s,l,c){t=+t,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),f=t+u,p=a+h,d=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+f+","+p:(Math.abs(this._x1-f)>n||Math.abs(this._y1-p)>n)&&(this._+="L"+f+","+p),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+d+","+(t-u)+","+(a-h)+"A"+o+","+o+",0,1,"+d+","+(this._x1=f)+","+(this._y1=p):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=e)+","+d+","+(this._x1=t+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):(i=[t],void 0===(a="function"==typeof(n=r)?n.apply(t,i):n)||(e.exports=a))}}),Ab=d({"node_modules/d3-shape/dist/d3-shape.js"(t,e){var o;o=function(t,e){function r(t){return function(){return t}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,f=h/2,p=2*h;function d(t){return t>=1?f:t<=-1?-f:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,h=(s?a:-a)/c(l*l+u*u),f=h*u,p=-h*l,d=t+f,m=e+p,g=r+f,y=n+p,v=(d+g)/2,x=(m+y)/2,_=g-d,b=y-m,w=_*_+b*b,T=i-a,k=d*y-g*m,A=(b<0?-1:1)*c(o(0,T*T*w-k*k)),M=(k*b-_*A)/w,S=(-k*_-b*A)/w,E=(k*b+_*A)/w,C=(-k*_+b*A)/w,I=M-v,L=S-x,P=E-v,z=C-x;return I*I+L*L>P*P+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-f,y01:-p,x11:M*(i/T-1),y11:S*(i/T-1)}}function b(t){this._context=t}function w(t){return new b(t)}function T(t){return t[0]}function k(t){return t[1]}function A(){var t=T,n=k,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,f=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=h;++l)!(l=h;--f)c.point(y[f],v[f]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+t(p,u,r),v[u]=+i(p,u,r),c.point(n?+n(p,u,r):y[u],a?+a(p,u,r):v[u]))}if(d)return c=null,d+""||null}function h(){return A().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return h().x(t).y(i)},u.lineY1=function(){return h().x(t).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function S(t,e){return et?1:e>=t?0:NaN}function E(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var C=L(w);function I(t){this._curve=t}function L(t){function e(e){return new I(t(e))}return e._curve=t,e}function P(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function z(){return P(A().curve(C))}function D(){var t=M().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(i())},delete t.lineY0,t.lineOuterRadius=function(){return P(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function O(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var R=Array.prototype.slice;function F(t){return t.source}function j(t){return t.target}function B(t){var n=F,i=j,a=T,o=k,s=null;function l(){var r,l=R.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function N(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function V(t,e,r,n,i){var a=O(e,r),o=O(e,r=(r+i)/2),s=O(n,r),l=O(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,p)}},H={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},G=Math.sqrt(1/3),Z=2*G,W={draw:function(t,e){var r=Math.sqrt(e/Z),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(p/10)*Y,$=-Math.cos(p/10)*Y,K={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=X*r,i=$*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},J={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[q,H,W,J,K,tt,at];function st(){}function lt(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ct(t){this._context=t}function ut(t){this._context=t}function ht(t){this._context=t}function ft(t,e){this._basis=new ct(t),this._beta=e}ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ut.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var pt=function t(e){function r(t){return 1===e?new ct(t):new ft(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function dt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:dt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>u){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>u){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new kt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var St=function t(e){function r(t){return e?new Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Et(t){this._context=t}function Ct(t){return t<0?-1:1}function It(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Lt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Dt(t){this._context=new Ot(t)}function Ot(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Ut(t,e){return t[e]}function Vt(t){var e=t.map(qt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function qt(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function Ht(t){var e=t.map(Gt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function Gt(t){for(var e,r=0,n=-1,i=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,b=r(0),w=null,T=y,k=v,A=x,M=null;function S(){var r,m,g,y=+t.apply(this,arguments),v=+o.apply(this,arguments),x=T.apply(this,arguments)-f,S=k.apply(this,arguments)-f,E=n(S-x),C=S>x;if(M||(M=r=e.path()),vu)if(E>p-u)M.moveTo(v*a(x),v*l(x)),M.arc(0,0,v,x,S,!C),y>u&&(M.moveTo(y*a(S),y*l(S)),M.arc(0,0,y,S,x,C));else{var I,L,P=x,z=S,D=x,O=S,R=E,F=E,j=A.apply(this,arguments)/2,B=j>u&&(w?+w.apply(this,arguments):c(y*y+v*v)),N=s(n(v-y)/2,+b.apply(this,arguments)),U=N,V=N;if(B>u){var q=d(B/y*l(j)),H=d(B/v*l(j));(R-=2*q)>u?(D+=q*=C?1:-1,O-=q):(R=0,D=O=(x+S)/2),(F-=2*H)>u?(P+=H*=C?1:-1,z-=H):(F=0,P=z=(x+S)/2)}var G=v*a(P),Z=v*l(P),W=y*a(O),Y=y*l(O);if(N>u){var X,$=v*a(z),K=v*l(z),J=y*a(D),Q=y*l(D);if(E1?0:g<-1?h:Math.acos(g))/2),at=c(X[0]*X[0]+X[1]*X[1]);U=s(N,(y-at)/(it-1)),V=s(N,(v-at)/(it+1))}}F>u?V>u?(I=_(J,Q,G,Z,v,V,C),L=_($,K,W,Y,v,V,C),M.moveTo(I.cx+I.x01,I.cy+I.y01),Vu&&R>u?U>u?(I=_(W,Y,$,K,y,-U,C),L=_(G,Z,J,Q,y,-U,C),M.lineTo(I.cx+I.x01,I.cy+I.y01),U0&&(d+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(v-f*_)/d:0;s0?h*c:0)+_,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=O,t.radialArea=D,t.radialLine=z,t.stack=function(){var t=r([]),e=Nt,n=Bt,i=Ut;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o0;--o)d(a*=.99),m(),l(a),m();function s(){var r=e.max(i,(function(t){return t.length})),a=M*(v-n)/(r-1);_>a&&(_=a);var o=e.min(i,(function(t){return(v-n-(t.length-1)*_)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}function l(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function m(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+_;if((r=a-_-v)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+_-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}(a),E(a),a}function E(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return S.update=function(t){return E(t),t},S.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),S):b},S.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),S):w},S.nodeWidth=function(t){return arguments.length?(x=+t,S):x},S.nodePadding=function(t){return arguments.length?(_=+t,S):_},S.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),S):T},S.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),S):k},S.size=function(e){return arguments.length?(t=n=0,i=+e[0],v=+e[1],S):[i-t,v-n]},S.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],v=+e[1][1],S):[[t,n],[i,v]]},S.iterations=function(t){return arguments.length?(A=+t,S):A},S},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?o(t,hg(),_b(),Ab()):(i=[t,r(882),r(898),r(924)],void 0===(a="function"==typeof(n=o)?n.apply(t,i):n)||(e.exports=a))}}),Sb=d({"node_modules/elementary-circuits-directed-graph/johnson.js"(t,e){var r=yb();e.exports=function(t,e){var n,i=[],a=[],o=[],s={},l=[];function c(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(e){delete s[t][e],o[e]&&c(e)}))}function u(t){var r,h,f,p,d=!1;for(a.push(t),o[t]=!0,r=0;r=e}))}(e);for(var n,i=r(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o1||i>1)}function S(t,e,r){return t.sort(C),t.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&M(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function E(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),S(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),S(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,a)&&M(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(L):c.sort(I);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+u,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(z):c.sort(P),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+u,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function C(t,e){return D(t)==D(e)?"bottom"==t.circularLinkType?L(t,e):I(t,e):D(e)-D(t)}function I(t,e){return t.y0-e.y0}function L(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function z(t,e){return e.y1-t.y1}function D(t){return t.target.column-t.source.column}function O(t){return t.target.x0-t.source.x1}function R(t,e){var r=k(t),n=O(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function F(t,e){var r=k(t),n=O(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function j(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=h*i.y0+f*i.y0+p*i.y1+d*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&ga.y0&&i.y0a.y0&&i.y1a.y1)&&B(t,c,e,r)}))):(y>o.y0&&yo.y1)&&(c=y-o.y0+10,o=B(o,c,e,r),t.nodes.forEach((function(t){_(t,n)!=_(o,n)&&t.column==o.column&&t.y0o.y1&&B(t,c,e,r)})))}}))}}))}function B(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function N(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return _(t.source,r)==_(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=F(e,t);return t.y1-r}if(e.target.column>t.target.column)return F(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function H(t,e){return _(t.source,e)==_(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,_=0,k=1,M=1,S=24,C=g,I=o,L=y,P=v,z=32,D=2,O=null;function R(){var o={nodes:L.apply(null,arguments),links:P.apply(null,arguments)};!function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,C);t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(void 0===i?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)}))}(o),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o0;--u)y(c*=.99,s),v();function g(r){if(n){var o=1/0;l.forEach((function(t){var e=M*n/(t.length+1);o=e0?r+b+w:r,bottom:n=n>0?n+b+w:n,left:a=a>0?a+b+w:a,right:i=i>0?i+b+w:i}}(i),u=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),i=k-a,o=M-_,s=i+r.right+r.left,l=o+r.top+r.bottom,c=i/s,u=o/l;return a=a*c+r.left,k=0==r.right?k:k*c,_=_*u+r.top,M*=u,t.nodes.forEach((function(t){t.x0=a+t.column*((k-a-S)/n),t.x1=t.x0+S})),u}(i,c);s*=u,i.links.forEach((function(t){t.width=t.value*s})),l.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==l.length-1&&1==e||0==t.depth&&1==e?(t.y0=M/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==A(t,r)?(t.y0=M/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=_+n,t.y1=t.y0+t.value*s):(t.y0=M-t.value*s-n,t.y1=t.y0+t.value*s):0==c.top||0==c.bottom?(t.y0=(M-_)/e*n,t.y1=t.y0+t.value*s):(t.y0=(M-_)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))}function y(t,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&A(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=M/2-s/2,i.y1=M/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=M/2-s/2,i.y1=M/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function v(){l.forEach((function(e){var r,n,i,a=_,o=e.length;for(e.sort(h),i=0;i0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-M)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=e[i]).y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,C),F(o);for(var s=0;s<4;s++)N(o,M,C),U(o,0,C),j(o,_,M,C),N(o,M,C),U(o,0,C);return function(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}(o,_,M),E(o,D,M,C),o}function F(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return R.nodeId=function(t){return arguments.length?(C="function"==typeof t?t:s(t),R):C},R.nodeAlign=function(t){return arguments.length?(I="function"==typeof t?t:s(t),R):I},R.nodeWidth=function(t){return arguments.length?(S=+t,R):S},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),R):L},R.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),R):P},R.size=function(t){return arguments.length?(a=_=0,k=+t[0],M=+t[1],R):[k-a,M-_]},R.extent=function(t){return arguments.length?(a=+t[0][0],k=+t[1][0],_=+t[0][1],M=+t[1][1],R):[[a,_],[k,M]]},R.iterations=function(t){return arguments.length?(z=+t,R):z},R.circularLinkGap=function(t){return arguments.length?(D=+t,R):D},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(O=t,R):O},R.update=function(t){return T(t,C),F(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=A.nodes);P.forEach((function(t){var e,r,n,i=0,a=t.length;for(t.sort((function(t,e){return t.y0-e.y0})),n=0;n=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}n.update(A)}return{circular:b,key:r,trace:c,guid:h.randstr(),horizontal:f,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?y:g,dragPerpendicular:f?g:y,arrangement:c.arrangement,sankey:n,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=l(e.color),i=l(e.hovercolor),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:S,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function S(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r="",n=t.width/2,i=t.circularPathData,a=i.sourceX+i.verticalBuffer0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-e)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-e)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-e-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-e+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-e-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+" L "+(i.targetX-e)+" "+(i.targetY+n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var i=t.link.source.x1,a=t.link.target.x0-e,o=n(i,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,f=t.link.y1+t.link.width/2,p="M"+i+","+c,d="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+f+" "+s+","+u+" "+i+","+u,g=e>0?"L"+(a+e)+","+(h+t.link.width/2):"";return p+d+(g+="L"+a+","+f)+m+"Z"}}function E(t,e){var r=l(e.color),n=s.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,u].join("_"),interactionState:t.interactionState,figure:t}}function C(t){t.attr("transform",(function(t){return f(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function I(t){t.call(C)}function L(t,e){t.call(I),e.attr("d",S())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function z(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return f(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function F(t,e,n,a){var o=i.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(t){a._fullLayout._dragCover=t})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,B(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,n){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,i,n)).stop()}(0,o,i),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,j(r,i)}}))}(t,e,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),B(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(N(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e"),color:b(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:b(l,"bordercolor"),fontFamily:b(l,"font.family"),fontSize:b(l,"font.size"),fontColor:b(l,"font.color"),fontWeight:b(l,"font.weight"),fontStyle:b(l,"font.style"),fontVariant:b(l,"font.variant"),fontTextcase:b(l,"font.textcase"),fontLineposition:b(l,"font.lineposition"),fontShadow:b(l,"font.shadow"),nameLength:b(l,"namelength"),textAlign:b(l,"align"),idealAlign:r.event.x"),color:b(s,"bgcolor")||a.tinyColorHue,borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),fontWeight:b(s,"font.weight"),fontStyle:b(s,"font.style"),fontVariant:b(s,"font.variant"),fontTextcase:b(s,"font.textcase"),fontLineposition:b(s,"font.lineposition"),fontShadow:b(s,"font.shadow"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});f(w,.85),p(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n,i){var a=n.node;a.originalEvent=r.event,t._hoverdata=[a],r.select(e).call(y,n,i),o.click(t,{target:!0})}}})}}}),Pb=d({"src/traces/sankey/base_plot.js"(t){var e=Lt().overrideAll,r=be().getModuleCalcData,n=Lb(),i=j(),a=fr(),o=hr(),s=Sn().prepSelect,l=se(),c=Vt(),u="sankey";function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var f={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:h.node(),plotinfo:{id:e,xaxis:f,yaxis:p,fillRangeItems:l.noop},subplot:e,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;r0}function k(t){t.each((function(t){x.stroke(r.select(this),t.line.color)})).each((function(t){x.fill(r.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function A(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,y,t,e)}return d(i,o,l,s,n),g(i,o,l,s),o}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function S(t,e,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",t).call(f.convertToTspans,i).call(u.font,e),u.bBox(o.node())}function E(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,d,m){var g,y=t._fullLayout;T(d)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,e,"trace").each((function(e){var m,v,C,I,L,P=e[0].trace,z=r.select(this),D=P._hasGauge,O=P._isAngular,R=P._isBullet,F=P.domain,j={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},B=j.l+j.w/2,N=j.t+j.h/2,U=Math.min(j.w/2,j.h),V=h.innerRadius*U,q=P.align||"center";if(v=N,D){if(O&&(m=B,v=N+U/2,C=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),n=e/r;return[n,t,e]}(t,.9*V)}),R){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=j.l+(G+(1-G)*b[q])*j.w,C=function(t){return M(t,(h.bulletNumberDomainSize-H)*j.w,j.h)}}}else m=j.l+b[q]*j.w,C=function(t){return M(t,j.w,j.h)};!function(t,e,n,l){var c,h,d,m=n[0].trace,g=l.numbersX,y=l.numbersY,v=m.align||"center",k=_[v],M=l.transitionOpts,C=l.onComplete,I=a.ensureSingle(e,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var P=I.selectAll("text").data(L);function z(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=A(t,{tickformat:a});return function(t){return Math.abs(t)<1?p.tickText(o,t).text:r(t)}}function D(){var e=A(t,{tickformat:m.number.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=I.select("text.number");function h(){var e="number"==typeof n[0].y?s+a(n[0].y)+o:"-";l.text(e).call(u.font,m.number.font).call(f.convertToTspans,t)}return T(M)?l.transition().duration(M.duration).ease(M.easing).each("end",(function(){h(),C&&C()})).each("interrupt",(function(){h(),C&&C()})).attrTween("text",(function(){var t=r.select(this),e=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){t.text(s+l(e(r))+o)}})):h(),c=S(s+a(n[0].y)+o,m.number.font,k,t),l}function O(){var e=A(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},d=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=I.select("text.delta");function y(){g.text(c(l(n[0]),a)).call(x.fill,d(n[0])).call(f.convertToTspans,t)}return g.call(u.font,m.delta.font).call(x.fill,d({delta:m._deltaLastValue})),T(M)?g.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var t=r.select(this),e=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,e),u=i(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(x.fill,d({delta:u(e)}))}})).each("end",(function(){y(),C&&C()})).each("interrupt",(function(){y(),C&&C()})):y(),h=S(c(l(n[0]),a),m.delta.font,k,t),g}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var R,F=m.mode+m.align;if(m._hasDelta&&(R=O(),F+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,F+=m.delta.increasing.symbol+m.delta.decreasing.symbol,d=h),m._hasNumber&&(D(),F+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,d=c),m._hasDelta&&m._hasNumber){var j,B,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],U=[(h.left+h.right)/2,(h.top+h.bottom)/2],V=.75*m.delta.font.size;"left"===m.delta.position&&(j=E(m,"deltaPos",0,-1*(c.width*b[m.align]+h.width*(1-b[m.align])+V),F,Math.min),B=N[1]-U[1],d={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:h.left+j,right:c.right,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"right"===m.delta.position&&(j=E(m,"deltaPos",0,c.width*(1-b[m.align])+h.width*b[m.align]+V,F,Math.max),B=N[1]-U[1],d={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:c.left,right:h.right+j,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"bottom"===m.delta.position&&(j=null,B=h.height,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(j=null,B=c.top,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),R.attr({dx:j,dy:B})}(m._hasNumber||m._hasDelta)&&I.attr("transform",(function(){var t=l.numbersScaler(d);F+=t[2];var e,r=E(m,"numbersScale",1,t[0],F,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*d.bottom:y-r*(d.top+d.bottom)/2,m._numbersTop=r*d.top+e;var n=d[v];"center"===v&&(n=(d.left+d.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,F,Math.max),s(i,e)+o(r)}))}(t,z,e,{numbersX:m,numbersY:v,numbersScaler:C,transitionOpts:d,onComplete:g}),D&&(I={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},L={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var Z=z.selectAll("g.angular").data(O?e:[]);Z.exit().remove();var W=z.selectAll("g.angularaxis").data(O?e:[]);W.exit().remove(),O&&function(t,e,i,a){var o,u,h,f,d=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,_=[m.l+m.w/2,m.t+m.h/2+g/2],b=a.gauge,w=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function C(t){var e=d.gauge.axis.range[0],r=(t-e)/(d.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function I(t){return r.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-E)}function L(t){t.attr("d",(function(t){return I(t.thickness).startAngle(C(t.range[0])).endAngle(C(t.range[1]))()}))}b.enter().append("g").classed("angular",!0),b.attr("transform",s(_[0],_[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=A(t,d.gauge.axis)).type="linear",o.range=d.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},D=p.makeLabelFns(o,0).labelStandoff;z.xFn=function(t){var e=P(t);return Math.cos(e)*D},z.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(D+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*c)},z.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return s(_[0]+g*Math.cos(t),_[1]-g*Math.sin(t))};h=function(t){return O(P(t))};var R=function(t){var e=P(t);return O(e)+"rotate("+-l(e)+")"};if(u=p.calcTicks(o),f=p.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;p.drawTicks(t,o,{vals:u,layer:w,path:"M"+f*F+",0h"+f*o.ticklen,transFn:R}),p.drawLabels(t,o,{vals:u,layer:w,transFn:h,labelFns:z})}var j=[v].concat(d.gauge.steps),B=b.selectAll("g.bg-arc").data(j);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(k),B.exit().remove();var N=I(d.gauge.bar.thickness),U=b.selectAll("g.value-arc").data([d.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var V,q,H,G=U.select("path");T(M)?(G.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=N,q=C(i[0].lastY),H=C(i[0].y),function(){var t=n(q,H);return function(e){return V.endAngle(t(e))()}})),d._lastValue=i[0].y):G.attr("d","number"==typeof i[0].y?N.endAngle(C(i[0].y)):"M0,0Z"),G.call(k),U.exit().remove(),j=[];var Z=d.gauge.threshold.value;(Z||0===Z)&&j.push({range:[Z,Z],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var W=b.selectAll("g.threshold-arc").data(j);W.enter().append("g").classed("threshold-arc",!0).append("path"),W.select("path").call(L).call(k),W.exit().remove();var Y=b.selectAll("g.gauge-outline").data([x]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(L).call(k),Y.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Z,layer:W,size:j,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var Y=z.selectAll("g.bullet").data(R?e:[]);Y.exit().remove();var X=z.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,l,c,u=r[0].trace,f=n.gauge,d=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,v=u.domain,_=n.transitionOpts,b=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",s(y.l,y.t)),d.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),d.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,M=u.gauge.bar.thickness*w,S=v.x[0],E=v.x[0]+(v.x[1]-v.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function C(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*w})).attr("height",(function(t){return t.thickness*w}))}(i=A(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=p.calcTicks(i),o=p.makeTransTickFn(i),l=p.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(p.drawTicks(t,i,{vals:"inside"===i.ticks?p.clipEnds(i,a):a,layer:d,path:p.makeTickPath(i,c,l),transFn:o}),p.drawLabels(t,i,{vals:a,layer:d,transFn:o,labelFns:p.makeLabelFns(i,c)}));var I=[m].concat(u.gauge.steps),L=f.selectAll("g.bg-bullet").data(I);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(k),L.exit().remove();var P=f.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(w-M)/2).call(k),T(_)?P.select("rect").transition().duration(_.duration).ease(_.easing).each("end",(function(){b&&b()})).each("interrupt",(function(){b&&b()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),P.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),D=f.selectAll("g.threshold-bullet").data(z);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(x.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),D.exit().remove();var O=f.selectAll("g.gauge-outline").data([g]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(C).call(k),O.exit().remove()}(t,0,e,{gauge:Y,layer:X,size:j,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var $=z.selectAll("text.title").data(e);$.exit().remove(),$.enter().append("text").classed("title",!0),$.attr("text-anchor",(function(){return R?_.right:_[P.title.align]})).text(P.title.text).call(u.font,P.title.font).call(f.convertToTspans,t),$.attr("transform",(function(){var t,e=j.l+j.w*b[P.title.align],r=h.titlePadding,n=u.bBox($.node());return D?(O&&(t=P.gauge.axis.visible?u.bBox(W.node()).top-r-n.bottom:j.t+j.h/2-U/2-n.bottom-r),R&&(t=v-(n.top+n.bottom)/2,e=j.l-h.bulletPadding*j.w)):t=P._numbersTop-r-n.bottom,s(e,t)}))}))}}}),Vb=d({"src/traces/indicator/index.js"(t,e){e.exports={moduleType:"trace",name:"indicator",basePlotModule:Rb(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:Fb(),supplyDefaults:Bb().supplyDefaults,calc:Nb().calc,plot:Ub(),meta:{}}}}),qb=d({"lib/indicator.js"(t,e){e.exports=Vb()}}),Hb=d({"src/traces/table/attributes.js"(t,e){var r=xn(),n=O().extendFlat,i=Lt().overrideAll,a=R(),o=Ta().attributes,s=Ee().descriptionOnlyNumbers;e.exports=i({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))}},"calc","from-root")}}),Gb=d({"src/traces/table/defaults.js"(t,e){var r=se(),n=Hb(),i=Ta().defaults;e.exports=function(t,e,a,o){function s(i,a){return r.coerce(t,e,n,i,a)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),Yb=d({"src/traces/table/data_preparation_helper.js"(t,e){var r=Wb(),n=O().extendFlat,i=T(),a=S().isTypedArray,o=S().isArrayOrTypedArray;function s(t){if(o(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var a=c(e.cells.values),d=function(t){return t.slice(e.header.values.length,t.length)},m=c(e.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(d(a).map((function(){return u((m[0]||[""]).length)}))),y=e.domain,v=Math.floor(t._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(t._fullLayout._size.h*(y.y[1]-y.y[0])),_=e.header.values.length?g[0].map((function(){return e.header.height})):[r.emptyHeaderHeight],b=a.length?a[0].map((function(){return e.cells.height})):[],w=_.reduce(l,0),T=p(b,x-w+r.uplift),k=f(p(_,w),[]),A=f(T,k),M={},S=e._fullInput.columnorder;o(S)&&(S=Array.from(S)),S=S.concat(d(a.map((function(t,e){return e}))));var E=g.map((function(t,r){var n=o(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),C=E.reduce(l,0);E=E.map((function(t){return t/C*v}));var I=Math.max(s(e.header.line.width),s(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:y.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-y.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:I,height:x,columnOrder:S,groupHeight:x,rowBlocks:A,headerRowBlocks:k,scrollY:0,cells:n({},e.cells,{values:a}),headerCells:n({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:S[e],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=h(t)})),L}}}),Xb=d({"src/traces/table/data_split_helpers.js"(t){var e=O().extendFlat;t.splitToPanels=function(t){var r=[0,0],n=e({},t,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:e({},t.calcdata,{cells:t.calcdata.headerCells})});return[e({},t,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),e({},t,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},t.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}}}),$b=d({"src/traces/table/plot.js"(t,e){var r=Wb(),n=v(),i=se(),a=i.numberFormat,o=zx(),s=Je(),l=Me(),c=se().raiseToTop,u=se().strTranslate,h=se().cancelTransition,f=Yb(),p=Xb(),d=q();function m(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function g(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function y(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function x(t){return[].concat.apply([],t.map((function(t){return t}))).map((function(t){return t.__data__}))}function _(t,e,i){var a=t.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return R(e,e.length-1)+(e.length?F(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-E(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom})).attr("transform",(function(t){var e=t.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(e,E(t))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(t){return u(0,t.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(t){return t.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||I(e,t,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(t){return n.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t})).on("drag",I(e,t)).on("dragend",(function(){}))),h.attr("y2",(function(t){return t.scrollbarState.scrollableAreaHeight})),e._context.staticPlot&&(c.remove(),h.remove())}function b(t,e,i,a){var l=function(t){var e=t.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return e.enter().append("g").classed(r.cn.columnCells,!0),e.exit().remove(),e}(i),c=function(t){var e=t.selectAll("."+r.cn.columnCell).data(p.splitToCells,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.columnCell,!0),e.exit().remove(),e}(l);!function(t){t.each((function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,i={size:k(r.size,n,e),color:k(r.color,n,e),family:k(r.family,n,e),weight:k(r.weight,n,e),style:k(r.style,n,e),variant:k(r.variant,n,e),textcase:k(r.textcase,n,e),lineposition:k(r.lineposition,n,e),shadow:k(r.shadow,n,e)};t.rowNumber=t.key,t.align=k(t.calcdata.cells.align,n,e),t.cellBorderWidth=k(t.calcdata.cells.line.width,n,e),t.font=i}))}(c);var u=function(t){var e=t.selectAll("."+r.cn.cellRect).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("rect").classed(r.cn.cellRect,!0),e}(c);!function(t){t.attr("width",(function(t){return t.column.columnWidth})).attr("stroke-width",(function(t){return t.cellBorderWidth})).each((function(t){var e=n.select(this);d.stroke(e,k(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),d.fill(e,k(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))}))}(u);var h=function(t){var e=t.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(c),f=function(t){var e=t.selectAll("."+r.cn.cellText).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),e}(h);!function(t){t.each((function(t){s.font(n.select(this),t.font)}))}(f),w(f,e,a,t),O(c)}function w(t,e,i,o){t.text((function(t){var e=t.column.specIndex,n=t.rowNumber,i=t.value,o="string"==typeof i,s=o&&i.match(/
/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(r.latexCheck);t.latex=u;var h,f,p=u?"":k(t.calcdata.cells.prefix,e,n)||"",d=u?"":k(t.calcdata.cells.suffix,e,n)||"",m=u?null:k(t.calcdata.cells.format,e,n)||null,g=p+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=T(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?T(g):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===r.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=R(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(L(t,r,e,c,n.prevPages,n,0),L(t,r,e,c,n.prevPages,n,1),_(r,t))}}function I(t,e,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(M);return C(t,h,l),s.scrollY===u}}function L(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,i,a){return function(){var o=n.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var n,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*r.cellPad;for(t.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(t.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(t.value+=l.join(r.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,t,a),n.select(e.parentNode.parentNode).call(O)}}function z(t,e,i,a,o){return function(){if(!o.settledY){var s=n.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*r.cellPad:h,p=Math.max(f,h);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+r.cn.columnCell).call(O),C(null,t.filter(M),0),_(i,a,!0)),s.attr("transform",(function(){var t=this,e=t.parentNode.getBoundingClientRect(),i=n.select(t.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),s=i.top-e.top+(a?a.matrix.f:r.cellPad);return u(D(o,n.select(t.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function D(t,e){switch(t.align){case"left":default:return r.cellPad;case"right":return t.column.columnWidth-(e||0)-r.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function O(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+F(e,1/0)}),0),r=F(B(t),t.key);return u(0,r+e)})).selectAll("."+r.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function R(t,e){for(var r=0,n=e-1;n>=0;n--)r+=j(t[n]);return r}function F(t,e){for(var r=0,n=0;ne.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}}}),cw=d({"src/traces/carpet/plot.js"(t,e){var r=v(),n=Je(),i=ow(),a=sw(),o=lw(),s=Me(),l=se(),c=l.strRotate,u=l.strTranslate,h=Ae();function f(t,e,o,s,l,c,u){var h="const-"+l+"-lines",f=o.selectAll("."+h).data(c);f.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),f.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,t.c2p),h=i([],c,e.c2p),f="M"+a(u,h,s.smoothing);r.select(this).attr("d",f).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function p(t,e,i,a,l,h,f,p){var d=h.selectAll("text."+p).data(f);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(l,h){var f;if("auto"===l.axis.tickangle)f=o(a,e,i,l.xy,l.dxy);else{var p=(l.axis.tickangle+180)*Math.PI/180;f=o(a,e,i,l.xy,[Math.cos(p),Math.sin(p)])}h||(g={angle:f.angle,flip:f.flip});var d=(l.endAnchor?-1:1)*f.flip,y=r.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,t),v=n.bBox(this);y.attr("transform",u(f.p[0],f.p[1])+c(f.angle)+u(l.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,n,s){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis,d=t._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(e){var n=r.select(this),s=e[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),_=l.ensureSingle(n,"g","majorlayer"),b=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),f(u,h,_,0,"a",y._gridlines,!0),f(u,h,_,0,"b",v._gridlines,!0),f(u,h,x,0,"a",y._minorgridlines,!0),f(u,h,x,0,"b",v._minorgridlines,!0),f(u,h,b,0,"a-boundary",y._boundarylines,c),f(u,h,b,0,"b-boundary",v._boundarylines,c);var T=p(t,u,h,m,0,w,y._labels,"a-label"),k=p(t,u,h,m,0,w,v._labels,"b-label");!function(t,e,r,n,i,a,s,c){var u,h,f,p,d=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(d+m),h=y,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,f,r.dxydb_rough(u,h))),g(t,e,r,0,f,p,r.aaxis,i,a,s,"a-title"),u=d,h=.5*(y+v),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,f,r.dxyda_rough(u,h))),g(t,e,r,0,f,p,r.baxis,i,a,c,"b-title")}(t,w,m,0,u,h,T,k),function(t,e,r,n,o){var s,c,u,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=l.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,m=[];for(h=0;h90&&v<270,_=r.select(this);_.text(f.title.text).call(s.convertToTspans,t),x&&(b=(-s.lineCount(_)+m)*d*a-b),_.attr("transform",u(e.p[0],e.p[1])+c(e.angle)+u(0,b)).attr("text-anchor","middle").call(n.font,f.title.font)})),_.exit().remove()}}}),uw=d({"src/traces/carpet/cheater_basis.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n){var i,a,o,s,l,c,u=[],h=r(t)?t.length:t,f=r(e)?e.length:e,p=r(t)?t:null,d=r(e)?e:null;p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(h-1)),d&&(s=(d.length-1)/(d[d.length-1]-d[0])/(f-1));var m=1/0,g=-1/0;for(a=0;a=10)return null;for(var i=1/0,a=-1/0,o=t.length,s=0;s0&&(p=t.dxydi([],n-1,o,0,s),y.push(l[0]+p[0]/3),v.push(l[1]+p[1]/3),d=t.dxydi([],n-1,o,1,s),y.push(h[0]-d[0]/3),v.push(h[1]-d[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=t.a2i(r),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=L,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=e,x.axis=_,x.crossAxis=A,x.value=r,x.constvar=i,x.index=f,x.x=y,x.y=v,x.smoothing=A.smoothing,x}function D(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(e){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nx.length-1||b.push(n(D(o),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u;fx.length-1||m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<_.minorgridcount;a++)(v=m-s)<=0||(d=g+(y-g)*(a+1)/(_.minorgridcount+1)*(_.arraydtick/v))x[x.length-1]||w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(D(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(D(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+l)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],f=u;f<=h;f++)p=_.tick0+_.dtick*f,b.push(n(z(p),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u-1;fx[x.length-1]||w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(z(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(z(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}}}),pw=d({"src/traces/carpet/calc_labels.js"(t,e){var r=nr(),n=O().extendFlat;e.exports=function(t,e){var i,a,o,s=e._labels=[],l=e._gridlines;for(i=0;i=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),mw=d({"src/traces/carpet/smooth_fill_2d_array.js"(t,e){var r=se();e.exports=function(t,e,n){var i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T=[],k=[],A=t[0].length,M=t.length,S=0;for(i=0;i0&&void 0!==(c=t[l][s-1])&&(h++,u+=c),s0&&void 0!==(c=t[l-1][s])&&(h++,u+=c),l0&&a0&&i1e-5);return r.log("Smoother converged to",E,"after",C,"iterations"),t}}}),gw=d({"src/traces/carpet/constants.js"(t,e){e.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),yw=d({"src/traces/carpet/catmull_rom.js"(t,e){e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=c*(l+c)*3,p=l*(l+c)*3;return[[e[0]+(f&&u/f),e[1]+(f&&h/f)],[e[0]-(p&&u/p),e[1]-(p&&h/p)]]}}}),vw=d({"src/traces/carpet/compute_control_points.js"(t,e){var r=yw(),n=se().ensureArray;function i(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}e.exports=function(t,e,a,o,s,l){var c,u,h,f,p,d,m,g,y,v,x=a[0].length,_=a.length,b=s?3*x-2:x,w=l?3*_-2:_;for(t=n(t,w),e=n(e,w),h=0;hp&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=a([t._xctrl,t._yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=o([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),r=t[1]-e;return(1-r)*l[e]+r*l[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(n(t,e),c-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(n(t,l),u-2)),r=l[e],i=l[e+1];return Math.max(0,Math.min(u-1,e+(t-r)/(i-r)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(r,n,i){if(!i&&(re[c-1]|nl[u-1]))return[!1,!1];var a=t.a2i(r),o=t.b2j(n),s=t.evalxy([],a,o);if(i){var h,f,p,d,m=0,g=0,y=[];re[c-1]?(h=c-2,f=1,m=(r-e[c-1])/(e[c-1]-e[c-2])):f=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),nl[u-1]?(p=u-2,d=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):d=o-(p=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(t.dxydi(y,h,p,f,d),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(t.dxydj(y,h,p,f,d),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(l.length-2,t));return l[e+1]-l[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}}}),Tw=d({"src/traces/carpet/calc.js"(t,e){var r=nr(),n=se().isArray1D,i=uw(),a=hw(),o=fw(),s=pw(),l=dw(),c=Po(),u=mw(),h=Lo(),f=ww();e.exports=function(t,e){var p=r.getFromId(t,e.xaxis),d=r.getFromId(t,e.yaxis),m=e.aaxis,g=e.baxis,y=e.x,v=e.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(e,m,g,"a","b",x);var _=e._a=e._a||e.a,b=e._b=e._b||e.b;y=e._x||e.x,v=e._y||e.y;var w={};if(e._cheater){var T="index"===m.cheatertype?_.length:_,k="index"===g.cheatertype?b.length:b;y=i(T,k,e.cheaterslope)}e._x=y=c(y),e._y=v=c(v),u(y,_,b),u(v,_,b),f(e),e.setScale();var A=a(y),M=a(v),S=.5*(A[1]-A[0]),E=.5*(A[1]+A[0]),C=.5*(M[1]-M[0]),I=.5*(M[1]+M[0]),L=1.3;return A=[E-S*L,E+S*L],M=[I-C*L,I+C*L],e._extremes[p._id]=r.findExtremes(p,A,{padded:!0}),e._extremes[d._id]=r.findExtremes(d,M,{padded:!0}),o(e,"a","b"),o(e,"b","a"),s(e,m),s(e,g),w.clipsegments=l(e._xctrl,e._yctrl,m,g),w.x=y,w.y=v,w.a=_,w.b=b,[w]}}}),kw=d({"src/traces/carpet/index.js"(t,e){e.exports={attributes:ew(),supplyDefaults:aw(),plot:cw(),calc:Tw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Mi(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Aw=d({"lib/carpet.js"(t,e){e.exports=kw()}}),Mw=d({"src/traces/scattercarpet/attributes.js"(t,e){var r=bn(),n=wn(),i=N(),a=Dt().hovertemplateAttrs,o=Dt().texttemplateAttrs,s=Le(),l=O().extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}}),Sw=d({"src/traces/scattercarpet/defaults.js"(t,e){var r=se(),n=_n(),i=We(),a=Zn(),o=Wn(),s=Yn(),l=Xn(),c=$n(),u=Mw();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}p("carpet"),e.xaxis="x",e.yaxis="y";var d=p("a"),m=p("b"),g=Math.min(d.length,m.length);if(g){e._length=g,p("text"),p("texttemplate"),p("hovertext"),p("mode",g")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}}}),zw=d({"src/traces/scattercarpet/event_data.js"(t,e){e.exports=function(t,e,r,n,i){var a=n[i];return t.a=a.a,t.b=a.b,t.y=a.y,t}}}),Dw=d({"src/traces/scattercarpet/index.js"(t,e){e.exports={attributes:Mw(),supplyDefaults:Sw(),colorbar:fi(),formatLabels:Ew(),calc:Iw(),plot:Lw(),style:di().style,styleOnSelect:di().styleOnSelect,hoverPoints:Pw(),selectPoints:yi(),eventData:zw(),moduleType:"trace",name:"scattercarpet",basePlotModule:Mi(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Ow=d({"lib/scattercarpet.js"(t,e){e.exports=Dw()}}),Rw=d({"src/traces/contourcarpet/attributes.js"(t,e){var r=_o(),n=ss(),i=Le(),a=O().extendFlat,o=n.contours;e.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),Fw=d({"src/traces/contourcarpet/defaults.js"(t,e){var r=se(),n=bo(),i=Rw(),a=Is(),o=cs(),s=hs();e.exports=function(t,e,l,c){function u(n,a){return r.coerce(t,e,i,n,a)}if(u("carpet"),t.a&&t.b){if(!n(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?a(t,e,u,c,l,{hasHover:!1}):(o(t,e,u,(function(n){return r.coerce2(t,e,i,n)})),s(t,e,u,c,{hasHover:!1}))}else e._defaultColor=l,e._length=null;u("zorder")}}}),jw=d({"src/traces/contourcarpet/calc.js"(t,e){var r=Ge(),n=se(),i=Lo(),a=Po(),o=zo(),s=Do(),l=Oo(),c=Fw(),u=Cw(),h=ps();e.exports=function(t,e){var f=e._carpetTrace=u(t,e);if(f&&f.visible&&"legendonly"!==f.visible){if(!e.a||!e.b){var p=t.data[f.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),c(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var c,u,h,f,p,d,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(e.z)&&i(e,y,v,"a","b",["z"]),c=e._a=e._a||e.a,f=e._b=e._b||e.b,c=c?y.makeCalcdata(e,"_a"):[],f=f?v.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=a(e._z||e.z,e.transpose),e._emptypoints=s(m),o(m,e._emptypoints);var x=n.maxRowLength(m),_="scaled"===e.xtype?"":c,b=l(e,_,u,h,x,y),w="scaled"===e.ytype?"":f,T=l(e,w,p,d,m.length,v),k={a:b,b:T,z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&r(t,e,{vals:m,containerStr:"",cLetter:"z"}),[k]}(t,e);return h(e,e._z),m}}}}),Bw=d({"src/traces/carpet/axis_aligned_line.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n,i){var a,o,s,l,c,u,h,f,p,d,m,g,y,v=r(n)?"a":"b",x=("a"===v?t.aaxis:t.baxis).smoothing,_="a"===v?t.a2i:t.b2j,b="a"===v?n:i,w="a"===v?i:n,T="a"===v?e.a.length:e.b.length,k="a"===v?e.b.length:e.a.length,A=Math.floor("a"===v?t.b2j(w):t.a2i(w)),M="a"===v?function(e){return t.evalxy([],e,A)}:function(e){return t.evalxy([],A,e)};x&&(s=Math.max(0,Math.min(k-2,A)),l=A-s,o="a"===v?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var S=_(b[0]),E=_(b[1]),C=S0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,D=C>0?Math.max:Math.min,O=L(S+I),R=P(E-I),F=[[h=M(S)]];for(a=O;a*C=0;N--)F=M.clipsegments[N],j=n([],F.x,b.c2p),B=n([],F.y,w.c2p),j.reverse(),B.reverse(),V.push(i(j,B,F.bicubic));var q="M"+V.join("L")+"Z";!function(t,e,r,a,s,l){var c,u,h,f,p=o.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f=0&&(f=C,d=g):Math.abs(h[1]-f[1])=0&&(f=C,d=g):o.log("endpt to newendpt is not vert. or horz.",h,f,C)}if(d>=0)break;v+=S(h,f),h=f}if(d===e.edgepaths.length){o.log("unclosed perimeter path");break}u=d,(_=-1===x.indexOf(u))&&(u=x[0],v+=S(h,f)+"Z",h=null)}for(u=0;um&&(n.max=m),n.len=n.max-n.min}function v(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)y):g=A>w,y=A;var M=c(w,T,k,A);M.pos=b,M.yc=(w+A)/2,M.i=_,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],v&&(M.orig_p=a[_]),d&&(M.tx=e.text[_]),m&&(M.htx=e.hovertext[_]),x.push(M)}else x.push({pos:b,empty:!0})}return e._extremes[l._id]=i.findExtremes(l,r.concat(f,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(t,"open:")+" ",high:n(t,"high:")+" ",low:n(t,"low:")+" ",close:n(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var n=i.getFromId(t,e.xaxis),o=i.getFromId(t,e.yaxis),c=function(t,e,n){var i=n._minDiff;if(!i){var o,s=t._fullData,l=[];for(i=1/0,o=0;o"+u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat):((v=n.extendFlat({},f)).y0=v.y1=b,v.yLabelVal=_,v.yLabel=u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat),v.name="",h.push(v),g[_]=v)}return h}function h(t,e,n,i){var a=t.cd,s=t.ya,u=a[0].trace,h=a[0].t,f=c(t,e,n,i);if(!f)return[];var p=a[f.index],d=f.index=p.i,m=p.dir;function g(t){return h.labels[t]+r.hoverLabelText(s,u[t][d],u.yhoverformat)}var y=p.hi||u.hoverinfo,v=y.split("+"),x="all"===y,_=x||-1!==v.indexOf("y"),b=x||-1!==v.indexOf("text"),w=_?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return b&&o(p,u,w),f.extraText=w.join("
"),f.y0=f.y1=s.c2p(p.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?u(t,e,r,n):h(t,e,r,n)},hoverSplit:u,hoverOnPoints:h}}}),$w=d({"src/traces/ohlc/select.js"(t,e){e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;rn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var n=t.type;if("linear"===n){var o=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(o(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?a(t):t}(t,e))}}t.makeCalcdata=function(e,r){var n,i,a=e[r],o=e._length,s=function(r){return t.d2c(r,e.thetaunit)};if(a)for(n=new Array(o),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),a=r.mod(n+1,e.length);return[e[n],e[a]]},findIntersectionXY:l,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:u,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t0?1:0}function n(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function i(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function a(t,e){return e*t.radius}e.exports={smith:n,reactanceArc:function(t,e,r,o){var s=i(t,n([r,e])),l=s[0],c=s[1],u=i(t,n([o,e])),h=u[0],f=u[1];if(0===e)return["M"+l+","+c,"L"+h+","+f].join(" ");var p=a(t,1/Math.abs(e));return["M"+l+","+c,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+h+","+f].join(" ")},resistanceArc:function(t,e,o,s){var l=a(t,1/(e+1)),c=i(t,n([e,o])),u=c[0],h=c[1],f=i(t,n([e,s])),p=f[0],d=f[1];if(r(o)!==r(s)){var m=i(t,n([e,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0=90||l>90&&c>=450?1:h<=0&&p<=0?0:Math.max(h,p),e=l<=180&&c>=180||l>180&&c>=540?-1:u>=0&&f>=0?0:Math.min(u,f),r=l<=270&&c>=270||l>270&&c>=630?-1:h>=0&&p>=0?0:Math.min(h,p),n=c>=360?1:u<=0&&f<=0?0:Math.max(u,f),[e,r,n,i]}(d),b=_[2]-_[0],w=_[3]-_[1],T=p/f,k=Math.abs(w/b);T>k?(m=f,x=(p-(g=f*k))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=p,x=(f-(m=p/k))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var A,M=r.xOffset2=i.l+i.w*y[0],S=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/b,C=r.innerRadius=r.getHole(e)*E,I=r.cx=M-E*_[0],L=r.cy=S+E*_[3],P=r.cxx=I-M,z=r.cyy=L-S,D=a.side;"counterclockwise"===D?(A=D,D="top"):"clockwise"===D&&(A=D,D="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:D,_trueSide:A,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(t,e,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.xaxis=r.mockCartesianAxis(t,e,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(t,e,{_id:"y",domain:v});var O=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",O).attr("transform",s(P,z)),n.frontplot.attr("transform",s(M,S)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",O).attr("transform",s(I,L)).call(l.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=a.extendFlat({},r,n);return p(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);f(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*a,t[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(e);d(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]90&&m<=270&&(g.tickangle=180);var x=v?function(t){var e=z(r,I([t.x,0]));return s(e[0]-f,e[1]-p)}:function(t){return s(g.l2p(t.x)+u,0)},_=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},b=U(d);if(r.radialTickLayout!==b&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=b),y){g.setScale();var w=0,T=v?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return h.tickText(g,t,!0,!1)})):h.calcTicks(g),k=v?T:h.clipEnds(g,T),A=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(A=-A),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,A),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?j(V(F(d.angle),r.vangles)):d.angle,S=s(f,p),E=S+o(-M);H(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),H(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),H(i["radial-line"].select("line"),y&&d.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(e),u=n.id+"title",h=0;if(l.title){var f=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,d=l.side;h="top"===d?p:"counterclockwise"===d?-(f+.4*p):f+.8*p}var m=void 0!==r?r:n.radialAxisAngle,g=F(m),y=Math.cos(g),v=Math.sin(g),_=o+a/2*y+h*v,b=s-a/2*v+h*y;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:O(i,"Click to enter radial axis title"),attributes:{x:_,y:b,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=z(r,I([0,t.x]));return Math.atan2(e[0]-f,e[1]-p)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=j(m.tick0),m.dtick=j(m.dtick));var v=function(t){return s(f+c*Math.cos(t),p-c*Math.sin(t))},x=g?function(t){var e=z(r,I([0,t.x]));return s(e[0],e[1])}:function(t){return v(y(t))},_=g?function(t){var e=z(r,I([0,t.x])),n=Math.atan2(e[0]-f,e[1]-p)-Math.PI/2;return s(e[0],e[1])+o(-j(n))}:function(t){var e=y(t);return v(e)+o(-j(e))},b=g?function(t){return L(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,p-u*n]+"L"+[f+c*r,p-c*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},k=U(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var A,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return h.tickText(m,t,!0,!1)})):h.calcTicks(m);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===e.gridshape?(A=S.map(y),a.angleDelta(A[0],A[1])<0&&(A=A.slice().reverse())):A=null,r.vangles=A,"category"===m.type&&(S=S.filter((function(t){return a.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:_,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}H(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:s(f,p)}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,f=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,v=l.radius,x=l.innerRadius,T=l.cx,k=l.cy,A=l.cxx,M=l.cyy,C=l.sectorInRad,I=l.vangles,L=l.radialAxis,P=E.clampTiny,z=E.findXYatLength,D=E.findEnclosingVertexAngles,O=S.cornerHalfWidth,R=S.cornerLen/2,F=m.makeDragger(h,"path","maindrag",!1===t.dragmode?"none":"crosshair");r.select(F).attr("d",l.pathSubplot()).attr("transform",s(T,k)),F.onmousemove=function(t){y.hover(u,t,l.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=l.id},F.onmouseout=function(t){u._dragging||g.unhover(u,t)};var j,B,N,U,V,q,H,G,Z,W={element:F,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Y(t-A,e-M)}function $(t,e){return Math.atan2(M-e,t-A)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function J(t,e){if(0===t)return l.pathSector(2*O);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-O,s=a+O;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(t,e,r){if(0===t)return l.pathSector(2*O);var n,i,a=K(t,e),o=K(t,r),s=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,f=z(O,u,s,c);n=z(R,h,f[0][0],f[0][1]),i=z(R,h,f[1][0],f[1][1])}else{var p,d;c?(p=R,d=O):(p=O,d=R),n=[[s-p,c-d],[s+p,c-d]],i=[[s-p,c+d],[s+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,v),x),tp?(t-1&&1===t&&b(e,u,[l.xaxis],[l.yaxis],l.id,W),r.indexOf("event")>-1&&y.click(u,e,l.id)}W.prepFn=function(t,r,i){var s=u._fullLayout.dragmode,h=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var d=a.apply3DTransform(p)(r-h.left,i-h.top);if(j=d[0],B=d[1],I){var g=E.findPolygonOffset(v,C[0],C[1],I);j+=A+g[0],B+=M+g[1]}switch(s){case"zoom":W.clickFn=st,c||(W.moveFn=I?it:rt,W.doneFn=at,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var t=u._fullLayout[l.id];H=n(t.bgcolor).getLuminance(),(G=m.makeZoombox(f,H,T,k,V)).attr("fill-rule","evenodd"),Z=m.makeCorners(f,T,k),w(u)}());break;case"select":case"lasso":_(t,r,i,W,s)}},g.init(W)},N.updateRadialDrag=function(t,e,n){var l=this,c=l.gd,u=l.layers,h=l.radius,f=l.innerRadius,p=l.cx,d=l.cy,y=l.radialAxis,v=S.radialDragBoxSize,x=v/2;if(y.visible){var _,b,T,M=F(l.radialAxisAngle),E=y._rl,C=E[0],I=E[1],L=E[n],P=.75*(E[1]-E[0])/(1-l.getHole(e))/h;n?(_=p+(h+x)*Math.cos(M),b=d-(h+x)*Math.sin(M),T="radialdrag"):(_=p+(f-x)*Math.cos(M),b=d-(f-x)*Math.sin(M),T="radialdrag-inner");var z,D,O,R=m.makeRectDragger(u,T,"crosshair",-x,-x,v,v),B={element:R,gd:c};!1===t.dragmode&&(B.dragmode=!1),H(r.select(R),y.visible&&f0==(n?O>C:O")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),vT=d({"src/traces/scatterpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:hT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:fT(),supplyDefaults:pT().supplyDefaults,colorbar:fi(),formatLabels:dT(),calc:mT(),plot:gT(),style:di().style,styleOnSelect:di().styleOnSelect,hoverPoints:yT().hoverPoints,selectPoints:yi(),meta:{}}}}),xT=d({"lib/scatterpolar.js"(t,e){e.exports=vT()}}),_T=d({"src/traces/scatterpolargl/attributes.js"(t,e){var r=fT(),n=zg(),i=Dt().texttemplateAttrs;e.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}}),bT=d({"src/traces/scatterpolargl/defaults.js"(t,e){var r=se(),n=We(),i=pT().handleRThetaDefaults,a=Zn(),o=Wn(),s=Xn(),l=$n(),c=_n().PTS_LINESONLY,u=_T();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}var d=i(t,e,f,p);d?(p("thetaunit"),p("mode",d=l&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=b),v.line&&b.length>1&&s.extendFlat(v.line,o.linePositions(t,p,b)),v.text&&(s.extendFlat(v.text,{positions:b},o.textPosition(t,p,v.text,v.marker)),s.extendFlat(v.textSel,{positions:b},o.textPosition(t,p,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:b},o.textPosition(t,p,v.text,v.markerUnsel))),v.fill&&!f.fill2d&&(f.fill2d=!0),v.marker&&!f.scatter2d&&(f.scatter2d=!0),v.line&&!f.line2d&&(f.line2d=!0),v.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(v.line),f.fillOptions.push(v.fill),f.markerOptions.push(v.marker),f.markerSelectedOptions.push(v.markerSel),f.markerUnselectedOptions.push(v.markerUnsel),f.textOptions.push(v.text),f.textSelectedOptions.push(v.textSel),f.textUnselectedOptions.push(v.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=y,d.positions=b,d._scene=f,d.index=f.count,f.count++}})),i(t,e,c)}},e.exports.reglPrecompiled={}}}),ST=d({"src/traces/scatterpolargl/index.js"(t,e){var r=AT();r.plot=MT(),e.exports=r}}),ET=d({"lib/scatterpolargl.js"(t,e){e.exports=ST()}}),CT=d({"src/traces/barpolar/attributes.js"(t,e){var r,n=Dt().hovertemplateAttrs,i=O().extendFlat,a=fT(),o=Ha();e.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:(r=i({},o.marker),delete r.cornerradius,r),hoverinfo:a.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}}}),IT=d({"src/traces/barpolar/layout_attributes.js"(t,e){e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),LT=d({"src/traces/barpolar/defaults.js"(t,e){var r=se(),n=pT().handleRThetaDefaults,i=Za(),a=CT();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}n(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(t,e,l,o,s),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}}}),PT=d({"src/traces/barpolar/layout_defaults.js"(t,e){var r=se(),n=IT();e.exports=function(t,e,i){var a,o={};function s(i,o){return r.coerce(t[a]||{},e[a],n,i,o)}for(var l=0;l0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,t.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,e,r)}:function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),d=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(d,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,a=r.select(this),o=t.rp0=h.c2p(t.s0),s=t.rp1=h.c2p(t.s1),l=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(n(o)&&n(s)&&n(l)&&n(d)&&o!==s&&l!==d){var m=h.c2g(t.s1),g=(l+d)/2;t.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],e=p(o,s,l,d)}else e="M0,0Z";i.ensureSingle(a,"path").attr("d",e)})),a.setClipUrl(o,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}}}),OT=d({"src/traces/barpolar/hover.js"(t,e){var r=zr(),n=se(),i=eo().getTraceColor,a=n.fillText,o=yT().makeHoverPointText,s=oT().isPtInsidePolygon;e.exports=function(t,e,l){var c=t.cd,u=c[0].trace,h=t.subplot,f=h.radialAxis,p=h.angularAxis,d=h.vangles,m=d?s:n.isPtInsideSector,g=t.maxHoverDistance,y=p._period||2*Math.PI,v=Math.abs(f.g2p(Math.sqrt(e*e+l*l))),x=Math.atan2(l,e);if(f.range[0]>f.range[1]&&(x+=Math.PI),r.getClosest(c,(function(t){return m(v,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var _=c[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var b=n.extendFlat({},_,{r:_.s,theta:_.p});return a(_,u,t),o(b,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}}}),RT=d({"src/traces/barpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"barpolar",basePlotModule:hT(),categories:["polar","bar","showLegend"],attributes:CT(),layoutAttributes:IT(),supplyDefaults:LT(),supplyLayoutDefaults:PT(),calc:zT().calc,crossTraceCalc:zT().crossTraceCalc,plot:DT(),colorbar:fi(),formatLabels:dT(),style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:OT(),selectPoints:no(),meta:{}}}}),FT=d({"lib/barpolar.js"(t,e){e.exports=RT()}}),jT=d({"src/plots/smith/constants.js"(t,e){e.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),BT=d({"src/plots/smith/layout_attributes.js"(t,e){var r=V(),n=Ce(),i=Ta().attributes,a=se().extendFlat,o=Lt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);e.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),NT=d({"src/plots/smith/layout_defaults.js"(t,e){var r,n,i,a=se(),o=q(),s=ge(),l=qs(),c=be().getSubplotData,u=Ne(),h=Be(),f=bi(),p=tr(),d=BT(),m=jT(),g=m.axisNames,y=(r=function(t){return a.isTypedArray(t)&&(t=Array.from(t)),t.slice().reverse().map((function(t){return-t})).concat([0]).concat(t)},n=String,i={},function(t){var e=n?n(t):t;if(e in i)return i[e];var a=r(t);return i[e]=a,a});function v(t,e,r,n){var i=r("bgcolor");n.bgColor=o.combine(i,n.paper_bgcolor);var l,v=c(n.fullData,m.name,n.id),x=n.layoutOut;function _(t,e){return r(l+"."+t,e)}for(var b=0;b")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),YT=d({"src/traces/scattersmith/index.js"(t,e){e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:UT(),categories:["smith","symbols","showLegend","scatter-like"],attributes:VT(),supplyDefaults:qT(),colorbar:fi(),formatLabels:HT(),calc:GT(),plot:ZT(),style:di().style,styleOnSelect:di().styleOnSelect,hoverPoints:WT().hoverPoints,selectPoints:yi(),meta:{}}}}),XT=d({"lib/scattersmith.js"(t,e){e.exports=YT()}}),$T=d({"node_modules/world-calendars/dist/main.js"(t,e){var r=cy();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}r(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),r(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var l=e.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),KT=d({"node_modules/world-calendars/dist/plus.js"(){var t=cy(),e=$T();t(e.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),e.local=e.regionalOptions[""],t(e.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),t(e.baseCalendar.prototype,{UNIX_EPOCH:e.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:e.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,r,n){if("string"!=typeof t&&(n=r,r=t,t=""),!r)return"";if(r.calendar()!==this)throw e.local.invalidFormat||e.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var i,a,o,s,l,c=(n=n||{}).dayNamesShort||this.local.dayNamesShort,u=n.dayNames||this.local.dayNames,h=n.monthNumbers||this.local.monthNumbers,f=n.monthNamesShort||this.local.monthNamesShort,p=n.monthNames||this.local.monthNames,d=(n.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),m=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length1},x=function(t,n){var i=v(t,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(A).match(o);if(!s)throw(e.local.missingNumberAt||e.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var t=l.call(_,r.substring(A));return A+=t.length,t}return x("m")},w=function(t,n,i,a){for(var o=v(t,a)?i:n,s=0;s-1){p=1,d=m;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})}}),JT=d({"node_modules/world-calendars/dist/calendars/chinese.js"(){var t=$T(),e=cy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(a);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),o=""+this.toChineseMonth(n,i);return e&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(t){if("string"==typeof t){var e=t.match(o);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(s);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(e,r,n){var i=this.intercalaryMonth(e);if(n&&r!==i||r<1||r>12)throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(e,r){e.year&&(r=(e=e.year()).month());var n=this.intercalaryMonth(e);if(r<0||r>(n?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(e,n,i){var a,o=this._validateYear(e,t.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,n,i)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(e,r){e.year&&(r=e.month(),e=e.year()),e=this._validateYear(e);var n=l[e-l[0]];if(r>(n>>13?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,s,i,t.local.invalidDate);e=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(e,n),s=this.toChineseMonth(e,n),u=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var u;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:u}}s=o.day-1;var h,f=l[o.year-l[0]],p=f>>13;h=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(e,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=r.fromJD(t),n=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=c[i.year-c[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=c[a.year-c[0]];var u,h=new Date(o>>9&4095,(o>>5&15)-1,31&o),f=new Date(i.year,i.month-1,i.day);u=Math.round((f-h)/864e5);var p,d=l[a.year-l[0]];for(p=0;p<13;p++){var m=d&1<<12-p?30:29;if(u>13;return!g||p=2&&n<=6},extraInfo:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};t.calendars.discworld=r}}),ek=d({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.ethiopian=r}}),rk=d({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(t){return n(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),12===r&&this.leapYear(e)||8===r&&5===n(this.daysInYear(e),10)?30:9===r&&3===n(this.daysInYear(e),10)?29:this.daysPerMonth[r-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.hebrew=r}}),nk=d({"node_modules/world-calendars/dist/calendars/islamic.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),e=e<=0?e+1:e,(n=i.day())+Math.ceil(29.5*(r-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.islamic=r}}),ik=d({"node_modules/world-calendars/dist/calendars/julian.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()<0?r.year()+1:r.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),n=i.day(),e<0&&e++,r<=2&&(e--,r+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),t.calendars.julian=r}}),ak=d({"node_modules/world-calendars/dist/calendars/mayan.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}function i(t,e){return n(t-1,e)+1}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year();var r=Math.floor(e/400);return e%=400,e+=e<0?400:0,r+"."+Math.floor(e/20)+"."+e%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),18},weekOfYear:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),360},daysInMonth:function(e,r){return this._validate(e,r,this.minDay,t.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate).day()},weekDay:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),!0},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=n(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,n(e,20)]},_toTzolkin:function(t){return[i(20+(t-=this.jdEpoch),20),i(t+4,13)]},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),t.calendars.mayan=r}}),ok=d({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar;var n=t.instance("gregorian");e(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidMonth);(e=a.year())<0&&e++;for(var o=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),t.calendars.nanakshahi=r}}),sk=d({"node_modules/world-calendars/dist/calendars/nepali.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[e][n];return r},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[e][r]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=t.instance(),o=0,s=r,l=e;this._createMissingCalendarData(e);var c=e-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var r=t.instance().fromJD(e),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);e=a.year(),r=a.month(),i=a.day();var o=e-(e>=0?474:473),s=474+n(o,2820);return i+(r<=7?31*(r-1):30*(r-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),i=n(e,1029983),a=2820;if(1029982!==i){var o=Math.floor(i/366),s=n(i,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),t.calendars.persian=r,t.calendars.jalali=r}}),ck=d({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var t=$T(),e=cy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),t.calendars.taiwan=n}}),uk=d({"node_modules/world-calendars/dist/calendars/thai.js"(){var t=$T(),e=cy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),t.calendars.thai=n}}),hk=d({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var t=$T(),e=cy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(e,r){for(var i=this._validate(e,r,this.minDay,t.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;oi)return n[a]-n[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,i=0;ie);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=e-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(e,r,n){var i=t.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,r,n,i){var a=t.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),t.calendars.ummalqura=r;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),fk=d({"src/components/calendars/calendars.js"(t,e){e.exports=$T(),KT(),JT(),QT(),tk(),ek(),rk(),nk(),ik(),ak(),ok(),sk(),lk(),ck(),uk(),hk()}}),pk=d({"src/components/calendars/index.js"(t,e){var r=fk(),n=se(),i=k(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(t,e,r,i){var a={};return a[r]=s,n.coerce(t,e,a,r,i)},c="##",u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function f(t){var e=h[t];return e||(e=h[t]=r.instance(t))}function p(t){return n.extendFlat({},s,{description:t})}function d(t){return"Sets the calendar system to use with `"+t+"` date data."}var m={xcalendar:p(d("x"))},g=n.extendFlat({},m,{ycalendar:p(d("y"))}),y=n.extendFlat({},g,{zcalendar:p(d("z"))}),v=p(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(t,e,r,n){for(var i=0;i{this._element.classList.remove(y),e.trigger(this._element,p),this._maybeScheduleHide()};this._element.classList.remove(m),n.reflow(this._element),this._element.classList.add(g,y),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown())return;if(e.trigger(this._element,u).defaultPrevented)return;const t=()=>{this._element.classList.add(m),this._element.classList.remove(y,g),e.trigger(this._element,h)};this._element.classList.add(y),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(g),super.dispose()}isShown(){return this._element.classList.contains(g)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const r=t.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){e.on(this._element,o,(t=>this._onInteraction(t,!0))),e.on(this._element,s,(t=>this._onInteraction(t,!1))),e.on(this._element,l,(t=>this._onInteraction(t,!0))),e.on(this._element,c,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=_.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return r.enableDismissTrigger(_),n.defineJQueryPlugin(_),_}(r(11),r(956),r(248),r(35))},737:function(t){var e,r;e="undefined"!=typeof self?self:this,r=()=>{"use strict";var t=(()=>{var t=Object.create,e=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,h=(t,e)=>function(){return t&&(e=(0,t[a(t)[0]])(t=0)),e},f=(t,e)=>function(){return e||(0,t[a(t)[0]])((e={exports:{}}).exports,e),e.exports},p=(t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})},d=(t,r,i,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let s of a(r))l.call(t,s)||s===i||e(t,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return t},m=t=>d(e({},"__esModule",{value:!0}),t),g=f({"src/version.js"(t){t.version="3.0.1"}}),y=f({"node_modules/native-promise-only/lib/npo.src.js"(t,e){var r,n,i;r="Promise",n="undefined"!=typeof window?window:t,i=function(){var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function a(t,n){r.add(t,n),e||(e=i(r.drain))}function o(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t0&&a(s,r))}catch(t){u.call(new f(r),t)}}}function u(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&a(s,e))}function h(t,e,r,n){for(var i=0;ie?1:t>=e?0:NaN}function p(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=f,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(f);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return f(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}function b(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function w(t){return"\0"===(t+="")[0]?t.slice(1):t}function T(t){return b(t)in this._}function k(t){return(t=b(t))in this._&&delete this._[t]}function A(){var t=[];for(var e in this._)t.push(w(e));return t}function M(){var t=0;for(var e in this._)++t;return t}function S(){for(var t in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(t){return t}function I(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function L(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=P.length;re;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,c,u,h,f=-1,p=a.length,d=i[s++],m=new _;++f=i.length)return t;var r=[],n=a[e++];return t.forEach((function(t,n){r.push({key:t,values:s(n,e)})})),n?r.sort((function(t,e){return n(t.key,e.key)})):r}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return s(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function U(t){return N(t,G),t}var V=function(t,e){return e.querySelector(t)},q=function(t,e){return e.querySelectorAll(t)},H=function(t,e){var r=t.matches||t[L(t,"matchesSelector")];return(H=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(V=function(t,e){return Sizzle(t,e)[0]||null},q=Sizzle,H=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var G=t.selection.prototype=[];function Z(t){return"function"==typeof t?t:function(){return V(t,this)}}function W(t){return"function"==typeof t?t:function(){return q(t,this)}}G.select=function(t){var e,r,n,i,a=[];t=Z(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),X.hasOwnProperty(r)?{space:X[r],local:t}:t}},G.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each($(r,e[r]));return this}return this.each($(e,r))},G.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=Q(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(t){t=lt.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=pt.get(e);function c(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));c.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ut,t.selection.enter.prototype=ht,ht.append=G.append,ht.empty=G.empty,ht.node=G.node,ht.call=G.call,ht.size=G.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n1?St:t<-1?-St:Math.asin(t)}function Lt(t){return((t=Math.exp(t))+1/t)/2}var Pt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-a,f=u*u+h*h;if(f0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){c&&c.domain(l.range().map((function(t){return(t-f.x)/f.k})).map(l.invert)),h&&h.domain(u.range().map((function(t){return(t-f.y)/f.k})).map(u.invert))}function E(t){g++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function I(t){--g||(t({type:"zoomend"}),r=null)}function L(){var e=this,r=b.of(e,arguments),n=0,i=t.select(o(e)).on(v,(function(){n=1,A(t.mouse(e),a),C(r)})).on(x,(function(){i.on(v,null).on(x,null),s(n),I(r)})),a=T(t.mouse(e)),s=vt(e);Zi.call(e),E(r)}function P(){var e,r=this,n=b.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=t.select(r),p=vt(r);function d(){var n=t.touches(r);return e=f.k,n.forEach((function(t){t.identifier in i&&(i[t.identifier]=T(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(c,v),u.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o1){y=p[0];var x=p[1],_=y[0]-x[0],b=y[1]-x[1];a=_*_+b*b}}function g(){var o,l,c,u,h=t.touches(r);Zi.call(r);for(var f=0,p=h.length;f360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new te(a(t+120),a(t),a(t-120))}function Nt(e,r,n){return this instanceof Nt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Nt?new Nt(e.h,e.c,e.l):$t(e instanceof qt?e.l:(e=se((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Nt(e,r,n)}jt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,this.l/t)},jt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ft(this.h,this.s,t*this.l)},jt.rgb=function(){return Bt(this.h,this.s,this.l)},t.hcl=Nt;var Ut=Nt.prototype=new Rt;function Vt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new qt(r,Math.cos(t*=Et)*e,Math.sin(t)*e)}function qt(t,e,r){return this instanceof qt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof qt?new qt(t.l,t.a,t.b):t instanceof Nt?Vt(t.h,t.c,t.l):se((t=te(t)).r,t.g,t.b):new qt(t,e,r)}Ut.brighter=function(t){return new Nt(this.h,this.c,Math.min(100,this.l+Ht*(arguments.length?t:1)))},Ut.darker=function(t){return new Nt(this.h,this.c,Math.max(0,this.l-Ht*(arguments.length?t:1)))},Ut.rgb=function(){return Vt(this.h,this.c,this.l).rgb()},t.lab=qt;var Ht=18,Gt=.95047,Zt=1,Wt=1.08883,Yt=qt.prototype=new Rt;function Xt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new te(Qt(3.2404542*(i=Jt(i)*Gt)-1.5371385*(n=Jt(n)*Zt)-.4985314*(a=Jt(a)*Wt)),Qt(-.969266*i+1.8760108*n+.041556*a),Qt(.0556434*i-.2040259*n+1.0572252*a))}function $t(t,e,r){return t>0?new Nt(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Nt(NaN,NaN,t)}function Jt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Kt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function Qt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function te(t,e,r){return this instanceof te?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof te?new te(t.r,t.g,t.b):ae(""+t,te,Bt):new te(t,e,r)}function ee(t){return new te(t>>16,t>>8&255,255&t)}function re(t){return ee(t)+""}Yt.brighter=function(t){return new qt(Math.min(100,this.l+Ht*(arguments.length?t:1)),this.a,this.b)},Yt.darker=function(t){return new qt(Math.max(0,this.l-Ht*(arguments.length?t:1)),this.a,this.b)},Yt.rgb=function(){return Xt(this.l,this.a,this.b)},t.rgb=te;var ne=te.prototype=new Rt;function ie(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ae(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(ce(i[0]),ce(i[1]),ce(i[2]))}return(a=ue.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function oe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ft(n,i,l)}function se(t,e,r){var n=Kt((.4124564*(t=le(t))+.3575761*(e=le(e))+.1804375*(r=le(r)))/Gt),i=Kt((.2126729*t+.7151522*e+.072175*r)/Zt);return qt(116*i-16,500*(n-i),200*(i-Kt((.0193339*t+.119192*e+.9503041*r)/Wt)))}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ce(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ne.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=i.call(o,c)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(e)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,c)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(u=t,o):u},o.response=function(t){return i=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),c.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(t){i(null,t)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ue.forEach((function(t,e){ue.set(t,ee(e))})),t.functor=he,t.xhr=fe(C),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=pe(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(ye),ye=setTimeout(_e,e)),ge=0):(ge=1,ve(_e))}function be(){for(var t=Date.now(),e=de;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function we(){for(var t,e=de,r=1/0;e;)e.c?(e.t1&&(e=t[a[o-2]],r=t[a[o-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function Me(t,e){return t[0]-e[0]||t[1]-e[1]}t.timer=function(){xe.apply(this,arguments)},t.timer.flush=function(){be(),we()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},t.geom={},t.geom.hull=function(t){var e=Te,r=ke;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=he(e),a=he(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)p.push(t[s[c[n]][2]]);for(n=+h;nwt)s=s.L;else{if(!((i=a-He(s,o))>wt)){n>-wt?(e=s.P,r=s):i>-wt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Be(t);if(ze.insert(e,l),e||r){if(e===r)return Xe(e),r=Be(e.site),ze.insert(l,r),l.edge=r.edge=Ke(e.site,l.site),Ye(e),void Ye(r);if(r){Xe(e),Xe(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,p=t.y-h,d=r.site,m=d.x-u,g=d.y-h,y=2*(f*g-p*m),v=f*f+p*p,x=m*m+g*g,_={x:(g*v-p*x)/y+u,y:(f*x-m*v)/y+h};tr(r.edge,c,d,_),l.edge=Ke(c,t,null,_),r.edge=Ke(t,d,null,_),Ye(e),Ye(r)}else l.edge=Ke(e.site,l.site)}}function qe(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function He(t,e){var r=t.N;if(r)return qe(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ge(t){this.site=t,this.edges=[]}function Ze(t,e){return e.angle-t.angle}function We(){nr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ye(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-Tt)){var f=l*l+c*c,p=u*u+g*g,d=(g*f-c*p)/h,m=(l*p-u*f)/h,g=m+s,y=Fe.pop()||new We;y.arc=t,y.site=i,y.x=d+o,y.y=g+Math.sqrt(d*d+m*m),y.cy=g,t.circle=y;for(var v=null,x=Oe._;x;)if(y.y=s)return;if(f>d){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(f>d){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(e/=f,f<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=i-l,f||!(e<0)){if(e/=f,f<0){if(e>h)return;e>u&&(u=e)}else if(f>0){if(e0)){if(e/=p,p<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=a-c,p||!(e<0)){if(e/=p,p<0){if(e>h)return;e>u&&(u=e)}else if(p>0){if(e0&&(t.a={x:l+u*f,y:c+u*p}),h<1&&(t.b={x:l+h*f,y:c+h*p}),t}}}}}),l=o.length;l--;)(!$e(e=o[l],t)||!s(e)||v(e.a.x-e.b.x)wt||v(i-r)>wt)&&(s.splice(o,0,new er(Qe(a.site,u,v(n-h)wt?{x:h,y:v(e-h)wt?{x:v(r-d)wt?{x:f,y:v(e-f)wt?{x:v(r-p)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/wt)*wt,y:Math.round(i(t,e)/wt)*wt,i:e}}))}return o.links=function(t){return sr(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return sr(s(t)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(Ze),u=-1,h=c.length,f=c[h-1].edge,p=f.l===l?f.r:f.l;++ua&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:mr(r,n)})),a=vr.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;hm&&(m=_),b>g&&(g=b),c.push(_),u.push(b)}var w=m-p,T=g-d;function k(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(v(l-r)+v(c-n)<.01)A(t,e,r,n,i,a,o,s);else{var u=t.point;t.x=t.y=t.point=null,A(t,u,l,c,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,f=h<<1|u;t.leaf=!1,u?i=l:o=l,h?a=c:s=c,k(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>T?g=d+w:m=p+T;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){k(M,t,+y(t,++h),+x(t,h),p,d,m,g)},visit:function(t){fr(t,M,p,d,m,g)},find:function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,f,p){if(!(u>a||h>o||f=b)<<1|e>=_,T=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function _r(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Cr(t){return 1-Math.cos(t*St)}function Ir(t){return Math.pow(2,10*(t-1))}function Lr(t){return 1-Math.sqrt(1-t*t)}function Pr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function zr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Dr(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=Rr(i),s=Or(i,a),l=Rr(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=wr.get(i)||br,a=Tr.get(a)||C,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Vt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(t){return Bt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return Xt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=zr,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new Dr(e?e.matrix:Fr)})(e)},Dr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Fr={a:1,b:0,c:0,d:1,e:0,f:0};function jr(t){return t.length?t.pop()+",":""}function Br(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(jr(r)+"rotate(",null,")")-2,x:mr(t,e)})):e&&r.push(jr(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(jr(r)+"skewX(",null,")")-2,x:mr(t,e)}):e&&r.push(jr(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(jr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(t[0],e[0])},{i:i-2,x:mr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(jr(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=xe(s.tick)),s):n},s.start=function(){var t,e,r,n=y.length,l=v.length,u=c[0],d=c[1];for(t=0;t=0;)r.push(i[n])}function tn(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return tn(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qr(t,(function(t){t.children&&(t.value=0)})),tn(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,e,r,i){var a=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(r=t.value?r/t.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function mn(t){return t.reduce(gn,0)}function gn(t,e){return t+e[1]}function yn(t,e){return vn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function xn(e){return[t.min(e),t.max(e)]}function _n(t,e){return t.value-e.value}function bn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function wn(t,e){t._pack_next=e,e._pack_prev=t}function Tn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function kn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,f=-1/0;if(e.forEach(An),(r=e[0]).x=-r.r,r.y=0,x(r),l>1&&((n=e[1]).x=n.r,n.y=0,x(n),l>2))for(En(r,n,i=e[2]),x(i),bn(r,i),r._pack_prev=i,bn(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&((s=c[t.bisect(f,l,1,d)-1]).y+=m,s.push(a[o]));return c}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=he(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return vn(e,t)}:he(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(_n),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,tn(s,(function(t){t.r=+u(t.value)})),tn(s,kn),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;tn(s,(function(t){t.r+=h})),tn(s,kn),tn(s,(function(t){t.r-=h}))}return Sn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Kr(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=null;function a(t,a){var c=e.call(this,t,a),u=c[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;op.x&&(p=t),t.depth>d.depth&&(d=t)}));var m=r(f,p)/2-f.x,g=n[0]/(p.x+r(p,f)/2+m),y=n[1]/(d.depth||1);Qr(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*y}))}return c}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=Ln(s),a=In(a),s&&a;)l=In(l),(o=Ln(o)).a=t,(i=s.z+h-a.z-c+r(s._,a._))>0&&(Pn(zn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!In(l)&&(l.t=a,l.m+=c-f,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Kr(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),c=l[0],u=0;tn(c,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?u+=r(e,s):0,e.y=0,s=e)}));var h=Dn(c),f=On(c),p=h.x-r(h,f)/2,d=f.x+r(f,h)/2;return tn(c,i?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(d-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Kr(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Rn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=f?(c.pop(),f=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,f=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(h)}}function f(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(u(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(f)}}function p(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*a*c)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,c=r.y,u=e?n(t.area/e):0;if(e==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?Hn:Nn,l=n?Ur:Nr;return i=o(t,e,l,r),a=o(e,t,l,xr),s}function s(t){return i(t)}return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},s.range=function(t){return arguments.length?(e=t,o()):e},s.rangeRound=function(t){return s.range(t).interpolate(zr)},s.clamp=function(t){return arguments.length?(n=t,o()):n},s.interpolate=function(t){return arguments.length?(r=t,o()):r},s.ticks=function(e){return Xn(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Wn(t,e),o()},s.copy=function(){return Gn(t,e,r,n)},o()}function Zn(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function Wn(t,e){return Un(t,Vn(Yn(t,e)[2])),Un(t,Vn(Yn(t,e)[2])),t}function Yn(t,e){null==e&&(e=10);var r=jn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Xn(e,r){return t.range.apply(t,Yn(e,r))}function $n(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Un(n.map(i),r?Math:Jn);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=jn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;f--)o.push(a(c)*f);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.copy=function(){return $n(t.copy(),e,r,n)},Zn(o,t)}t.scale.linear=function(){return Gn([0,1],[0,1],xr,!1)},t.scale.log=function(){return $n(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Jn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Kn(t,e,r){var n=Qn(e),i=Qn(1/e);function a(e){return t(n(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),a):r},a.ticks=function(t){return Xn(r,t)},a.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},a.nice=function(t){return a.domain(Wn(r,t))},a.exponent=function(o){return arguments.length?(n=Qn(e=o),i=Qn(1/e),t.domain(r.map(n)),a):e},a.copy=function(){return Kn(t.copy(),e,r)},Zn(a,t)}function Qn(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ti(e,r){var n,i,a;function o(t){return i[((n.get(t)||("range"===r.t?n.set(t,e.push(t)):NaN))-1)%i.length]}function s(r,n){return t.range(e.length).map((function(t){return r+n*t}))}return o.domain=function(t){if(!arguments.length)return e;e=[],n=new _;for(var i,a=-1,s=t.length;++a0?n[t-1]:e[0],th?0:1;if(c=Mt)return l(c,p)+(s?l(s,1-p):"")+"Z";var d,m,g,y,v,x,_,b,w,T,k,A,M=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=It(g/c*Math.sin(y))),s&&(M=It(g/s*Math.sin(y)))),c){v=c*Math.cos(u+S),x=c*Math.sin(u+S),_=c*Math.cos(h-S),b=c*Math.sin(h-S);var C=Math.abs(h-u-2*S)<=kt?0:1;if(S&&gi(v,x,_,b)===p^C){var I=(u+h)/2;v=c*Math.cos(I),x=c*Math.sin(I),_=b=null}}else v=x=0;if(s){w=s*Math.cos(h-M),T=s*Math.sin(h-M),k=s*Math.cos(u+M),A=s*Math.sin(u+M);var L=Math.abs(u-h+2*M)<=kt?0:1;if(M&&gi(w,T,k,A)===1-p^L){var P=(u+h)/2;w=s*Math.cos(P),T=s*Math.sin(P),k=A=null}}else w=T=0;if(f>wt&&(d=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function yi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,p=e[1]+c,d=(u+f)/2,m=(h+p)/2,g=f-u,y=p-h,v=g*g+y*y,x=r-n,_=u*p-f*h,b=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-_*_)),w=(_*y-g*b)/v,T=(-_*g-y*b)/v,k=(_*y+g*b)/v,A=(-_*g+y*b)/v,M=w-d,S=T-m,E=k-d,C=A-m;return M*M+S*S>E*E+C*C&&(w=k,T=A),[[w-l,T-c],[w*r/x,T*r/x]]}function vi(){return!0}function xi(t){var e=Te,r=ke,n=vi,i=bi,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,f=he(e),p=he(r);function d(){l.push("M",i(t(c),o))}for(;++u1&&i.push("H",n[0]),i.join("")},"step-before":Ti,"step-after":ki,basis:Si,"basis-open":function(t){if(t.length<4)return bi(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ei(Li,a)+","+Ei(Li,o)),--n;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function bi(t){return t.length>1?t.join("L"):t+"Z"}function wi(t){return t.join("L")+"Z"}function Ti(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;ckt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=he(t),a):r},a.source=function(e){return arguments.length?(t=he(e),a):t},a.target=function(t){return arguments.length?(e=he(t),a):e},a.startAngle=function(t){return arguments.length?(n=he(t),a):n},a.endAngle=function(t){return arguments.length?(i=he(t),a):i},a},t.svg.diagonal=function(){var t=Ri,e=Fi,r=Bi;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=he(e),n):t},n.target=function(t){return arguments.length?(e=he(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=Bi,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=Ui,e=Ni;function r(r,n){return(qi.get(t.call(this,r,n))||Vi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=he(e),r):t},r.size=function(t){return arguments.length?(e=he(t),r):e},r};var qi=t.map({circle:Vi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Gi)),r=e*Gi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Hi),r=e*Hi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Hi),r=e*Hi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=qi.keys();var Hi=Math.sqrt(3),Gi=Math.tan(30*Et);G.transition=function(t){for(var e,r,n=Xi||++Ki,i=ea(t),a=[],o=$i||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--f].call(t,o);if(a>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(a=i.time,o=xe((function(t){var e=h.delay;if(o.t=e+a,e<=t)return f(t-e);o.c=f}),0,a),h=u[n]={tween:new _,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}Ji.call=G.call,Ji.empty=G.empty,Ji.node=G.node,Ji.size=G.size,t.transition=function(e,r){return e&&e.transition?Xi?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=Ji,Ji.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=Z(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=t.select(t.event.target),x=n.of(y,arguments),_=t.select(y),b=v.datum(),w=!/^(n|s)$/.test(b)&&i,T=!/^(e|w)$/.test(b)&&a,k=v.classed("extent"),A=vt(y),M=t.mouse(y),S=t.select(o(y)).on("keydown.brush",(function(){32==t.event.keyCode&&(k||(h=null,M[0]-=s[1],M[1]-=l[1],k=2),R())})).on("keyup.brush",(function(){32==t.event.keyCode&&2==k&&(M[0]+=s[1],M[1]+=l[1],k=0,R())}));if(t.event.changedTouches?S.on("touchmove.brush",I).on("touchend.brush",P):S.on("mousemove.brush",I).on("mouseup.brush",P),_.interrupt().selectAll("*").interrupt(),k)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(b){var E=+/w$/.test(b),C=+/^n/.test(b);g=[s[1-E]-M[0],l[1-C]-M[1]],M[0]=s[E],M[1]=l[C]}else t.event.altKey&&(h=M.slice());function I(){var e=t.mouse(y),r=!1;g&&(e[0]+=g[0],e[1]+=g[1]),k||(t.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]0))return o;do{o.push(a=new Date(+e)),i(e,n),t(e)}while(a=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;i(t,-1),!e(t););else for(;--r>=0;)for(;i(t,1),!e(t););}))},a&&(s.count=function(n,i){return e.setTime(+n),r.setTime(+i),t(e),t(r),Math.floor(a(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var i=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*o)}),(function(t,e){return(e-t)/o}),(function(t){return t.getUTCSeconds()})),f=h.range,p=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getMinutes()})),d=p.range,m=n((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*o-t.getMinutes()*s)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getHours()})),g=m.range,y=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/c}),(function(t){return t.getDate()-1})),v=y.range;function x(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/u}))}var _=x(0),b=x(1),w=x(2),T=x(3),k=x(4),A=x(5),M=x(6),S=_.range,E=b.range,C=w.range,I=T.range,L=k.range,P=A.range,z=M.range,D=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),O=D.range,R=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));R.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var F=R.range,j=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCMinutes()})),B=j.range,N=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*l)}),(function(t,e){return(e-t)/l}),(function(t){return t.getUTCHours()})),U=N.range,V=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCDate()-1})),q=V.range;function H(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/u}))}var G=H(0),Z=H(1),W=H(2),Y=H(3),X=H(4),$=H(5),J=H(6),K=G.range,Q=Z.range,tt=W.range,et=Y.range,rt=X.range,nt=$.range,it=J.range,at=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ot=at.range,st=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));st.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var lt=st.range;t.timeDay=y,t.timeDays=v,t.timeFriday=A,t.timeFridays=P,t.timeHour=m,t.timeHours=g,t.timeInterval=n,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=p,t.timeMinutes=d,t.timeMonday=b,t.timeMondays=E,t.timeMonth=D,t.timeMonths=O,t.timeSaturday=M,t.timeSaturdays=z,t.timeSecond=h,t.timeSeconds=f,t.timeSunday=_,t.timeSundays=S,t.timeThursday=k,t.timeThursdays=L,t.timeTuesday=w,t.timeTuesdays=C,t.timeWednesday=T,t.timeWednesdays=I,t.timeWeek=_,t.timeWeeks=S,t.timeYear=R,t.timeYears=F,t.utcDay=V,t.utcDays=q,t.utcFriday=$,t.utcFridays=nt,t.utcHour=N,t.utcHours=U,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=j,t.utcMinutes=B,t.utcMonday=Z,t.utcMondays=Q,t.utcMonth=at,t.utcMonths=ot,t.utcSaturday=J,t.utcSaturdays=it,t.utcSecond=h,t.utcSeconds=f,t.utcSunday=G,t.utcSundays=K,t.utcThursday=X,t.utcThursdays=rt,t.utcTuesday=W,t.utcTuesdays=tt,t.utcWednesday=Y,t.utcWednesdays=et,t.utcWeek=G,t.utcWeeks=K,t.utcYear=st,t.utcYears=lt,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}}),_=f({"node_modules/d3-time-format/dist/d3-time-format.js"(t,e){var r,n;r=t,n=function(t,e){function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function i(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function a(t){var a=t.dateTime,o=t.date,l=t.time,c=t.periods,u=t.days,h=t.shortDays,f=t.months,vt=t.shortMonths,xt=p(c),_t=d(c),bt=p(u),wt=d(u),Tt=p(h),kt=d(h),At=p(f),Mt=d(f),St=p(vt),Et=d(vt),Ct={a:function(t){return h[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return vt[t.getMonth()]},B:function(t){return f[t.getMonth()]},c:null,d:O,e:O,f:N,H:R,I:F,j,L:B,m:U,M:V,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:gt,s:yt,S:q,u:H,U:G,V:Z,w:W,W:Y,x:null,X:null,y:X,Y:$,Z:J,"%":mt},It={a:function(t){return h[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return vt[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:K,e:K,f:nt,H:Q,I:tt,j:et,L:rt,m:it,M:at,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:gt,s:yt,S:ot,u:st,U:lt,V:ct,w:ut,W:ht,x:null,X:null,y:ft,Y:pt,Z:dt,"%":mt},Lt={a:function(t,e,r){var n=Tt.exec(e.slice(r));return n?(t.w=kt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=St.exec(e.slice(r));return n?(t.m=Et[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return Dt(t,a,e,r)},d:A,e:A,f:L,H:S,I:S,j:M,L:I,m:k,M:E,p:function(t,e,r){var n=xt.exec(e.slice(r));return n?(t.p=_t[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:D,S:C,u:g,U:y,V:v,w:m,W:x,x:function(t,e,r){return Dt(t,o,e,r)},X:function(t,e,r){return Dt(t,l,e,r)},y:b,Y:_,Z:w,"%":P};function Pt(t,e){return function(r){var n,i,a,o=[],l=-1,c=0,u=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Dt(t,e,r,n){for(var i,a,o=0,l=e.length,c=r.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=Lt[i in s?e.charAt(o++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ct.x=Pt(o,Ct),Ct.X=Pt(l,Ct),Ct.c=Pt(a,Ct),It.x=Pt(o,It),It.X=Pt(l,It),It.c=Pt(a,It),{format:function(t){var e=Pt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=zt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Pt(t+="",It);return e.toString=function(){return t},e},utcParse:function(t){var e=zt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(t,e,r){var n=c.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function z(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function D(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function O(t,e){return h(t.getDate(),e,2)}function R(t,e){return h(t.getHours(),e,2)}function F(t,e){return h(t.getHours()%12||12,e,2)}function j(t,r){return h(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return h(t.getMilliseconds(),e,3)}function N(t,e){return B(t,e)+"000"}function U(t,e){return h(t.getMonth()+1,e,2)}function V(t,e){return h(t.getMinutes(),e,2)}function q(t,e){return h(t.getSeconds(),e,2)}function H(t){var e=t.getDay();return 0===e?7:e}function G(t,r){return h(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function Z(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),h(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function Y(t,r){return h(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function X(t,e){return h(t.getFullYear()%100,e,2)}function $(t,e){return h(t.getFullYear()%1e4,e,4)}function J(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+h(e/60|0,"0",2)+h(e%60,"0",2)}function K(t,e){return h(t.getUTCDate(),e,2)}function Q(t,e){return h(t.getUTCHours(),e,2)}function tt(t,e){return h(t.getUTCHours()%12||12,e,2)}function et(t,r){return h(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return h(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function it(t,e){return h(t.getUTCMonth()+1,e,2)}function at(t,e){return h(t.getUTCMinutes(),e,2)}function ot(t,e){return h(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return h(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ct(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),h(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ut(t){return t.getUTCDay()}function ht(t,r){return h(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function ft(t,e){return h(t.getUTCFullYear()%100,e,2)}function pt(t,e){return h(t.getUTCFullYear()%1e4,e,4)}function dt(){return"+0000"}function mt(){return"%"}function gt(t){return+t}function yt(t){return Math.floor(+t/1e3)}function vt(e){return o=a(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}vt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xt="%Y-%m-%dT%H:%M:%S.%LZ",_t=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(xt),bt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(xt);t.isoFormat=_t,t.isoParse=bt,t.timeFormatDefaultLocale=vt,t.timeFormatLocale=a,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,x()):n((r=r||self).d3=r.d3||{},r.d3)}}),b=f({"node_modules/d3-format/dist/d3-format.js"(t,e){var r;r=t,function(t){function e(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function r(t){return(t=e(Math.abs(t)))?t[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e;return new o({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function o(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function s(t,r){var n=e(t,r);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return s(100*t,e)},r:s,s:function(t,r){var i=e(t,r);if(!i)return t+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+e(t,Math.max(0,r+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function c(t){return t}var u,h=Array.prototype.map,f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function p(t){var e,i,o=void 0===t.grouping||void 0===t.thousands?c:(e=h.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var n=t.length,a=[],o=0,s=e[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(n-=s,n+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",p=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?c:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(h.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",y=void 0===t.nan?"NaN":t.nan+"";function v(t){var e=(t=a(t)).fill,r=t.align,i=t.sign,c=t.symbol,h=t.zero,v=t.width,x=t.comma,_=t.precision,b=t.trim,w=t.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===_&&(_=12),b=!0,w="g"),(h||"0"===e&&"="===r)&&(h=!0,e="0",r="=");var T="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?m:"",A=l[w],M=/[defgprs%]/.test(w);function S(t){var a,s,l,c=T,u=k;if("c"===w)u=A(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?y:A(Math.abs(t),_),b&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?f[8+n/3]:"")+u+(m&&"("===i?")":""),M)for(a=-1,s=t.length;++a(l=t.charCodeAt(a))||l>57){u=(46===l?p+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}x&&!h&&(t=o(t,1/0));var S=c.length+t.length+u.length,E=S>1)+c+t+u+E.slice(S);break;default:t=E+c+t+u}return d(t)}return _=void 0===_?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:v,formatPrefix:function(t,e){var n=v(((t=a(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(r(e)/3))),o=Math.pow(10,-i),s=f[8+i/3];return function(t){return n(o*t)+s}}}}function d(e){return u=p(e),t.format=u.format,t.formatPrefix=u.formatPrefix,u}d({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=o,t.formatDefaultLocale=d,t.formatLocale=p,t.formatSpecifier=a,t.precisionFixed=function(t){return Math.max(0,-r(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(e)/3)))-r(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,r(e)-r(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:(r="undefined"!=typeof globalThis?globalThis:r||self).d3=r.d3||{})}}),w=f({"node_modules/is-string-blank/index.js"(t,e){e.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}}}),T=f({"node_modules/fast-isnumeric/index.js"(t,e){var r=w();e.exports=function(t){var e=typeof t;if("string"===e){var n=t;if(0==(t=+t)&&r(n))return!1}else if("number"!==e)return!1;return t-t<1}}}),k=f({"src/constants/numerical.js"(t,e){e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}}}),A=f({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(t,e){var r;r=t,function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[e.charCodeAt(n)]=n;t.decode=function(t){var e,n,i,a,o,s=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(e=0;e>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},t.encode=function(t){var r,n=new Uint8Array(t),i=n.length,a="";for(r=0;r>2],a+=e[(3&n[r])<<4|n[r+1]>>4],a+=e[(15&n[r+1])<<2|n[r+2]>>6],a+=e[63&n[r+2]];return i%3==2?a=a.substring(0,a.length-1)+"=":i%3==1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:(r="undefined"!=typeof globalThis?globalThis:r||self)["base64-arraybuffer"]={})}}),M=f({"src/lib/is_plain_object.js"(t,e){e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}}}),S=f({"src/lib/array.js"(t){var e=A().decode,r=M(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}t.isTypedArray=o,t.isArrayOrTypedArray=s,t.isArray1D=function(t){return!s(t[0])},t.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t};var l={u1c:"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"==typeof Int8Array?void 0:Int8Array,u1:"undefined"==typeof Uint8Array?void 0:Uint8Array,i2:"undefined"==typeof Int16Array?void 0:Int16Array,u2:"undefined"==typeof Uint16Array?void 0:Uint16Array,i4:"undefined"==typeof Int32Array?void 0:Int32Array,u4:"undefined"==typeof Uint32Array?void 0:Uint32Array,f4:"undefined"==typeof Float32Array?void 0:Float32Array,f8:"undefined"==typeof Float64Array?void 0:Float64Array};function c(t){return t.constructor===ArrayBuffer}function u(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i2)return c[e]=2|c[e],f.set(t,null);if(h){for(o=e;o0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(e[0],e[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),n}}}),P=f({"src/lib/relink_private.js"(t,e){var r=S().isArrayOrTypedArray,n=M();e.exports=function t(e,i){for(var a in i){var o=i[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in e)continue;e[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;ce/2?t-Math.round(t/e)*e:t}}}}),D=f({"node_modules/tinycolor2/tinycolor.js"(t,e){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i,a,l,c={r:0,g:0,b:0},u=1,h=null,f=null,p=null,d=!1,m=!1;return"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=N.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=N.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=N.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=N.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=N.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=N.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=N.hex8.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"}:(e=N.hex6.exec(t))?{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"}:(e=N.hex4.exec(t))?{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"}:!!(e=N.hex3.exec(t))&&{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:i?"name":"hex"}}(e)),"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(i=e.r,a=e.g,l=e.b,c={r:255*I(i,255),g:255*I(a,255),b:255*I(l,255)},d=!0,m="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(h=D(e.s),f=D(e.v),c=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6,u=[n,s,o,o,l,n][c],h=[l,n,n,s,o,o][c],f=[o,o,l,n,n,s][c];return{r:255*u,g:255*h,b:255*f}}(e.h,h,f),d=!0,m="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(h=D(e.s),p=D(e.l),c=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=I(t,360),e=I(e,100),r=I(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,h,p),d=!0,m="hsl"),e.hasOwnProperty("a")&&(u=e.a)),u=C(u),{ok:d,format:e.format||m,r:o(255,s(c.r,0)),g:o(255,s(c.g,0)),b:o(255,s(c.b,0)),a:u}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[z(a(t).toString(16)),z(a(e).toString(16)),z(a(r).toString(16)),z(O(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*I(this._r,255))+"%",g:a(100*I(this._g,255))+"%",b:a(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%)":"rgba("+a(100*I(this._r,255))+"%, "+a(100*I(this._g,255))+"%, "+a(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+p(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+p(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return c(t,e)},c.equals=function(t,e){return!(!t||!e)&&c(t).toRgbString()==c(e).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a,o,s,l=c.readability(t,e);switch(i=!1,(a=r,o=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(a.size||"small").toLowerCase(),"AA"!==o&&"AAA"!==o&&(o="AA"),"small"!==s&&"large"!==s&&(s="small"),n={level:o,size:s}).level+n.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function z(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,j,B,N=(j="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",B="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+j),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+j),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+j),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!N.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)}}),O=f({"src/lib/extend.js"(t){var e=M(),r=Array.isArray;function n(t,i,a,o){var s,l,c,u,h,f,p,d=t[0],m=t.length;if(2===m&&r(d)&&r(t[1])&&0===d.length){if(p=function(t,e){var r,n;for(r=0;r=0))return t;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return t}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(r(t))},a.opacity=function(t){return t?r(t).getAlpha():0},a.addOpacity=function(t,e){var n=r(t).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+e+")"},a.combine=function(t,e){var n=r(t).toRgb();if(1===n.a)return r(t).toRgbString();var i=r(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(t,e,n){var i=r(t).toRgb(),a=r(e).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(t,e,n){var i=r(t);return 1!==i.getAlpha()&&(i=r(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:n?i.darken(n):s).toString()},a.stroke=function(t,e){var n=r(e);t.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(t,e){var n=r(e);t.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,o,s=Object.keys(t);for(e=0;ei.max?r.set(n):r.set(+t)}},integer:{coerceFunction:function(t,r,n,i){-1===(i.extras||[]).indexOf(t)?(f(t)&&(t=p(t)),t%1||!e(t)||void 0!==i.min&&ti.max?r.set(n):r.set(+t)):r.set(t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,n){f(t)&&(t=p(t)),r(t).isValid()?e.set(t):e.set(n)}},colorlist:{coerceFunction:function(t,e,n){Array.isArray(t)&&t.length&&t.every((function(t){return r(t).isValid()}))?e.set(t):e.set(n)}},colorscale:{coerceFunction:function(t,e,r){e.set(a.get(t,r))}},angle:{coerceFunction:function(t,r,n){f(t)&&(t=p(t)),"auto"===t?r.set("auto"):e(t)?r.set(u(+t,360)):r.set(n)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||c(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!c(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a/g),l=0;l1){var e=["LOG:"];for(t=0;t1){var i=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(r.logging>0){var e=["WARN:"];for(t=0;t0){var i=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(r.logging>0){var e=["ERROR:"];for(t=0;t0){var i=[];for(t=0;t"),"stick")}}}}),$=f({"src/lib/noop.js"(t,e){e.exports=function(){}}}),J=f({"src/lib/push_unique.js"(t,e){e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n0){for(var n=[],i=0;i=e&&n<=r?n:l}if("string"!=typeof n&&"number"!=typeof n)return l;n=String(n);var _=x(i),b=n.charAt(0);!_||"G"!==b&&"g"!==b||(n=n.substr(1),i="");var w=_&&"chinese"===i.substr(0,7),T=n.match(w?y:g);if(!T)return l;var k=T[1],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),C=Number(T[11]||0);if(_){if(2===k.length)return l;var I;k=Number(k);try{var L=d.getComponentMethod("calendars","getCal")(i);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),I=L.newDate(k,L.toMonthIndex(k,A,P),M)}else I=L.newDate(k,Number(A),M)}catch(t){return l}return I?(I.toJD()-p)*c+S*u+E*h+C*f:l}k=2===k.length?(Number(k)+2e3-v)%100+v:Number(k),A-=1;var z=new Date(Date.UTC(2e3,A,M,S,E));return z.setUTCFullYear(k),z.getUTCMonth()!==A||z.getUTCDate()!==M?l:z.getTime()+C*f},e=t.MIN_MS=t.dateTime2ms("-9999"),r=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(e,r){return t.dateTime2ms(e,r)!==l};var w=90*c,A=3*u,M=5*h;function S(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+b(e,2)+":"+b(r,2),(n||i)&&(t+=":"+b(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+b(i,a)}return t}t.ms2DateTime=function(t,n,i){if("number"!=typeof t||!(t>=e&&t<=r))return l;n||(n=0);var a,s,g,y,v,_,b=Math.floor(10*o(t+.05,1)),T=Math.round(t-b/10);if(x(i)){var k=Math.floor(T/c)+p,E=Math.floor(o(t,c));try{a=d.getComponentMethod("calendars","getCal")(i).fromJD(k).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(T))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n=e+c&&t<=r-c))return l;var i=Math.floor(10*o(t+.05,1)),a=new Date(Math.round(t-i/10));return S(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},t.cleanDate=function(e,r,n){if(e===l)return r;if(t.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(!(e=t.ms2DateTimeLocal(+e))&&void 0!==r)return r}else if(!t.isDateTime(e,n))return a.error("unrecognized date",e),r;return e};var E=/%\d?f/g,C=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return I[r("%q")(i)]})),x(n))try{t=d.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(t,e,r,n,a,s){if(a=x(a)&&a,!e)if("y"===r)e=s.year;else if("m"===r)e=s.month;else{if("d"!==r)return function(t,e){var r=o(t+.05,c),n=b(Math.floor(r/u),2)+":"+b(o(Math.floor(r/h),60),2);if("M"!==e){i(e)||(e=0);var a=(100+Math.min(o(t/f,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+L(s.dayMonthYear,t,n,a);e=s.dayMonth+"\n"+s.year}return L(e,t,n,a)};var D=3*c;t.incrementMonth=function(t,e,r){r=x(r)&&r;var n=o(t,c);if(t=Math.round(t-n),r)try{var i=Math.round(t/c)+p,s=d.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return e%12?s.add(l,e,"m"):s.add(l,e/12,"y"),(l.toJD()-p)*c+n}catch(e){a.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+D);return u.setUTCMonth(u.getUTCMonth()+e)+n-D},t.findExactDates=function(t,e){for(var r,n,a=0,o=0,s=0,l=0,u=x(e)&&d.getComponentMethod("calendars","getCal")(e),h=0;he}function c(t,e){return t>=e}t.findBin=function(t,n,i){if(e(n.start))return i?Math.ceil((t-n.start)/n.size-a)-1:Math.floor((t-n.start)/n.size+a);var u,h,f=0,p=n.length,d=0,m=p>1?(n[p-1]-n[0])/(p-1):1;for(h=m>=0?i?o:s:i?c:l,t+=m*a*(i?-1:1)*(m>=0?1:-1);f90&&r.log("Long binary search..."),f-1},t.sorterAsc=function(t,e){return t-e},t.sorterDes=function(t,e){return e-t},t.distinctVals=function(e){var r,n=e.slice();for(n.sort(t.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},t.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},t.findIndexOfMin=function(t,e){e=e||n;for(var r,i=1/0,a=0;aa.length)&&(o=a.length),e(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var n=r%1;return n*t[Math.ceil(r)]+(1-n)*t[Math.floor(r)]}}}),Yt=f({"src/lib/angles.js"(t,e){var r=z(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(t){return Math.abs(t[1]-t[0])>o-1e-14}function l(t,e){return i(e-t,o)}function c(t,e){if(s(e))return!0;var r,i;e[0](i=n(i,o))&&(i+=o);var a=n(t,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(t,e,r,n,i,l,c){i=i||0,l=l||0;var u,h,f,p,d,m=s([r,n]);function g(t,e){return[t*Math.cos(e)+i,l-t*Math.sin(e)]}m?(u=0,h=a,f=o):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return u(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return u(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return u(t,e,r,n,i,a,1)}}}}),Xt=f({"src/lib/anchor_utils.js"(t){t.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},t.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},t.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},t.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},t.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},t.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}}}),$t=f({"src/lib/geometry2d.js"(t){var e,r,n,i=z().mod;function a(t,e,r,n,i,a,o,s){var l=r-t,c=i-t,u=o-i,h=n-e,f=a-e,p=s-a,d=l*p-u*h;if(0===d)return null;var m=(c*p-u*f)/d,g=(c*h-l*f)/d;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function o(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}t.segmentsIntersect=a,t.segmentDistance=function(t,e,r,n,i,s,l,c){if(a(t,e,r,n,i,s,l,c))return 0;var u=r-t,h=n-e,f=l-i,p=c-s,d=u*u+h*h,m=f*f+p*p,g=Math.min(o(u,h,d,i-t,s-e),o(u,h,d,l-t,c-e),o(f,p,m,t-i,e-s),o(f,p,m,r-i,n-s));return Math.sqrt(g)},t.getTextLocation=function(t,a,o,s){if(t===r&&s===n||(e={},r=t,n=s),e[o])return e[o];var l=t.getPointAtLength(i(o-s/2,a)),c=t.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(i(o,a)),f={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return e[o]=f,f},t.clearLocationCache=function(){r=null},t.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function f(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var p=f(c);p;){if((c+=p+r)>h)return;p=f(c)}for(p=f(h);p;){if(c>(h-=p+r))return;p=f(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},t.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,p=s;h0?p=i:f=i,h++}return a}}}),Jt=f({"src/lib/throttle.js"(t){var e={};function r(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}t.throttle=function(t,n,i){var a=e[t],o=Date.now();if(!a){for(var s in e)e[s].tsa.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},t.done=function(t){var r=e[t];return r&&r.timer?new Promise((function(t){var e=r.onDone;r.onDone=function(){e&&e(),t(),r.onDone=null}})):Promise.resolve()},t.clear=function(n){if(n)r(e[n]),delete e[n];else for(var i in e)t.clear(i)}}}),Kt=f({"src/lib/clear_responsive.js"(t,e){e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}}),Qt=f({"node_modules/is-mobile/index.js"(t,e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(t){t||(t={});let e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;let a=r.test(e)&&!n.test(e)||!!t.tablet&&i.test(e);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(a=!0),a}}}),te=f({"src/lib/preserve_drawing_buffer.js"(t,e){var r=T(),n=Qt();e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;return"undefined"!=typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),t}()))return!0;var i=n({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!i)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(r(c)&&(c=+c),c>=13)return!0}}return i}}}),ee=f({"src/lib/make_trace_groups.js"(t,e){var r=v();e.exports=function(t,e,n){var i=t.selectAll("g."+n.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=r.select(this)})),i}}}),re=f({"src/lib/localize.js"(t,e){var r=Vt();e.exports=function(t,e){for(var n=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return e}}}),ne=f({"src/lib/filter_unique.js"(t,e){e.exports=function(t){for(var e={},r=[],n=0,i=0;i1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),oe=f({"src/lib/clean_number.js"(t,e){var r=T(),n=k().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),r(t)?Number(t):n}}}),se=f({"src/lib/index.js"(t,e){var r=v(),n=_().utcFormat,i=b().format,a=T(),o=k(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=e.exports={};u.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};u.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,u.warn('encountered bad format: "'+e+'"'))},u.noFormat=function(t){return String(t)},u.numberFormat=function(t){var e;try{e=i(u.adjustFormat(t))}catch(e){return u.warnBadFormat(t),u.noFormat}return e},u.nestedProperty=E(),u.keyedContainer=C(),u.relativeAttr=I(),u.isPlainObject=M(),u.toLogRange=L(),u.relinkPrivateKeys=P();var f=S();u.isArrayBuffer=f.isArrayBuffer,u.isTypedArray=f.isTypedArray,u.isArrayOrTypedArray=f.isArrayOrTypedArray,u.isArray1D=f.isArray1D,u.ensureArray=f.ensureArray,u.concat=f.concat,u.maxRowLength=f.maxRowLength,u.minRowLength=f.minRowLength;var p=z();u.mod=p.mod,u.modHalf=p.modHalf;var d=Z();u.valObjectMeta=d.valObjectMeta,u.coerce=d.coerce,u.coerce2=d.coerce2,u.coerceFont=d.coerceFont,u.coercePattern=d.coercePattern,u.coerceHoverinfo=d.coerceHoverinfo,u.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,u.validate=d.validate;var m=qt();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Gt();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=Zt();var y=Wt();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var x=Et();u.init2dArray=x.init2dArray,u.transposeRagged=x.transposeRagged,u.dot=x.dot,u.translationMatrix=x.translationMatrix,u.rotationMatrix=x.rotationMatrix,u.rotationXYMatrix=x.rotationXYMatrix,u.apply3DTransform=x.apply3DTransform,u.apply2DTransform=x.apply2DTransform,u.apply2DTransform2=x.apply2DTransform2,u.convertCssMatrix=x.convertCssMatrix,u.inverseTransformMatrix=x.inverseTransformMatrix;var w=Yt();u.deg2rad=w.deg2rad,u.rad2deg=w.rad2deg,u.angleDelta=w.angleDelta,u.angleDist=w.angleDist,u.isFullCircle=w.isFullCircle,u.isAngleInsideSector=w.isAngleInsideSector,u.isPtInsideSector=w.isPtInsideSector,u.pathArc=w.pathArc,u.pathSector=w.pathSector,u.pathAnnulus=w.pathAnnulus;var A=Xt();u.isLeftAnchor=A.isLeftAnchor,u.isCenterAnchor=A.isCenterAnchor,u.isRightAnchor=A.isRightAnchor,u.isTopAnchor=A.isTopAnchor,u.isMiddleAnchor=A.isMiddleAnchor,u.isBottomAnchor=A.isBottomAnchor;var D=$t();u.segmentsIntersect=D.segmentsIntersect,u.segmentDistance=D.segmentDistance,u.getTextLocation=D.getTextLocation,u.clearLocationCache=D.clearLocationCache,u.getVisibleSegment=D.getVisibleSegment,u.findPointOnPath=D.findPointOnPath;var R=O();u.extendFlat=R.extendFlat,u.extendDeep=R.extendDeep,u.extendDeepAll=R.extendDeepAll,u.extendDeepNoArrays=R.extendDeepNoArrays;var F=X();u.log=F.log,u.warn=F.warn,u.error=F.error;var j=G();u.counterRegex=j.counter;var B=Jt();u.throttle=B.throttle,u.throttleDone=B.done,u.clearThrottle=B.clear;var N=Ct();function U(t){var e={};for(var r in t)for(var n=t[r],i=0;is||t=e)&&a(t)&&t>=0&&t%1==0},u.noop=$(),u.identity=Ht(),u.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},u.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},u.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},u.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(t,e,r){var n;function i(){return u.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var tt=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var i;return tt.test(n)?i=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,i=r[n](!0)),void 0!==i?i:""}))};var et={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return ot.apply(et,arguments)};var rt={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return ot.apply(rt,arguments)};var nt=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,it={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return ot.apply(it,arguments)};var at=/^[:|\|]/;function ot(t,e,r){var i=this,a=arguments;return e||(e={}),t.replace(u.TEMPLATE_STRING_REGEX,(function(t,o,s){var l="_xother"===o||"_yother"===o,c="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,f="xother"===o||"yother"===o||l||h||c,p=o;(l||c)&&(p=p.substring(1)),(h||c)&&(p=p.substring(0,p.length-1));var d,m,g,y=null,v=null;if(i.parseMultDiv){var x=function(t){var e=t.match(nt);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(p);p=x.key,y=x.op,v=x.number}if(f){if(void 0===(d=e[p]))return""}else for(g=3;g=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var st=2e9;u.seedPseudoRandom=function(){st=2e9},u.pseudoRandom=function(){var t=st;return st=(69069*st+1)%4294967296,Math.abs(st-t)<429496729?u.pseudoRandom():st/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(t,e,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(t){return t||0===t},u.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(t,e){t.attr("transform",u.getTextTransform(e)),t.style("display",e.scale?null:"none")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},u.bigFont=function(t){return Math.round(1.2*t)};var lt=u.getFirefoxVersion(),ct=null!==lt&<<86;u.getPositionFromD3Event=function(){return ct?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),le=f({"build/plotcss.js"(){var t,e,r=se(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(e in n)t=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(t,n[e])}}),ce=f({"node_modules/is-browser/client.js"(t,e){e.exports=!0}}),ue=f({"node_modules/has-hover/index.js"(t,e){var r,n=ce();r="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,e.exports=r}}),he=f({"node_modules/events/events.js"(t,e){var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,a),n(r)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,a,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,a,o,s;if(l(r),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),o=a[e]),void 0===o)o=a[e]=r,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var c=l.length,u=m(l,c);for(r=0;r=0;a--)if(r[a]===e||r[a].listener===e){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),fe=f({"src/lib/events.js"(t,e){var r=he().EventEmitter,n={init:function(t){if(t._ev instanceof r)return t;var e=new r,n=new r;return t._ev=e,t._internalEv=n,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=n.on.bind(n),t._internalOnce=n.once.bind(n),t._removeInternalListener=n.removeListener.bind(n),t._removeAllInternalListeners=n.removeAllListeners.bind(n),t.emit=function(t,r){e.emit(t,r),n.emit(t,r)},t},triggerHandler:function(t,e,r){var n=t._ev;if(n){var i=n._events[e];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;an.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function _(){var t,r,n={};for(t in c(n,i),e.subplotsRegistry)if((r=e.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(t,r){s?e.nestedProperty(l[c],t).set(r):l[c+"."+t]=r}function f(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:f,applyUpdate:function(r,n){r&&h(r,n);var i=f();for(var a in i)e.nestedProperty(t,a).set(i[a])}}}}}),ye=f({"src/plots/cartesian/constants.js"(t,e){var r=G().counter;e.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),ve=f({"src/plots/cartesian/axis_ids.js"(t){var e=Vt(),r=ye();function n(t,e){if(e&&e.length)for(var r=0;rn?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},t.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},t.isLinked=function(t,e){return n(e,t._axisMatchGroups)||n(e,t._axisConstraintGroups)}}}),xe=f({"src/components/shapes/handle_outline.js"(t,e){e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearOutline:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}}}),_e=f({"src/traces/scatter/layout_attributes.js"(t,e){e.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),be=f({"src/plots/get_data.js"(t){var e=Vt();ye().SUBPLOT_PATTERN,t.getSubplotCalcData=function(t,r,n){var i=e.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s0?".":"")+a;r.isPlainObject(s)?o(s,e,l,i+1):e(l,a,s)}}))}t.manageCommandObserver=function(e,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=t.hasSimpleAPICommandBindings(e,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(e,c,s.cache),s.check=function(){if(l){var t=n(e,c,s.cache);return t.changed&&o&&void 0!==s.lookupTable[t.value]&&(s.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[t.value]})).then(s.enable,s.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){S.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},S.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var n=r.select(t).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=S.graphJson(t,!1,"keepdata"),i.node().submit(),n.remove(),t.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],I=["year","month","dayMonth","dayMonthYear"];function L(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,S.linkSubplots(f,l,h,a),S.cleanPlot(f,l,h,a);var B=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));B&&!N?a._bgLayer.remove():N&&!B&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&d({_fullLayout:a}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var f=S.layoutAttributes.width.min,p=S.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),S.sanitizeMargins(r)},S.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var f in c.length||c.push(h),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),h.finalizeSubplots(t,e)),e._subplots)e._subplots[f].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:w,size:r.b+g},t:{val:b,size:r.t+g}},m[e]=1}else delete d[e],delete m[e];if(!n._replotting)return S.doAutoMargin(t)}},S.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),D(e);var i=e._size,o=e.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,f=o.r,d=o.t,m=o.b,g=e._pushmargin,y=e._pushmarginIds,v=e.minreducedwidth,x=e.minreducedheight;if(!1!==o.autoexpand){for(var _ in g)y[_]||delete g[_];var b=t._fullLayout._reservedMargin;for(var w in b)for(var T in b[w]){var k=b[w][T];l[T]=Math.max(l[T],k)}for(var A in g.base={l:{val:0,size:h},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:m}},l){var M=0;for(var E in g)"base"!==E&&a(g[E][A].size)&&(M=g[E][A].size>M?g[E][A].size:M);var C=Math.max(0,o[A]-M);l[A]=Math.max(0,l[A]-C)}for(var I in g){var L=g[I].l||{},P=g[I].b||{},z=L.val,O=L.size,R=P.val,F=P.size,j=r-l.r-l.l,B=n-l.t-l.b;for(var N in g){if(a(O)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(O*U+(V-j)*z)/(U-z),H=(V*(1-z)+(O-j)*(1-U))/(U-z);q+H>h+f&&(h=q,f=H)}}if(a(F)&&g[N].t){var G=g[N].t.val,Z=g[N].t.size;if(G>R){var W=(F*G+(Z-B)*R)/(G-R),Y=(Z*(1-R)+(F-B)*(1-G))/(G-R);W+Y>m+d&&(m=W,d=Y)}}}}}var X=u.constrain(r-o.l-o.r,2,v),$=u.constrain(n-o.t-o.b,2,x),J=Math.max(0,r-X),K=Math.max(0,n-$);if(J){var Q=(h+f)/J;Q>1&&(h/=Q,f/=Q)}if(K){var tt=(m+d)/K;tt>1&&(m/=tt,d/=tt)}if(i.l=Math.round(h)+l.l,i.r=Math.round(f)+l.r,i.t=Math.round(d)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(S.didMarginChange(c,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var e;o++,n||o!==a||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}S.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},S.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&S.supplyDefaults(t);var s=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function h(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(t[a],e)}else e&&(i[a]="_function")})),i}var a=Array.isArray(t),s=u.isTypedArray(t);if((a||s)&&t.dtype&&t.shape){var l=t.bdata;return h({dtype:t.dtype,shape:t.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},e)}return a?t.map((function(t){return h(t,e)})):s?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(s||[]).map((function(t){var r=h(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=h(l),i)){var p=l._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return c&&(f.frames=h(c)),a&&(f.config=h(t._context,!0)),"object"===n?f:JSON.stringify(f)},S.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(B(o,c,h),i=0;il||m>c)&&(o.style("overflow","hidden"),p=(f=o.node().getBoundingClientRect()).width,m=f.height);var g=+d.attr("x"),y=+d.attr("y"),v=-(i||d.node().getBoundingClientRect().height)/4;if("y"===P[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-p/2,v-m/2)});else if("l"===P[0])y=v-m/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,y=v;else{var x=d.attr("text-anchor");g-=p*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y}),M&&M.call(d,s),t(s)}))}))):z(),d}function z(){L.empty()||(P=d.attr("class")+"-math",L.select("svg."+P).remove()),d.text("").style("white-space","pre");var n=function(t,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function d(){c++;var r=document.createElementNS(i.svg,"tspan");e.select(r).attr({class:"line",dy:c*a+"em"}),t.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag .",n)}var I=x.test(n);I?d():(o=t,l=[{node:t}]);for(var L=n.split(g),P=0;P|>|>)/g,c=[["$","$"],["\\(","\\)"]],u={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},p="​",d=["http:","https:","mailto:","",void 0,":"],m=t.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;t.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var A=/(^|;)\s*color:/;t.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(g),a=[],o="",s=0,l=0;l3?a.push(c.substr(0,p-3)+"..."):a.push(c.substr(0,p));break}o=""}}return a.join("")};var M={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t}))}function C(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==d.indexOf(i)&&-1!==d.indexOf(a)?e:""}function I(t,e,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}t.convertEntities=E,t.sanitizeHTML=function(t){t=t.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=t.split(g),o=0;o=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var a=t.domain,s=t.range,l=s.length,c=new Array(l),u=0;um-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),Ze=f({"src/components/colorscale/index.js"(t,e){var r=U(),n=Se();e.exports={moduleType:"component",name:"colorscale",attributes:Le(),layoutAttributes:Pe(),supplyLayoutDefaults:qe(),handleDefaults:Ve(),crossTraceDefaults:He(),calc:Ge(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),We=f({"src/traces/scatter/subtypes.js"(t,e){var r=se(),n=S().isTypedArraySpec;e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var e=t.marker;return r.isPlainObject(e)&&(r.isArrayOrTypedArray(e.size)||n(e.size))}}}}),Ye=f({"src/traces/scatter/make_bubble_size_func.js"(t,e){var r=T();e.exports=function(t,e){e||(e=2);var n=t.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(t){return Math.sqrt(t/i)}:function(t){return t/i};return function(t){var n=o(t/e);return r(n)&&n>0?Math.max(n,a):0}}}}),Xe=f({"src/components/fx/helpers.js"(t){var e=se();t.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},t.isTraceInSubplots=function(e,r){if("splom"===e.type){for(var n=e.xaxes||[],i=e.yaxes||[],a=0;a=0&&r.index2&&(e.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),e.push(a);if(a.length=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=A||t>=400?0:Math.floor(Math.max(t,0))};var S=i("~f"),E={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function C(t,e,i,a,s,c,u,h,f,p){var d,m=s.length;"linear"===a?d={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:f?"userSpaceOnUse":"objectBoundingBox"},reversed:p}:"radial"===a&&(d={node:"radialGradient",reversed:p});for(var g=new Array(m),y=0;y=0&&void 0===t.i&&(t.i=o.i),e.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),i.ms2mrc){var u;u="various"===t.ms||"various"===s.size?3:i.ms2mrc(t.ms),t.mrc=u,i.selectedSizeFn&&(u=t.mrc=i.selectedSizeFn(t));var h=x.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var f=st(t,r),p=$(t,r);e.attr("d",M(h,u,f,p))}var d,m,g,y=!1;if(t.so)g=c.outlierwidth,m=c.outliercolor,d=s.outliercolor;else{var v=(c||{}).width;g=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=i.lineScale(t.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(d=l.defaultLine,y=!0),d="mc"in t?t.mcc=i.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(d=i.selectedColorFn(t))}if(t.om)e.call(l.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var _=s.gradient,b=t.mgt;b?y=!0:b=_&&_.type,n.isArrayOrTypedArray(b)&&(b=b[0],E[b]||(b=0));var w=s.pattern,T=w&&x.getPatternAttr(w.shape,t.i,"");if(b&&"none"!==b){var k=t.mgc;k?y=!0:k=_.color;var A=r.uid;y&&(A+="-"+t.i),x.gradient(e,a,A,b,[[0,k],[1,d]],"fill")}else if(T){var S=!1,C=w.fgcolor;!C&&o&&o.color&&(C=o.color,S=!0);var I=x.getPatternAttr(C,t.i,o&&o.color||null),L=x.getPatternAttr(w.bgcolor,t.i,null),P=w.fgopacity,z=x.getPatternAttr(w.size,t.i,8),D=x.getPatternAttr(w.solidity,t.i,.3);S=S||t.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var O=r.uid;S&&(O+="-"+t.i),x.pattern(e,"point",a,O,T,z,D,t.mcc,w.fillmode,L,I,P)}else n.isArrayOrTypedArray(d)?l.fill(e,d[t.i]):l.fill(e,d);g&&l.stroke(e,m)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),s.traceIs(t,"symbols")&&(e.ms2mrc=m.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&n.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},i=t.unselected||{},a=t.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,f=void 0!==u,p=void 0!==h;(n.isArrayOrTypedArray(c)||f||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?f?u:e:p?h:d*e});var m=a.color,g=o.color,y=l.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?g||e:y||e});var v=a.size,x=o.size,_=l.size,b=void 0!==x,w=void 0!==_;return s.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?x/2:e:w?_/2:e}),e},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?c||e:u||(c?e:l.addOpacity(e,d))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];n.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",n.selectedOpacityFn(e))})),n.selectedColorFn&&a.push((function(t,e){l.fill(t,n.selectedColorFn(e))})),n.selectedSizeFn&&a.push((function(t,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);t.attr("d",M(x.symbolNumber(a),o,st(r,e),$(r,e))),r.mrc2=o})),a.length&&t.each((function(t){for(var e=r.select(this),n=0;n0?r:0}function R(t,e,r){return r&&(t=V(t)),e?j(t[1]):F(t[0])}function F(t){var e=r.round(t,2);return I=e,e}function j(t){var e=r.round(t,2);return L=e,e}function B(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=3*c*(l+c),p=3*l*(l+c);return[[F(e[0]+(f&&u/f)),j(e[1]+(f&&h/f))],[F(e[0]-(p&&u/p)),j(e[1]-(p&&h/p))]]}x.textPointStyle=function(t,e,i){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=i._fullLayout;t.each((function(t){var o=r.select(this),c=s?n.extractOption(t,e,"txt","texttemplate"):n.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=n.texttemplateString(c,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=O(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:v}).text(c).call(h.convertToTspans,i).call(z,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var n=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=r.select(this),a=n.selectedTextColorFn(t),o=t.tp||e.textposition,c=O(t,e);l.fill(i,a);var u=s.traceIs(e,"bar-like");z(i,o,c,t.mrc2||t.mrc,u)}))}},x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||w>=h&&w<=c)&&(T<=f&&T>=u||T>=f&&T<=u)&&(t=[w,T])}return t}x.steps=function(t){var e=N[t]||U;return function(t){for(var r="M"+F(t[0][0])+","+j(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},G=0),i&&(x.savedBBoxes[i]=g),G++,n.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",W(e,r))},x.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(e,r)).trim(),t[i]("transform",a),a},x.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;x.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var X=/translate\([^)]*\)\s*$/;function $(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,n){t&&t.each((function(){var t,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);t=1===e&&1===n?[]:[u(o,s),"scale("+e+","+n+")",u(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},x.getMarkerStandoff=$;var J,K,Q,tt,et,rt,nt=Math.atan2,it=Math.cos,at=Math.sin;function ot(t,e){var r=e[0],n=e[1];return[r*it(t)-n*at(t),r*at(t)+n*it(t)]}function st(t,e){var r,i,o=t.ma;void 0===o&&((o=e.marker.angle)&&!n.isArrayOrTypedArray(o)||(o=0));var s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);r=l[0],i=l[1]}else{var c=e._xA,u=e._yA;if(!c||!u)return 90;r=c.c2p(t.x),i=u.c2p(t.y)}if(e._geo){var h,f=t.lonlat[0],p=t.lonlat[1],d=e._geo.project([f,p+1e-5]),m=e._geo.project([f+1e-5,p]),g=nt(m[1]-i,m[0]-r),y=nt(d[1]-i,d[0]-r);if("north"===s)h=o/180*Math.PI;else if("previous"===s){var v=f/180*Math.PI,x=p/180*Math.PI,_=J/180*Math.PI,b=K/180*Math.PI,w=_-v,T=it(b)*at(w),k=at(b)*it(x)-it(b)*at(x)*it(w);h=-nt(T,k)-Math.PI,J=f,K=p}var A=ot(g,[it(h),0]),M=ot(y,[at(h),0]);o=nt(A[1]+M[1],A[0]+M[0])/Math.PI*180,"previous"!==s||rt===e.uid&&t.i===et+1||(o=null)}if("previous"===s&&!e._geo)if(rt===e.uid&&t.i===et+1&&a(r)&&a(i)){var S=r-Q,E=i-tt,C=e.line&&e.line.shape||"",I=C.slice(C.length-1);"h"===I&&(E=0),"v"===I&&(S=0),o+=nt(E,S)/Math.PI*180+90}else o=null}return Q=r,tt=i,et=t.i,rt=e.uid,o}x.getMarkerAngle=st}}),Qe=f({"src/components/titles/index.js"(t,e){var r=v(),n=T(),i=Te(),a=Vt(),o=se(),s=o.strTranslate,l=Ke(),c=q(),u=Me(),h=H(),f=Ae().OPPOSITE_SIDE,p=/ [XY][0-9]* /;e.exports={draw:function(t,e,d){var m,g=t._fullLayout,y=d.propContainer,v=d.propName,x=d.placeholder,_=d.traceIndex,b=d.avoid||{},w=d.attributes,T=d.transform,k=d.containerGroup,A=1,M=y.title,S=(M&&M.text?M.text:"").trim(),E=!1,C=M&&M.font?M.font:{},I=C.family,L=C.size,P=C.color,z=C.weight,D=C.style,O=C.variant,R=C.textcase,F=C.lineposition,j=C.shadow,B=!!d.subtitlePropName,N=d.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,Z=G.family,W=G.size,Y=G.color,X=G.weight,$=G.style,J=G.variant,K=G.textcase,Q=G.lineposition,tt=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":v.indexOf(!0)&&(m="colorbarTitleText");var et=t._context.edits[m];function rt(t,e){return void 0!==t&&void 0!==e&&t.replace(p," % ")===e.replace(p," % ")}""===S?A=0:rt(S,x)&&(et||(S=""),A=.2,E=!0),B&&(""===V?H=0:rt(V,N)&&(et||(V=""),H=.2,q=!0)),d._meta?S=o.templateString(S,d._meta):g._meta&&(S=o.templateString(S,g._meta));var nt,it=S||V||et;k||(k=o.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var at=k.selectAll("text."+e).data(it?[0]:[]);at.enter().append("text"),at.text(S).attr("class",e),at.exit().remove();var ot=null,st=e+"-subtitle",lt=V||et;if(B&<&&((ot=k.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),ot.text(V).attr("class",st),ot.exit().remove()),!it)return k;function ct(t,e){o.syncOrAsync([ut,ht],{title:t,subtitle:e})}function ut(n){var a,h=n.title,f=n.subtitle;if(!T&&nt&&(T={}),T?(a="",T.rotate&&(a+="rotate("+[T.rotate,w.x,w.y]+")"),(T.offset||nt)&&(a+=s(0,(T.offset||0)-(nt||0)))):a=null,h.attr("transform",a),h.style("opacity",A*c.opacity(P)).call(l.font,{color:c.rgb(P),size:r.round(L,2),family:I,weight:z,style:D,variant:O,textcase:R,shadow:j,lineposition:F}).attr(w).call(u.convertToTspans,t,(function(t){if(t){var e=r.select(t.node().parentNode).select("."+st);if(!e.empty()){var n=t.node().getBBox();if(n.height){var i=n.y+n.height+1.6*W;e.attr("y",i)}}}})),f){var p=k.select("."+e+"-math-group"),d=h.node().getBBox(),m=p.node()?p.node().getBBox():void 0,g=m?m.y+m.height+1.6*W:d.y+d.height+1.6*W,y=o.extendFlat({},w,{y:g});f.attr("transform",a),f.style("opacity",H*c.opacity(Y)).call(l.font,{color:c.rgb(Y),size:r.round(W,2),family:Z,weight:X,style:$,variant:J,textcase:K,shadow:tt,lineposition:Q}).attr(y).call(u.convertToTspans,t)}return i.previousPromises(t)}function ht(e){var i=e.title,a=r.select(i.node().parentNode);if(b&&b.selection&&b.side&&S){a.attr("transform",null);var c=f[b.side],u="left"===b.side||"top"===b.side?-1:1,h=n(b.pad)?b.pad:2,p=l.bBox(a.node()),d={t:0,b:0,l:0,r:0},m=t._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var _=m[v][x];d[x]=Math.max(d[x],_)}var w={left:d.l,top:d.t,right:g.width-d.r,bottom:g.height-d.b},T=b.maxShift||u*(w[b.side]-p[b.side]),k=0;if(T<0)k=T;else{var A=b.offsetLeft||0,M=b.offsetTop||0;p.left-=A,p.right-=A,p.top-=M,p.bottom-=M,b.selection.each((function(){var t=l.bBox(this);o.bBoxIntersect(p,t,h)&&(k=Math.max(k,u*(t[b.side]-p[c])+h))})),k=Math.min(T,k),y._titleScoot=Math.abs(k)}if(k>0||T<0){var E={left:[-k,0],right:[k,0],top:[0,-k],bottom:[0,k]}[b.side];a.attr("transform",s(E[0],E[1]))}}}function ft(t,e){t.text(e).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(at.call(ct,ot),et&&(S?at.on(".opacity",null):(ft(at,x),E=!0),at.call(u.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?a.call("_guiRestyle",t,v,e,_):a.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),B)){if(B&&!S){var pt=at.node().getBBox(),dt=pt.y+pt.height+1.6*W;ot.attr("y",dt)}V?ot.on(".opacity",null):(ft(ot,N),q=!0),ot.call(u.makeEditable,{gd:t}).on("edit",(function(e){a.call("_guiRelayout",t,"title.subtitle.text",e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(u.positionText,ot.attr("x"),ot.attr("y"))}))}return at.classed("js-placeholder",E),ot&&ot.classed("js-placeholder",q),k},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),tr=f({"src/plots/cartesian/set_convert.js"(t,e){var r=v(),n=_().utcFormat,i=se(),a=i.numberFormat,o=T(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,f=k(),p=f.FP_SAFE,d=f.BADNUM,m=f.LOG_CLIP,g=f.ONEWEEK,y=f.ONEDAY,x=f.ONEHOUR,b=f.ONEMIN,w=f.ONESEC,A=ve(),M=ye(),S=M.HOUR_PATTERN,E=M.WEEKDAY_PATTERN;function C(t){return Math.pow(10,t)}function I(t){return null!=t}e.exports=function(t,e){e=e||{};var f=t._id||"x",v=f.charAt(0);function _(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return d}function T(e,r,n,a){if((a||{}).msUTC&&o(e))return+e;var s=c(e,n||t.calendar);if(s===d){if(!o(e))return d;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);s=c(new Date(u))+l/10}return s}function k(e,r,n){return l(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function P(e){if(I(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function z(e){if(t._categoriesMap)return t._categoriesMap[e]}function D(t){var e=z(t);return void 0!==e?e:o(t)?+t:void 0}function O(t){return o(t)?+t:z(t)}function R(t,e,n){return r.round(n+e*t,2)}function F(t,e,r){return(t-r)/e}var j=function(e){return o(e)?R(e,t._m,t._b):d},B=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var N="y"===v;j=function(e){if(!o(e))return d;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=N;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,s=0,l=0;lu)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=t._B[s]||0;return isFinite(h)?R(e,t._m2,h):0},B=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?_:u,t.l2c="log"===t.type?C:u,t.l2p=j,t.p2l=B,t.c2p="log"===t.type?function(t,e){return j(_(t,e))}:j,t.p2c="log"===t.type?function(t){return C(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=B,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return _(s(t),e)},t.r2d=t.r2c=function(t){return C(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=_,t.l2d=C,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return C(B(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=B,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=T,t.c2d=t.c2r=t.l2d=t.l2r=k,t.d2p=t.r2p=function(e,r,n){return t.l2p(T(e,0,n))},t.p2d=t.p2r=function(t,e,r){return k(B(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=D,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=z,t.l2r=t.c2r=u,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(r){var n,a,o=t._traceIndices,s=t._matchGroup;if(s&&0===t._categories.length)for(var l in s)if(l!==f){var c=e[A.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],p=[];for(n=0;nl[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var f=u+1;void 0!==r&&(f=Math.max(f,c)),a[s?0:1]=f}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,s=i.nestedProperty(t,e).get();if(a=(a="date"===t.type?i.dfltRange(t.calendar):"y"===v?M.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||M.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"!==t.type||t.autorange||(s[0]=i.cleanDate(s[0],d,t.calendar),s[1]=i.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!i.isDateTime(s[n],t.calendar)){t[e]=a;break}if(t.r2l(s[0])===t.r2l(s[1])){var u=i.constrain(t.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=t.l2r(u-1e3),s[1]=t.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){t[e]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-p?s[n]=-p:s[n]>p&&(s[n]=p),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=A.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),h="y"===v;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(f=!f),f&&t._rangebreaks.reverse();var p=f?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&c.push({min:t,max:n})}};for(n=0;n2*s}(h,e))return"date";var g="strict"!==n.autotypenumbers;return function(t,e){for(var r=t.length,n=u(r),a=0,o=0,c={},h=0;h2*a}(h,g)?"category":function(t,e){for(var r=t.length,n=0;n0&&((k=I-s(_)-l(b))>L?M/k>P&&(w=_,T=b,P=M/k):M/I>P&&(w={val:_.val,nopad:1},T={val:b.val,nopad:1},P=M/I));if(m===g){var z=m-1,D=m+1;if(E)if(0===m)a=[0,1];else{var O=(m>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=m/(1-Math.min(.5,O/I));a=m>0?[0,R]:[R,0]}else a=C?[Math.max(0,z),Math.max(1,D)]:[z,D]}else E?(w.val>=0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:0,nopad:1})):C&&(w.val-P*s(w)<0&&(w={val:0,nopad:1}),T.val<=0&&(T={val:1,nopad:1})),P=(T.val-w.val-f(e,_.val,b.val))/(I-s(w)-l(T)),a=[w.val-P*s(w),T.val+P*l(T)];return a=A(a,e),e.limitRange&&e.limitRange(),v&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return n(t)&&Math.abs(t)=e}function w(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))<(r=t.d2l(r))}function A(t,e){if(!e||!e.autorangeoptions)return t;var r=t[0],n=t[1],a=e.autorangeoptions.include;if(void 0!==a){var o=e.d2l(r),s=e.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&w(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&w(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}e.exports={applyAutorangeOptions:A,getAutoRange:h,makePadFn:p,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():h(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var n=e._input,a={};a[e._attr+".range"]=e.range,a[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=h(t,e)),s._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={}),t._m||t.setScale();var i,o,s,l,c,u,h,f,p,d=[],y=[],v=e.length,_=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,T=!1,k=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return T=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(i=0;i0&&(f=o),o>p&&o-a&&(f=o),o>p&&o=P;i--)L(i);return{min:d,max:y,opts:r}},concatExtremes:d}}}),nr=f({"src/plots/cartesian/axes.js"(t,e){var r=v(),n=T(),i=Te(),a=Vt(),o=se(),s=o.strTranslate,l=Me(),c=Qe(),u=q(),h=Ke(),f=Ce(),p=De(),d=k(),m=d.ONEMAXYEAR,g=d.ONEAVGYEAR,y=d.ONEMINYEAR,x=d.ONEMAXQUARTER,_=d.ONEAVGQUARTER,b=d.ONEMINQUARTER,w=d.ONEMAXMONTH,A=d.ONEAVGMONTH,M=d.ONEMINMONTH,S=d.ONEWEEK,E=d.ONEDAY,C=E/2,I=d.ONEHOUR,L=d.ONEMIN,P=d.ONESEC,z=d.ONEMILLI,D=d.ONEMICROSEC,O=d.MINUS_SIGN,R=d.BADNUM,F={K:"zeroline"},j={K:"gridline",L:"path"},B={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},H=Ae(),G=H.MID_SHIFT,Z=H.CAP_SHIFT,W=H.LINE_SPACING,Y=H.OPPOSITE_SIDE,X=e.exports={};X.setConvert=tr();var $=er(),J=ve(),K=J.idSort,Q=J.isLinked;X.id2name=J.id2name,X.name2id=J.name2id,X.cleanId=J.cleanId,X.list=J.list,X.listIds=J.listIds,X.getFromId=J.getFromId,X.getFromTrace=J.getFromTrace;var tt=rr();function et(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}X.getAutoRange=tt.getAutoRange,X.findExtremes=tt.findExtremes,X.coerceRef=function(t,e,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},o.coerce(t,e,u,c)},X.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},X.coercePosition=function(t,e,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=X.getFromId(e,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}t[i]=s(l)},X.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(e,r).cleanPos)(t)},X.redrawComponents=function(t,e){e=e||X.listIds(t);var r=t._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;un&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},X.saveRangeInitial=function(t,e){for(var r=X.list(t,"",!0),n=!1,i=0;i.3*f||u(i)||u(a))){var p=r.dtick/2;t+=t+ps){var l=Number(r.substr(1));a.exactYears>s&&l%12==0?t=X.tickIncrement(t,"M6","reverse")+1.5*E:a.exactMonths>s?t=X.tickIncrement(t,"M1","reverse")+15.5*E:t-=C;var c=X.tickIncrement(t,r);if(c<=n)return c}return t}(v,t,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},X.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var i,a=e.dtick&&n(e._tmin);if(a){var s=X.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,.99*s+.01*e._tmin]}else{var l=o.simpleMap(e.range,e.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(t.range=o.simpleMap(i,e.l2r),t._isMinor=!0,X.prepTicks(t,r),a){var c=n(e.dtick),u=n(t.dtick),h=c?e.dtick:+e.dtick.substring(1),f=u?t.dtick:+t.dtick.substring(1);c&&u?at(h,f)?h===2*S&&f===2*E&&(t.dtick=S):h===2*S&&f===3*E?t.dtick=S:h!==S||(e._input.minor||{}).nticks?ot(h/f,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=E:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":at(h,f)?h>=12&&2===f&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?at(h,f)||(t.dtick=ot(h/f,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},X.prepTicks=function(t,e){var r=o.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var i,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(i=t.tickfont?o.bigFont(t.tickfont.size||12):15,a=t._length/i):(i="y"===t._id.charAt(0)?40:80,a=o.constrain(t._length/i,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(n(t.dtick)||"M"!==t.dtick.charAt(0))}var i=r(),a=X.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=I,o&&!i&&t.dtickt.range[1],p=!t.ticklabelindex||o.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],d=o.simpleMap(t.range,t.r2l,void 0,void 0,e),v=d[1]=(V?0:1);q--){var H=!q;q?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var G=q?t:o.extendFlat({},t,t.minor);if(H?X.prepMinorTicks(G,t,e):X.prepTicks(G,e),"array"!==G.tickmode)if("sync"!==G.tickmode){var Z=et(d),W=Z[0],Y=Z[1],$=n(G.dtick),J="log"===l&&!($||"L"===G.dtick.charAt(0)),K=X.tickFirst(G,e);if(q){if(t._tmin=K,K=Y:nt<=Y;nt=X.tickIncrement(nt,it,v,c)){if(q&&Q++,G.rangebreaks&&!v){if(nt=k)break}if(B.length>O||nt===rt)break;rt=nt;var at={value:nt};q?(J&&nt!==(0|nt)&&(at.simpleLabel=!0),u>1&&Q%u&&(at.skipLabel=!0),B.push(at)):(at.minor=!0,N.push(at))}}else B=[],F=ct(t);else q?(B=[],F=ut(t,!H)):(N=[],j=ut(t,!H))}if(!N||N.length<2)p=!1;else{var ot=(N[1].value-N[0].value)*(f?-1:1);r=ot,i=t.tickformat,(/%f/.test(i)?r>=D:/%L/.test(i)?r>=z:/%[SX]/.test(i)?r>=P:/%M/.test(i)?r>=L:/%[HI]/.test(i)?r>=I:/%p/.test(i)?r>=C:/%[Aadejuwx]/.test(i)?r>=E:/%[UVW]/.test(i)?r>=S:/%[Bbm]/.test(i)?r>=M:/%[q]/.test(i)?r>=b:!/%[Yy]/.test(i)||r>=y)||(p=!1)}if(p){var st=B.concat(N);h&&B.length&&(st=st.slice(1)),(st=st.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){p.map((function(e){var r=t+e;r>=0&&r0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),h=r||u,f=0;h>=y?f=u>=y&&u<=m?u:g:r===_&&h>=b?f=u>=b&&u<=x?u:_:h>=M?f=u>=M&&u<=w?u:A:r===S&&h>=S?f=S:h>=E?f=E:r===C&&h>=C?f=C:r===I&&h>=I&&(f=I),f>=u&&(f=u,s=!0);var p=i+f;if(e.rangebreaks&&f>0){for(var d=0,v=0;v<84;v++){var T=(v+.5)/84;e.maskBreaks(i*(1-T)+T*p)!==R&&d++}(f*=d/84)||(t[n].drop=!0),s&&u>S&&(f=u)}(f>0||0===n)&&(t[n].periodX=i+f/2)}}(U,t,t._definedDelta),t.rangebreaks){var yt="y"===t._id.charAt(0),vt=1;"auto"===t.tickmode&&(vt=t.tickfont?t.tickfont.size:12);var xt=NaN;for(a=B.length-1;a>-1;a--)if(B[a].drop)B.splice(a,1);else{B[a].value=Bt(B[a].value,t);var _t=t.c2p(B[a].value);(yt?xt>_t-vt:xt<_t+vt)?B.splice(v?a+1:a,1):xt=_t}}jt(t)&&360===Math.abs(d[1]-d[0])&&B.pop(),t._tmax=(B[B.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var bt,wt=function(e){e.text="",t._prevDateHead=s};function Tt(t,e){var r=X.tickText(t,e.value,!1,e.simpleLabel),n=e.periodX;return void 0!==n&&(r.periodX=n,(n>k||nk&&(r.periodX=k),n10||"01-01"!==i.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=L&&a<=16||e>=I)t._tickround="M";else if(e>=P&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(n(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);n(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(wt(t.exponentformat)&&!Tt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function _t(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(t,e,r){var i;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=o.dateTick0(t.calendar,0);var s=2*e;if(s>g)e/=g,i=a(10),t.dtick="M"+12*vt(e,i,ht);else if(s>A)e/=A,t.dtick="M"+vt(e,1,ft);else if(s>E){if(t.dtick=vt(e,E,t._hasDayOfWeekBreaks?[1,2,7,14]:dt),!r){var l=X.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=o.dateTick0(t.calendar,2):t.tick0=o.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else s>I?t.dtick=vt(e,I,ft):s>L?t.dtick=vt(e,L,pt):s>P?t.dtick=vt(e,P,pt):(i=a(10),t.dtick=vt(e,i,ht))}else if("log"===t.type){t.tick0=0;var u=o.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),t.dtick="L"+vt(e,i,ht)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):jt(t)?(t.tick0=0,i=1,t.dtick=vt(e,i,yt)):(t.tick0=0,i=a(10),t.dtick=vt(e,i,ht));if(0===t.dtick&&(t.dtick=1),!n(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},X.tickIncrement=function(t,e,i,a){var s=i?-1:1;if(n(e))return o.increment(t,s*e);var l=e.charAt(0),c=s*Number(e.substr(1));if("M"===l)return o.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?gt:mt,h=t+.01*s,f=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)},X.tickFirst=function(t,e){var i=t.r2l||Number,a=o.simpleMap(t.range,i,void 0,void 0,e),s=a[1]=0&&r<=t._length?e:null};if(l&&o.isArrayOrTypedArray(t.ticktext)){var p=o.simpleMap(t.range,t.r2l),d=(Math.abs(p[1]-p[0])-(t._lBreaks||0))/1e4;for(a=0;a ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,s,r,c):"log"===u?function(t,e,r,i,a){var s=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)e.text=kt(Math.pow(10,l),t,a,i);else if(n(s)||"D"===u&&o.mod(l+.01,1)<.1){var h=Math.round(l),f=Math.abs(h),p=t.exponentformat;"power"===p||wt(p)&&Tt(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":O)+f+"",e.fontSize*=1.25):("e"===p||"E"===p)&&f>2?e.text="1"+p+(h>0?"+":O)+f:(e.text=kt(Math.pow(10,l),t,"","fakehover"),"D1"===s&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);e.text=String(Math.round(Math.pow(10,o.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,s,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,s):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,s,r):jt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=kt(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var s=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}function r(t,n){return e(n,0)?t:r(n,t%n)}function n(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}var i=n(t),a=t*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(s[1]>=100)e.text=kt(o.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===s[1]?1===s[0]?e.text="π":e.text=s[0]+"π":e.text=["",s[0],"","⁄","",s[1],"","π"].join(""),l&&(e.text=O+e.text)}}}}(t,s,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=kt(e.x,t,i,n)}(t,s,0,c,g),i||(t.tickprefix&&!m(t.showtickprefix)&&(s.text=t.tickprefix+s.text),t.ticksuffix&&!m(t.showticksuffix)&&(s.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(s.text)){var y=t.labelalias[s.text];"string"==typeof y&&(s.text=y)}return("boundaries"===t.tickson||t.showdividers)&&(s.xbnd=[f(s.x-.5),f(s.x+t.dtick-.5)]),s},X.hoverLabelText=function(t,e,r){r&&(t=o.extendFlat({},t,{hoverformat:r}));var n=o.isArrayOrTypedArray(e)?e[0]:e,i=o.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(t,n,r)+" - "+X.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,s=X.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":O+s:s};var bt=["f","p","n","μ","m","","k","M","G","T"];function wt(t){return"SI"===t||"B"===t}function Tt(t){return t>14||t<-15}function kt(t,e,r,i){var a=t<0,s=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=X.getTickFormat(e),h=e.separatethousands;if(i){var f={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:n(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};xt(f),s=(Number(f._tickround)||0)+4,c=f._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,O);var p,d=Math.pow(10,-s)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":wt(l)&&(t+=bt[c/3+5])),a?O+t:t}function At(t,e){if(t){var r=Object.keys(V).reduce((function(t,r){return-1!==e.indexOf(r)&&V[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function Mt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(e){return function(){if(e){var n=X.getFromId(t,e);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(t,n,r);return n._shiftPusher&&qt(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},X.drawOne=function(t,e,r){var n,s,f,p=(r=r||{}).axShifts||{},d=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[e._mainSubplot];if(x){if(e._shiftPusher=e.autoshift||-1!==d.indexOf(e._id)||-1!==d.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var _=e.linewidth/2||0;"inside"===e.ticks&&(_+=e.ticklen),qt(e,_,p,!0),qt(e,e.shift||0,p,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,p));var b=x[y+"axislayer"],w=e._mainLinePosition,T=w+=e._shift,k=e._mainMirrorPosition,A=e._vals=X.calcTicks(e),M=[e.mirror,T,k].join("_");for(n=0;n0?r.bottom-u:0,h))));var f=0,p=0;if(e._shiftPusher&&(f=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),e.title.text!==m._dfltTitle[y]&&(p=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(p+=Ct(e))),e._fullDepth=Math.max(f,p)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1],g="number"==typeof e._shift?e._shift:0;if("x"===y){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),d.reverse()),r.width>0){var x=r.right-(e._offset+e._length);x>0&&(n.xr=1,n.r=x);var _=e._offset-r.left;_>0&&(n.xl=0,n.l=_)}}else if("l"===l?(e._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=e._depth+g,d.reverse()),r.height>0){var b=r.bottom-(e._offset+e._length);b>0&&(n.yb=0,n.b=b);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==m._dfltTitle[y]&&(n[l]+=Ct(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(o[c]+=h),!0===e.mirror||"ticks"===e.mirror?o[v]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(o[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}ht&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(At(n,e.automargin),At(o,e.automargin)),i.autoMargin(t,Pt(e),n),i.autoMargin(t,zt(e),o),i.autoMargin(t,Dt(e),s)})),o.syncOrAsync(ct)}}function ft(t){var r=g+(t||"tick");return S[r]||(S[r]=function(t,e,r){var n,i,a,o;if(t._selections[e].size())n=1/0,i=-1/0,a=1/0,o=-1/0,t._selections[e].each((function(){var t=Lt(this),e=h.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),a=Math.min(a,e.left),o=Math.max(o,e.right)}));else{var s=X.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(e,r,T)),S[r]}},X.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},X.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return s(t._offset+t.l2p(e.x),0)}:function(e){return s(0,t._offset+t.l2p(e.x))}},X.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,f=t.tickfont?t.tickfont.size:12;return(o||n)&&(u+=f*Z,h+=(t.linewidth||0)/2),(i||a)&&(u+=(t.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=f*(1-Z)),(i||n)&&(u=-u),"bottom"!==c&&"right"!==c||(h=-h),[l?u:0,s?h:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],a=e[1],o=t.range[0]>t.range[1],l=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=t.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===t._id.charAt(0)?function(e){return s(i+t._offset+t.l2p(St(e))+r,a+n)}:function(e){return s(a+n,i+t._offset+t.l2p(St(e))+r)}},X.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},X.makeLabelFns=function(t,e,r){var i=t.ticklabelposition||"",a=function(t){return-1!==i.indexOf(t)},s=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||s||c,h=a("inside"),f="inside"===i&&"inside"===t.ticks||!h&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,m=f?t.ticklen:0;if(h?m*=-1:u&&(m=0),f&&(p+=m,r)){var g=o.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(f||t.showline)&&(p+=.2*t.tickfont.size);var y,v,x,_,b,w={labelStandoff:p+=(t.linewidth||1)/2*(h?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if("x"===A)_=(b=!h&&"bottom"===k||h&&"top"===k)?1:-1,h&&(_*=-1),y=d*_,v=e+p*_,x=b?1:-.2,90===Math.abs(M)&&(h?x+=G:x=-90===M&&"bottom"===k?Z:90===M&&"top"===k?G:.5,T=G/2*(M/90)),w.xFn=function(t){return t.dx+y+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return n(e)&&0!==e&&180!==e?e*_<0!==h?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==h?-n:0};else if("y"===A){if(_=(b=!h&&"left"===k||h&&"right"===k)?1:-1,h&&(_*=-1),y=p,v=d*_,x=0,h||90!==Math.abs(M)||(x=-90===M&&"left"===k||90===M&&"right"===k?Z:.5),h){var S=n(M)?+M:0;if(0!==S){var E=o.deg2rad(S);T=Math.abs(Math.sin(E))*Z*_,x=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*x)*_+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*G},w.anchorFn=function(t,e){return n(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},X.drawTicks=function(t,e,n){n=n||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?n.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?n.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Et);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ut(e,[N]),o.attr("transform",n.transFn)},X.drawGrid=function(t,e,n){if(n=n||{},"sync"!==e.tickmode){var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?n.vals.filter((function(t){return t.minor})):[],s=e.showgrid?n.vals.filter((function(t){return!t.minor})):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,f=0;f=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Et);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(t){return u.stroke(r.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof n.path&&x.attr("d",n.path)}}Ut(e,[j,B])}},X.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=X.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return K(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,e.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Ut(e,[F])},X.drawLabels=function(t,e,i){i=i||{};var a=t._fullLayout,c=e._id,u=i.cls||c+"tick",f=i.vals.filter((function(t){return t.text})),p=i.labelFns,d=i.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[u],g=i.layer.selectAll("g."+u).data(e.showticklabels?f:[],Et),y=[];function v(t,a){t.each((function(t){var o=r.select(this),c=o.select(".text-math-group"),u=p.anchorFn(t,a),f=i.transFn.call(o.node(),t)+(n(a)&&0!=+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),d=l.lineCount(o),m=W*t.fontSize,g=p.heightFn(t,n(a)?+a:0,(d-1)*m);if(g&&(f+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",f+s(v,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(e){var n=r.select(this),i=t._promises.length;n.call(l.positionText,p.xFn(e),p.yFn(e)).call(h.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(l.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){v(n,d)}))):v(n,d)})),Ut(e,[U]),g.exit().remove(),i.repositionOnUpdate&&g.each((function(t){r.select(this).select("text").call(l.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var n=e.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===e._id.charAt(0),l=0,c=s?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),p=Math.max(l,c),d=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>p||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},v(g,m+1?m:d);var x=null;e._selections&&(e._selections[u]=g);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,_.push((function(){v(g,m)}))):_.push((function(){if(v(g,d),f.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=e.autotickangles[0];var t,r=0,n=[],a=1;g.each((function(t){r=Math.max(r,t.fontSize);var i=e.l2p(t.x),o=Lt(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})}));var s=("boundaries"===e.tickson||e.showdividers)&&!i.secondary,c=f.length,u=Math.abs((f[c-1].x-f[0].x)*e._m)/(c-1),p=s?u/2:u,m=s?e.ticklen:1.25*r*a,y=p/Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),_=e.autotickangles.map((function(t){return t*Math.PI/180})),b=_.find((function(t){return Math.abs(Math.cos(t))<=y}));void 0===b&&(b=_.reduce((function(t,e){return Math.abs(Math.cos(t))O*D&&(L=D,E[S]=C[S]=P[S])}var R=Math.abs(L-I);R-k>0?k*=1+k/(R-=k):k=0,"y"!==e._id.charAt(0)&&(k=-k),E[M]=w.p2r(w.r2p(C[M])+A*k),"min"===w.autorange||"max reversed"===w.autorange?(E[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(E[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=E}var V=o.syncOrAsync(_);return V&&V.then&&t._promises.push(V),V},X.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(t,e,r){var n=o.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===R)&&(It(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var a=t._fullLayout,o=e._id.charAt(0),s=X.counterLetter(e._id),l=e._offset+(Math.abs(n[0])1)for(n=1;n4/3-s?o:s}}}),cr=f({"src/components/dragelement/cursor.js"(t,e){var r=se(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,i,a){return t="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*e),0,2),n[e][t]}}}),ur=f({"src/components/dragelement/unhover.js"(t,e){var r=fe(),n=Jt(),i=Ct().getGraphDiv,a=F(),o=e.exports={};o.wrapped=function(t,e,r){(t=i(t))._fullLayout&&n.clear(t._fullLayout._uid+a.HOVERID),o.raw(t,e,r)},o.raw=function(t,e){var n=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===r.triggerHandler(t,"plotly_beforehover",e)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}}}),hr=f({"src/components/dragelement/index.js"(t,e){var r=or(),n=ue(),i=sr(),a=se().removeElement,o=ye(),s=e.exports={};s.align=lr(),s.getCursor=cr();var l=ur();function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function u(t){return r(t.changedTouches?t.changedTouches[0]:t,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(t){var e,r,l,h,f,p,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=b,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=b,x.addEventListener("touchstart",b,{passive:!1})):x.ontouchstart=b;var _=t.clampFn||function(t,e,r){return Math.abs(t)v&&(y=Math.max(y-1,1)),g._dragged?t.doneFn&&t.doneFn():(p.target===d?r=p:(r={target:d,srcElement:d,toElement:d},Object.keys(p).concat(Object.keys(p.__proto__)).forEach((t=>{var e=p[t];r[t]||"function"==typeof e||(r[t]=e)}))),t.clickFn&&t.clickFn(y,r),m||d.dispatchEvent(new MouseEvent("click",e))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=c}}),fr=f({"src/lib/setcursor.js"(t,e){e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}}}),pr=f({"src/lib/override_cursor.js"(t,e){var r=fr(),n="data-savedcursor";e.exports=function(t,e){var i=t.attr(n);if(e){if(!i){for(var a=(t.attr("class")||"").split(" "),o=0;o("legend"===t?1:0));if(!1===M&&(c[t]=void 0),(!1!==M||h.uirevision)&&(p("uirevision",c.uirevision),!1!==M)){p("borderwidth");var S,E,C,I="h"===p("orientation"),L="paper"===p("yref"),P="paper"===p("xref"),z="left";if(I?(S=0,r.getComponentMethod("rangeslider","isVisible")(e.xaxis)?L?(E=1.1,C="bottom"):(E=1,C="top"):L?(E=-.1,C="top"):(E=0,C="bottom")):(E=1,C="auto",P?S=1.02:(S=1,z="right")),n.coerce(h,f,{x:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:S}},"x"),n.coerce(h,f,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:E}},"y"),p("traceorder",b),l.isGrouped(c[t])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",z),p("yanchor",C),p("valign"),n.noneOrAll(h,f,["x","y"]),p("title.text")){p("title.side",I?"left":"top");var D=n.extendFlat({},d,{size:n.bigFont(d.size)});n.coerceFont(p,"title.font",D)}}}}e.exports=function(t,e,r){var i,a=r.slice(),o=e.shapes;if(o)for(i=0;iS&&(M=S)}k[a][0]._groupMinRank=M,k[a][0]._preGroupSort=a}var E=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(k.forEach((function(t,e){t[0]._preGroupSort=e})),k.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),a=0;ar?r:t}e.exports=function(t,e,g){var y=e._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,_=(x+2*f.itemGap)/2,b=a(_,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function T(t,i,a){var c=t[0].trace,u=c.marker||{},h=u.line||{},f=u.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=a?c.visible&&c.type===a:n.traceIs(c,"bar"),d=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(p?[t]:[]);d.enter().append("path").classed("legend"+a,!0).attr("d",f).attr("transform",b),d.exit().remove(),d.each((function(t){var n=r.select(this),i=t[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var f=i.mcc;if(!g._inHover&&"mc"in i){var p=l(u),d=p.mid;void 0===d&&(d=(p.max+p.min)/2),f=o.tryColorscale(u,"")(d)}var y=f||i.mc||u.color,v=u.pattern,x=v&&o.getPatternAttr(v.shape,0,"");if(x){var _=o.getPatternAttr(v.bgcolor,0,null),b=o.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=m(v.size,8,10),A=m(v.solidity,.5,1),M="legend-"+c.uid;n.call(o.pattern,"legend",e,M,x,k,A,f,v.fillmode,_,b,T)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function k(t,a,o){var s=t[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),f=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[t]:[]);if(f.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),f.exit().remove(),f.size()){var p=l.marker||{},d=w(h(p.line.width,s.pts),p.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:d}}},m),y=i.minExtend(s,{trace:g},m);u(f,y,g,e)}}t.each((function(t){var e=r.select(this),n=i.ensureSingle(e,"g","layers");n.style("opacity",t[0].trace.opacity);var o=g.indentation,s=g.valign,l=t[0].lineHeight,c=t[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=n.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var n,a=t[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,c){var u,h=r.select(this),f=l(a),d=f.colorscale,m=f.reversescale;if(d){if(!n){var g=d.length;u=0===c?d[m?g-1:0][1]:1===c?d[m?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",t[0]),u?h.call(s.fill,u):h.call((function(t){if(t.size()){var r="legendfill-"+a.uid;o.gradient(t,e,r,p(m,"radial"===n),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,n="waterfall"===e.type;if(t[0]._distinct&&n){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&n&&(a=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var n=r.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var a=t[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),l.exit().remove(),l.each((function(){var t=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);t.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(t,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var n,a,s=d(t),u=s.showFill,h=s.showLine,f=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=t[0],_=v.trace,b=l(_),T=b.colorscale,k=b.reversescale,A=c.hasMarkers(_)||!g?"M5,0":y?"M5,-2":"M5,-3",M=r.select(this),S=M.select(".legendfill").selectAll("path").data(u||m?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(u)o.fillGroupStyle(t,e,!0);else{var r="legendfill-"+_.uid;o.gradient(t,e,r,p(k),T,"fill")}})),h||f){var E=w(void 0,_.line,10,5);a=i.minExtend(_,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=M.select(".legendlines").selectAll("path").data(h||f?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",A+(f?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+_.uid;o.lineGroupStyle(t),o.gradient(t,e,r,p(k),T,"stroke")}})})).each((function(t){var n,a,s=d(t),l=s.anyFill,u=s.anyLine,h=s.showLine,f=s.showMarker,p=t[0],m=p.trace,g=!f&&!u&&!l&&c.hasText(m);function y(t,e,r,n){var a=i.nestedProperty(m,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(f||g||h){var _={},w={};if(f){_.mc=y("marker.color",x),_.mx=y("marker.symbol",x),_.mo=y("marker.opacity",i.mean,[.2,1]),_.mlc=y("marker.line.color",x),_.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",i.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(_.tx="Aa",_.tp=y("textposition",x),_.ts=10,_.tc=y("textfont.color",x),_.tf=y("textfont.family",x),_.tw=y("textfont.weight",x),_.ty=y("textfont.style",x),_.tv=y("textfont.variant",x),_.tC=y("textfont.textcase",x),_.tE=y("textfont.lineposition",x),_.tS=y("textfont.shadow",x)),n=[i.minExtend(p,_)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var k=r.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(f?n:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),A.exit().remove(),A.call(o.pointStyle,a,e),f&&(n[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?n:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),M.exit().remove(),M.selectAll("text").call(o.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(t){var e=t[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(t,n){var i=r.select(this),a=e[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),kr=f({"src/components/legend/draw.js"(t,e){var r=v(),n=se(),i=Te(),a=Vt(),o=fe(),s=hr(),l=Ke(),c=q(),u=Me(),h=yr(),f=vr(),p=Ae(),d=p.LINE_SPACING,m=p.FROM_TL,g=p.FROM_BR,y=xr(),x=Tr(),_=mr(),b=/^legend[0-9]*$/;function w(t,e){var o,h,p=e||{},v=t._fullLayout,b=L(p),w=p._inHover;if(w?(h=p.layer,o="hover"):(h=v._infolayer,o=b),h){var M;if(o+=v._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!p.entries)return;M=y(p.entries,p)}else{for(var P=(t.calcdata||[]).slice(),z=v.shapes,D=0;D1)}var F=v.hiddenlabels||[];if(!(w||v.showlegend&&M.length))return h.selectAll("."+b).remove(),v._topdefs.select("#"+o).remove(),i.autoMargin(t,b);var j=n.ensureSingle(h,"g",b,(function(t){w||t.attr("pointer-events","all")})),B=n.ensureSingleById(v._topdefs,"clipPath",o,(function(t){t.append("rect")})),N=n.ensureSingle(j,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));N.call(c.stroke,p.bordercolor).call(c.fill,p.bgcolor).style("stroke-width",p.borderwidth+"px");var U,V=n.ensureSingle(j,"g","scrollbox"),q=p.title;p._titleWidth=0,p._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",b+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),E(U,V,t,p,1)):V.selectAll("."+b+"titletext").remove();var H=n.ensureSingle(j,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),G=V.selectAll("g.groups").data(M);G.enter().append("g").attr("class","groups"),G.exit().remove();var Z=G.selectAll("g.traces").data(n.identity);Z.enter().append("g").attr("class","traces"),Z.exit().remove(),Z.style("opacity",(function(t){var e=t[0].trace;return a.traceIs(e,"pie-like")?-1!==F.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){r.select(this).call(A,t,p)})).call(x,t,p).each((function(){w||r.select(this).call(S,t,b)})),n.syncOrAsync([i.previousPromises,function(){return function(t,e,n,i){var a=t._fullLayout,o=L(i);i||(i=a[o]);var s=a._size,c=_.isVertical(i),u=_.isGrouped(i),h="fraction"===i.entrywidthmode,p=i.borderwidth,d=2*p,m=f.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(p+m),v=I(i),x=i.y<0||0===i.y&&"top"===v,b=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,k={};i._maxHeight=Math.max(x||b?a.height/2:s.h,30);var A=0;i._width=0,i._height=0;var M=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(c)n.each((function(t){var e=t[0].height;l.setTranslate(this,p+M[0],p+M[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)})),A=g+i._width,i._width+=m+g+d,i._height+=y,u&&(e.each((function(t,e){l.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var S=C(i),E=i.x<0||0===i.x&&"right"===S,P=i.x>1||1===i.x&&"left"===S,z=b||x,D=a.width/2;i._maxWidth=Math.max(E?z&&"left"===S?s.l+s.w:D:P?z&&"right"===S?s.r+s.w:D:s.w,2*g);var O=0,R=0;n.each((function(t){var e=T(t,i,g);O=Math.max(O,e),R+=e})),A=null;var F=0;if(u){var j=0,B=0,N=0;e.each((function(){var t=0,e=0;r.select(this).selectAll("g.traces").each((function(r){var n=T(r,i,g),a=r[0].height;l.setTranslate(this,M[0],M[1]+p+m+a/2+e),e+=a,t=Math.max(t,n),k[r[0].trace.legendgroup]=t}));var n=t+m;B>0&&n+p+B>i._maxWidth?(F=Math.max(F,B),B=0,N+=j+w,j=e):j=Math.max(j,e),l.setTranslate(this,B,N),B+=n})),i._width=Math.max(F,B)+p,i._height=N+j+y}else{var U=n.size(),V=R+d+(U-1)*m=i._maxWidth&&(F=Math.max(F,Z),H=0,G+=q,i._height+=q,q=0),l.setTranslate(this,M[0]+p+H,M[1]+p+G+e/2+m),Z=H+r+m,H+=n,q=Math.max(q,e)})),V?(i._width=H+d,i._height=q+y):(i._width=Math.max(F,Z)+d,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+M[0],i._titleWidth+2*(p+f.titlePad))),i._height=Math.ceil(Math.max(i._height+M[1],i._titleHeight+2*(p+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var W=t._context.edits,Y=W.legendText||W.legendPosition;n.each((function(t){var e=r.select(this).select("."+o+"toggle"),n=t[0].height,a=t[0].trace.legendgroup,s=T(t,i,g);u&&""!==a&&(s=k[a]);var f=Y?g:A||s;c||h||(f+=m/2),l.setRect(e,0,-n/2,f,n)}))}(t,G,Z,p)},function(){var e,c,y,x,_=v._size,T=p.borderwidth,A="paper"===p.xref,M="paper"===p.yref;if(q.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*d,i=0,a=t.node(),o=l.bBox(a).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*f.titlePad-o):"top right"===e.title.side&&(i=e._width-2*r-2*f.titlePad-o),u.positionText(t,r+f.titlePad+i,r+n)}}(U,p,T),!w){var S,E;S=A?_.l+_.w*p.x-m[C(p)]*p._width:v.width*p.x-m[C(p)]*p._width,E=M?_.t+_.h*(1-p.y)-m[I(p)]*p._effHeight:v.height*(1-p.y)-m[I(p)]*p._effHeight;var L=function(t,e,r,n){var a=t._fullLayout,o=a[e],s=C(o),l=I(o),c="paper"===o.xref,u="paper"===o.yref;t._fullLayout._reservedMargin[e]={};var h=o.y<.5?"b":"t",f=o.x<.5?"l":"r",p={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(t,e,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});c?t._fullLayout._reservedMargin[e][h]=p[h]:u||"v"===o.orientation?t._fullLayout._reservedMargin[e][f]=p[f]:t._fullLayout._reservedMargin[e][h]=p[h]}(t,b,S,E);if(L)return;if(v.margin.autoexpand){var P=S,z=E;S=A?n.constrain(S,0,v.width-p._width):P,E=M?n.constrain(E,0,v.height-p._effHeight):z,S!==P&&n.log("Constrain "+b+".x to make legend fit inside graph"),E!==z&&n.log("Constrain "+b+".y to make legend fit inside graph")}l.setTranslate(j,S,E)}if(H.on(".drag",null),j.on("wheel",null),w||p._height<=p._maxHeight||t._context.staticPlot){var D=p._effHeight;w&&(D=p._height),N.attr({width:p._width-T,height:D-T,x:T/2,y:T/2}),l.setTranslate(V,0,0),B.select("rect").attr({width:p._width-2*T,height:D-2*T,x:T,y:T}),l.setClipUrl(V,o,t),l.setRect(H,0,0,0,0),delete p._scrollY}else{var O,R,F,G=Math.max(f.scrollBarMinHeight,p._effHeight*p._effHeight/p._height),Z=p._effHeight-G-2*f.scrollBarMargin,W=p._height-p._effHeight,Y=Z/W,X=Math.min(p._scrollY||0,W);N.attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-T,x:T/2,y:T/2}),B.select("rect").attr({width:p._width-2*T+f.scrollBarWidth+f.scrollBarMargin,height:p._effHeight-2*T,x:T,y:T+X}),l.setClipUrl(V,o,t),K(X,G,Y),j.on("wheel",(function(){K(X=n.constrain(p._scrollY+r.event.deltaY/Z*W,0,W),G,Y),0!==X&&X!==W&&r.event.preventDefault()}));var $=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=X})).on("drag",(function(){var t,e=r.event.sourceEvent;2===e.buttons||e.ctrlKey||(R="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,t=(R-O)/Y+F,K(X=n.constrain(t,0,W),G,Y))}));H.call($);var J=r.behavior.drag().on("dragstart",(function(){var t=r.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,F=X)})).on("drag",(function(){var t,e=r.event.sourceEvent;"touchmove"===e.type&&(R=e.changedTouches[0].clientY,t=(O-R)/Y+F,K(X=n.constrain(t,0,W),G,Y))}));V.call(J)}function K(e,r,n){p._scrollY=t._fullLayout[b]._scrollY=e,l.setTranslate(V,0,-e),l.setRect(H,p._width,f.scrollBarMargin+e*n,f.scrollBarWidth,r),B.select("rect").attr("y",T+e)}t._context.edits.legendPosition&&(j.classed("cursor-move",!0),s.init({element:j.node(),gd:t,prepFn:function(t){if(t.target!==H.node()){var e=l.getTranslate(j);y=e.x,x=e.y}},moveFn:function(t,r){if(void 0!==y&&void 0!==x){var n=y+t,i=x+r;l.setTranslate(j,n,i),e=s.align(n,p._width,_.l,_.l+_.w,p.xanchor),c=s.align(i+p._height,-p._height,_.t+_.h,_.t,p.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==c){var r={};r[b+".x"]=e,r[b+".y"]=c,a.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=h.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&k(t,j,n,e,r)}}))}],t)}}function T(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function k(t,e,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var c=o.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===c)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==c&&h(r,t,n))}function A(t,e,r){var i,o,s=L(r),c=t.data()[0][0],h=c.trace,p=a.traceIs(h,"pie-like"),d=!r._inHover&&e._context.edits.legendText&&!p,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=p?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(d?M(i,m):i);var y=r.indentation+r.itemwidth+2*f.itemGap;u.positionText(g,y,0),d?g.call(u.makeEditable,{gd:e,text:i}).call(E,t,e,r).on("edit",(function(n){this.text(M(n,m)).call(E,t,e,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",e,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",e,o,h.index)})):E(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,i){var a,o=e._context.doubleClickDelay,s=1,l=n.ensureSingle(t,"rect",i+"toggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-e._legendMouseDownTimeo&&(s=Math.max(s-1,1)),k(e,n,t,s,r.event)}})))}function E(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),u.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=t.select("g[class*=math-group]"),o=a.node(),s=L(r);r||(r=e._fullLayout[s]);var c,h,p=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*d;if(o){var g=l.bBox(o);c=g.height,h=g.width,1===n?l.setTranslate(a,p,p+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=t.select(y),x=u.lineCount(v),_=v.node();if(c=m*x,h=_?l.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),u.positionText(v,p+f.titlePad,p+m);else{var b=2*f.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(b=f.itemGap,h-=r.indentation+r.itemwidth),u.positionText(v,b,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,16)+3,i.width=h)}else t.remove()}(e,r,n,i)}))}function C(t){return n.isRightAnchor(t)?"right":n.isCenterAnchor(t)?"center":"left"}function I(t){return n.isBottomAnchor(t)?"bottom":n.isMiddleAnchor(t)?"middle":"top"}function L(t){return t._id||"legend"}e.exports=function(t,e){if(e)w(t,e);else{var n=t._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var t=r.select(this),e=t.attr("class").split(" ")[0];e.match(b)&&-1===i.indexOf(e)&&t.remove()}));for(var a=0;a$[0]._length||bt<0||bt>J[0]._length)return p.unhoverRaw(t,n)}else _t="xpx"in n?n.xpx:$[0]._length/2,bt="ypx"in n?n.ypx:J[0]._length/2;if(n.pointerX=_t+$[0]._offset,n.pointerY=bt+J[0]._offset,nt="xval"in n?y.flat(_,n.xval):y.p2c($,_t),it="yval"in n?y.flat(_,n.yval):y.p2c(J,bt),!r(nt[0])||!r(it[0]))return i.warn("Fx.hover failed",n,t),p.unhoverRaw(t,n)}var At=1/0;function Mt(e,a){for(ot=0;otmt&&(gt.splice(0,mt),At=gt[0].distance),M&&0!==rt&&0===gt.length){dt.distance=rt,dt.index=!1;var u=lt._module.hoverPoints(dt,ft,pt,"closest",{hoverLayer:b._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,p=u.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var d=p[0];r(d.x0)&&r(d.y0)&&(h=Et(d),(!vt.vLinePoint||vt.vLinePoint.spikeDistance>h.spikeDistance)&&(vt.vLinePoint=h))}var m=u.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Et(g),(!vt.hLinePoint||vt.hLinePoint.spikeDistance>h.spikeDistance)&&(vt.hLinePoint=h))}}}}}function St(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Bt-1;Nt--)Ht(gt[Nt]);gt=Ut,Pt()}var Gt=t._hoverdata,Zt=[],Wt=W(t),Yt=Y(t);for(at=0;at1||gt.length>1)||"closest"===S&&xt&>.length>1,se=f.combine(b.plot_bgcolor||f.background,b.paper_bgcolor),le=R(gt,{gd:t,hovermode:S,rotateLabels:oe,bgColor:se,container:b._hoverlayer,outerContainer:b._paper.node(),commonLabelOpts:b.hoverlabel,hoverdistance:b.hoverdistance}),ce=le.hoverLabels;if(y.isUnifiedHover(S)||(function(t,e,r,n){var i,a,o,s,l,c,u,h=e?"xa":"ya",f=e?"ya":"xa",p=0,d=1,m=t.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,_=n.minY,b=n.maxY,w=function(t){return t*r._invScaleX},T=function(t){return t*r._invScaleY};function k(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}for(t.each((function(t){var n=t[h],i=t[f],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(d=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,p=B(t,e),m=t.anchor,k="end"===m?-1:1;if("middle"===m)u=(c=t.crossPos+(a?T(p.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(a?T(t.by):w(t.bx));else if(a)u=(c=t.crossPos+T(E+p.y)-T(t.by/2-E))+T(t.by);else{var M=w(k*E+p.x),S=M+w(k*t.bx);c=t.crossPos+Math.min(M,S),u=t.crossPos+Math.max(M,S)}a?void 0!==_&&void 0!==b&&Math.min(u,b)-Math.max(c,_)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||d*(e[0].traceIndex-t[0].traceIndex)}));!i&&p<=m;){for(p++,i=!0,s=0;s.01){for(l=S.length-1;l>=0;l--)S[l].dp+=a;for(M.push.apply(M,S),g.splice(s+1,1),u=0,l=M.length-1;l>=0;l--)u+=M[l].dp;for(o=u/M.length,l=M.length-1;l>=0;l--)M[l].dp-=o;i=!1}else s++}g.forEach(k)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var P=L[l],z=P.datum;z.offset=P.dp,z.del=P.del}}}(ce,oe,b,le.commonLabelBoundingBox),N(ce,oe,b._invScaleX,b._invScaleY)),c&&c.tagName){var ue=g.getComponentMethod("annotations","hasClickToShow")(t,Zt);u(e.select(c),ue?"pointer":"")}c&&!s&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Gt)&&(Gt&&t.emit("plotly_unhover",{event:n,points:Gt}),t.emit("plotly_hover",{event:n,points:t._hoverdata,xaxes:$,yaxes:J,xvals:nt,yvals:it}))}(t,n,o,s,c)}))},t.loneHover=function(t,r){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var i=r.gd,a=W(i),o=Y(i),s=!1,l=R(t.map((function(t){var e=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(e,n),h=Math.max(e,n),p=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,p+=x,d+=x}c.bbox={x0:u+o,x1:h+o,y0:p+a,y1:d+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||f.background,container:e.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,e){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,p=r.bgColor,d=r.container,m=r.outerContainer,v=r.commonLabelOpts||{};if(0===t.length)return[[]];var T=r.fontFamily||x.HOVERFONT,k=r.fontSize||x.HOVERFONTSIZE,A=r.fontWeight||a.font.weight,M=r.fontStyle||a.font.style,S=r.fontVariant||a.font.variant,I=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,P=r.fontShadow||a.font.shadow,D=t[0],O=D.xa,R=D.ya,F=l.charAt(0),B=F+"Label",N=D[B];if(void 0===N&&"multicategory"===O.type)for(var U=0;Ua.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+b+E+"H"+w+"v"+b+(2*C+_.height)+"H"+-w+"V"+b+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===O.side?(Q.minY=x-(2*C+_.height),Q.maxY=x-C):(Q.minY=x+C,Q.maxY=x+(2*C+_.height))}else{var F,j,B;"right"===R.side?(F="start",j=1,B="",y=O._offset+O._length):(F="end",j=-1,B="-",y=O._offset),x=R._offset+(D.y0+D.y1)/2,s.attr("text-anchor",F),r.attr("d","M0,0L"+B+E+","+E+"V"+(C+_.height/2)+"h"+B+(2*C+_.width)+"V-"+(C+_.height/2)+"H"+B+E+"V-"+E+"Z"),Q.minY=x-(C+_.height/2),Q.maxY=x+(C+_.height/2),"right"===R.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+_.width)):(Q.minX=y-E-(2*C+_.width),Q.maxX=y-E);var U,V=_.height/2,H=q-_.top-V,G="clip"+a._uid+"commonlabel"+R._id;if(y<_.width+2*C+E){U="M-"+(E+C)+"-"+V+"h-"+(_.width-C)+"V"+V+"h"+(_.width-C)+"Z";var Z=_.width-y+C;c.positionText(s,Z,H),"end"===F&&s.selectAll("tspan").each((function(){var t=e.select(this),r=h.tester.append("text").text(t.text()).call(h.font,g),i=X(n,r.node());Math.round(i.width)=0?dt:mt+vt=0?mt:Mt+vt=0?ft:pt+xt=0?pt:St+xt=0,"top"!==t.idealAlign&&J||!K?J?(B+=V/2,t.anchor="start"):t.anchor="middle":(B-=V/2,t.anchor="end"),t.crossPos=B;else{if(t.pos=B,J=F+U/2+Q<=H,K=F-U/2-Q>=0,"left"!==t.idealAlign&&J||!K)if(J)F+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=F+tt-H,rt=F-tt;et>0&&(F-=et),rt<0&&(F+=-rt)}else F-=U/2,t.anchor="end";t.crossPos=F}b.attr("text-anchor",t.anchor),D&&z.attr("text-anchor",t.anchor),r.attr("transform",o(F,B)+(u?s(w):""))})),{hoverLabels:Et,commonLabelBoundingBox:Q}}function j(t,e,r,n,a,o){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=i.templateString(t.name,t.trace._meta)),s=G(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===a?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),o&&""===l&&!t.hovertemplate&&(""===s&&o.remove(),l=s);var h=t.hovertemplate||!1;if(h){var f=t.hovertemplateLabels||t;t[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),l=(l=i.hovertemplateString(h,f,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=G(r,t.nameLength),""}))}return[l,s]}function B(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*M),{x:r,y:n}}function N(t,r,n,i){var a=function(t){return t*n},o=function(t){return t*i};t.each((function(t){var n=e.select(this);if(t.del)return n.remove();var i,s,l,u,f=n.select("text.nums"),p=t.anchor,d="end"===p?-1:1,m=(s={start:1,end:-1,middle:0}[(i=t).anchor],u=(l=s*(E+C))+s*(i.txwidth+C),"middle"===i.anchor&&(l-=i.tx2width/2,u+=i.txwidth/2+C),{alignShift:s,textShiftX:l,text2ShiftX:u}),g=B(t,r),y=g.x,v=g.y,x="middle"===p;n.select("path").attr("d",x?"M-"+a(t.bx/2+t.tx2width/2)+","+o(v-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(d*E+y)+","+o(E+v)+"v"+o(t.by/2-E)+"h"+a(d*t.bx)+"v-"+o(t.by)+"H"+a(d*E+y)+"V"+o(v-E)+"Z");var _=y+m.textShiftX,b=v+t.ty0-t.by/2+C,w=t.textAlign||"auto";"auto"!==w&&("left"===w&&"start"!==p?(f.attr("text-anchor","start"),_=x?-t.bx/2-t.tx2width/2+C:-t.bx-C):"right"===w&&"end"!==p&&(f.attr("text-anchor","end"),_=x?t.bx/2-t.tx2width/2-C:t.bx+C)),f.call(c.positionText,a(_),o(b)),t.tx2width&&(n.select("text.name").call(c.positionText,a(m.text2ShiftX+m.alignShift*C+y),o(v+t.ty0-t.by/2+C)),n.select("rect").call(h.setRect,a(m.text2ShiftX+(m.alignShift-1)*t.tx2width/2+y),o(v-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function U(t,e){var n=t.index,a=t.trace||{},o=t.cd[0],s=t.cd[n]||{};function l(t){return t||r(t)&&0===t}var c=Array.isArray(n)?function(t,e){var r=i.castOption(o,n,t);return l(r)?r:i.extractOption({},a,"",e)}:function(t,e){return i.extractOption(s,a,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===a.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=i.constrain(t.x0,0,t.xa._length),t.x1=i.constrain(t.x1,0,t.xa._length),t.y0=i.constrain(t.y0,0,t.ya._length),t.y1=i.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var f=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+f+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+f,"y"===e&&(t.distance+=1)}var p=t.hoverinfo||t.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===p.indexOf("y")&&(t.yLabel=void 0),-1===p.indexOf("z")&&(t.zLabel=void 0),-1===p.indexOf("text")&&(t.text=void 0),-1===p.indexOf("name")&&(t.name=void 0)),t}function V(t,e,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||u){var m=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,_,b=n.readability(v.color,m)<1.5?f.contrast(m):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,A=d.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,_=g),-1!==w.indexOf("across")){var M=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),S=Math.max(S,a.position)),x=l.l+M*l.w,_=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:_,y1:y,y2:y,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==a.side?T:-T),cy:y,r:T,fill:k}).classed("spikeline",!0)}if(p){var E,C,I=e.vLinePoint;i=I&&I.xa,a=I&&I.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.pointerY):(E=i._offset+I.x,C=a._offset+I.y);var L,P,z=n.readability(I.color,m)<1.5?f.contrast(m):I.color,D=i.spikemode,O=i.spikethickness,R=i.spikecolor||z,F=d.getPxPosition(t,i);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(L=F,P=C),-1!==D.indexOf("across")){var j=i._counterDomainMin,B=i._counterDomainMax;"free"===i.anchor&&(j=Math.min(j,i.position),B=Math.max(B,i.position)),L=l.t+(1-B)*l.h,P=l.t+(1-j)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(i.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:P,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==i.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function H(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function G(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function Z(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function W(t){return t.offsetTop+t.clientTop}function Y(t){return t.offsetLeft+t.clientLeft}function X(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],f=c[1],p=u[0],d=u[1];return{x:h,y:f,width:p-h,height:d-f,top:Math.min(f,d),left:Math.min(h,p),right:Math.max(h,p),bottom:Math.max(f,d)}}}}),Mr=f({"src/components/fx/hoverlabel_defaults.js"(t,e){var r=se(),n=q(),i=Xe().isUnifiedHover;e.exports=function(t,e,a,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Sr=f({"src/components/fx/layout_global_defaults.js"(t,e){var r=se(),n=Mr(),i=j();e.exports=function(t,e){n(t,e,(function(n,a){return r.coerce(t,e,i,n,a)}))}}}),Er=f({"src/components/fx/defaults.js"(t,e){var r=se(),n=B(),i=Mr();e.exports=function(t,e,a,o){var s=r.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,(function(i,a){return r.coerce(t,e,n,i,a)}),s)}}}),Cr=f({"src/components/fx/hovermode_defaults.js"(t,e){var r=se(),n=j();e.exports=function(t,e){function i(i,a){return void 0!==e[i]?e[i]:r.coerce(t,e,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}}),Ir=f({"src/components/fx/layout_defaults.js"(t,e){var r=se(),n=j(),i=Cr(),a=Mr();e.exports=function(t,e){function o(i,a){return r.coerce(t,e,n,i,a)}i(t,e)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=e._has("mapbox"),l=e._has("map"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode="pan"),a(t,e,o),r.coerceFont(o,"hoverlabel.grouptitlefont",e.hoverlabel.font)}}}),Lr=f({"src/components/fx/calc.js"(t,e){var r=se(),n=Vt();function i(t,e,n,i){i=i||r.identity,Array.isArray(t)&&(e[0][n]=i(t))}e.exports=function(t){var e=t.calcdata,a=t._fullLayout;function o(t){return function(e){return r.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var s=0;s"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),Fr=f({"src/components/shapes/draw_newshape/constants.js"(t,e){e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),jr=f({"src/components/selections/helpers.js"(t,e){var r=se().strTranslate;function n(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:n,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return n(t,r[e])}},getTransform:function(t){return r(t.xaxis._offset,t.yaxis._offset)}}}}),Br=f({"src/components/shapes/draw_newshape/helpers.js"(t){var e=$e(),r=Fr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=jr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(t,e){return Math.abs(t-e)<=1e-6}function h(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}t.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n0&&up&&(t="X"),t}));return a>p&&(d=d.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+t)),u+d}))}(o,l,u);if("pixel"===o.xsizemode){var A=l(o.xanchor);h=A+o.x0+b,f=A+o.x1+w}else h=l(o.x0)+b,f=l(o.x1)+w;if("pixel"===o.ysizemode){var M=u(o.yanchor);p=M-o.y0+T,d=M-o.y1+k}else p=u(o.y0)+T,d=u(o.y1)+k;if("line"===m)return"M"+h+","+p+"L"+f+","+d;if("rect"===m)return"M"+h+","+p+"H"+f+"V"+d+"H"+h+"Z";var S=(h+f)/2,E=(p+d)/2,C=Math.abs(S-h),I=Math.abs(E-p),L="A"+C+","+I,P=S+C+","+E;return"M"+P+L+" 0 1,1 "+S+","+(E-I)+L+" 0 0,1 "+P+"Z"}}}),Hr=f({"src/components/shapes/display_labels.js"(t,e){var r=se(),n=nr(),i=Me(),a=Ke(),o=Br().readPaths,s=qr(),l=s.getPathString,c=Ot(),u=Ae().FROM_TL;e.exports=function(t,e,h,f){if(f.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var p;if(h.label.texttemplate){var d={};if("path"!==h.type){var m=n.getFromId(t,h.xref),g=n.getFromId(t,h.yref);for(var y in c){var v=c[y](h,m,g);void 0!==v&&(d[y]=v)}}p=r.texttemplateStringForShapes(h.label.texttemplate,{},t._fullLayout._d3locale,d)}else p=h.label.text;var x,_,b,w,T={"data-index":e},k=h.label.font,A=f.append("g").attr(T).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(p);if(h.path){var M=l(t,h),S=o(M,t);x=1/0,b=1/0,_=-1/0,w=-1/0;for(var E=0;E=t?e-n:n-e,-180/Math.PI*Math.atan2(i,a)}(x,b,_,w):0),A.call((function(e){return e.call(a.font,k).attr({}),i.convertToTspans(e,t),e}));var G=function(t,e,r,n,i,a,o){var s,l,c,h,f=i.label.textposition,p=i.label.textangle,d=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,_=i.label.yanchor;if("line"===m){"start"===f?(s=t,l=e):"end"===f?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===x&&(x="start"===f?"auto"===p?r>t?"left":rt?"right":rt?"right":rt?"left":r1&&(2!==t.length||"Z"!==t[1][0])&&(0===I&&(t[0][0]="M"),e[C]=t,A(),M())}}()}}function V(t,r){!function(t,r){if(e.length)for(var n=0;nR&&a>F&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";d(e,l),O=l.split("-")[0]}}function st(r){_(t)||(j&&(w=K(o.xanchor)),B&&(A=Q(o.yanchor)),"path"===o.type?D=o.path:(f=j?o.x0:K(o.x0),v=B?o.y0:Q(o.y0),x=j?o.x1:K(o.x1),b=B?o.y1:Q(o.y1)),fb?(M=v,I="y0",S=b,L="y1"):(M=b,I="y1",S=v,L="y0"),ot(r),ft(c,o),dt(e,o,t),nt.moveFn="move"===O?ut:ht,nt.altKey=r.altKey)}function lt(){_(t)||(d(e),pt(c),T(e,t,o),n.call("_guiRelayout",t,u.getUpdateObj()))}function ct(){_(t)||pt(c)}function ut(r,n){if("path"===o.type){var i=function(t){return t},a=i,u=i;j?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(K(t)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=et(A+n)):(u=function(t){return et(Q(t)+n)},Z&&"date"===Z.type&&(u=g.encodeDate(u))),V("path",o.path=k(D,a,u))}else j?V("xanchor",o.xanchor=tt(w+r)):(V("x0",o.x0=tt(f+r)),V("x1",o.x1=tt(x+r))),B?V("yanchor",o.yanchor=et(A+n)):(V("y0",o.y0=et(v+n)),V("y1",o.y1=et(b+n)));e.attr("d",y(t,o)),ft(c,o),l(t,s,o,q)}function ht(r,n){if(U){var i=function(t){return t},a=i,u=i;j?V("xanchor",o.xanchor=tt(w+r)):(a=function(t){return tt(K(t)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=et(A+n)):(u=function(t){return et(Q(t)+n)},Z&&"date"===Z.type&&(u=g.encodeDate(u))),V("path",o.path=k(D,a,u))}else if(N){if("resize-over-start-point"===O){var h=f+r,p=B?v-n:v+n;V("x0",o.x0=j?h:tt(h)),V("y0",o.y0=B?p:et(p))}else if("resize-over-end-point"===O){var d=x+r,m=B?b-n:b+n;V("x1",o.x1=j?d:tt(d)),V("y1",o.y1=B?m:et(m))}}else{var _=function(t){return-1!==O.indexOf(t)},T=_("n"),G=_("s"),W=_("w"),Y=_("e"),X=T?M+n:M,$=G?S+n:S,J=W?E+r:E,rt=Y?C+r:C;B&&(T&&(X=M-n),G&&($=S-n)),(!B&&$-X>F||B&&X-$>F)&&(V(I,o[I]=B?X:et(X)),V(L,o[L]=B?$:et($))),rt-J>R&&(V(P,o[P]=j?J:tt(J)),V(z,o[z]=j?rt:tt(rt)))}e.attr("d",y(t,o)),ft(c,o),l(t,s,o,q)}function ft(t,e){function r(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]),a=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":a}).classed("visual-cue",!0);var o=K(j?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,m.paramIsX))),s=Q(B?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),j&&B){var l="M"+(o-1-a)+","+(s-1-a)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(j){var c="M"+(o-1-a)+","+(s-9-a)+"v18 h2 v-18 Z";n.attr("d",c)}else{var u="M"+(o-9-a)+","+(s-1-a)+"h18 v2 h-18 Z";n.attr("d",u)}}(j||B)&&r()}function pt(t){t.selectAll(".visual-cue").remove()}function dt(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}p.init(nt),rt.node().onmousemove=ot}(t,F,v,e,c,O):!0===v.editable&&F.style("pointer-events",z||u.opacity(C)*E<=.5?"stroke":"all");F.node().addEventListener("click",(function(){return function(t,e){if(b(t)){var r=e.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=n,t._fullLayout._deactivateShape=A,x(t)}}}(t,F)}))}v._input&&!0===v.visible&&("above"===v.layer?M(t._fullLayout._shapeUpperLayer):"paper"===v.xref||"paper"===v.yref?M(t._fullLayout._shapeLowerLayer):"between"===v.layer?M(w.shapelayerBetween):w._hadPlotinfo?M((w.mainplotinfo||w).shapelayer):M(t._fullLayout._shapeLowerLayer))}function T(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function k(t,e,r){return t.replace(m.segmentRE,(function(t){var n=0,i=t.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+t.substr(1).replace(m.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,x(t))}e.exports={draw:x,drawOne:w,eraseActiveShape:function(t){if(b(t)){c(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e1?(P=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],z=["resetGeo"]):g?(P=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(L=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],P=["toggleHover"],z=["resetViewMap"]):v?P=["hoverClosestPie"]:A?(P=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):P=["toggleHover"],m&&P.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;en?i.substr(n):a.substr(r))+o:i+a+t*e:o}function d(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;os*x)||T)for(i=0;iz&&FL&&(L=F);f/=(L-I)/(2*P),I=c.l2r(I),L=c.l2r(L),c.range=c._input.range=S=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}function T(r){var a,o,c,p,d,m,g=r._fullLayout,y=g._size,v=y.p,x=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),t.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function _(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-v-n:e._offset+e._length+v+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+v+n:e._offset-v-n:y.l+y.w*(t.position||0)+n%1}for(a=0;a.5?"t":"b",o=t._fullLayout.margin[a],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===t?("top"===r&&(a+=i),a+=n-e*n):("bottom"===r&&(a+=i),a+=e*n),a}(a,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>o?s:0}(t,r,m);if(g>0){!function(t,e,r,a){var o="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(t,e,r,n,a){var o="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=i.isTopAnchor(e)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(e)&&"t"===r||i.isBottomAnchor(e)&&"b"===r)&&l=0;k--){var A=i.append("path").attr(g).style("opacity",k?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,k?"solid":b,k?4+_:_);if(p(A,t,f),w){var M=s(t.layout,"selections",f);A.style({cursor:"move"});var S={element:A.node(),plotinfo:m,gd:t,editHelpers:M,isActiveSelection:!0},E=r(l,t);n(E,A,S)}else A.style("pointer-events",k?"all":"none");T[k]=A}var C=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(h(t)){var r=e.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===t._fullLayout._activeSelectionIndex)return void d(t);t._fullLayout._activeSelectionIndex=n,t._fullLayout._deactivateSelection=d,u(t)}}}(t,C)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;o.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function d(t){h(t)&&t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,u(t))}e.exports={draw:u,drawOne:f,activateLastSelection:function(t){if(h(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=d,u(t)}}}}}),an=f({"node_modules/polybooljs/lib/build-log.js"(t,e){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}}}),on=f({"node_modules/polybooljs/lib/epsilon.js"(t,e){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}}}),sn=f({"node_modules/polybooljs/lib/linked-list.js"(t,e){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}}}),ln=f({"node_modules/polybooljs/lib/intersecter.js"(t,e){var r=sn();e.exports=function(t,e,n){function i(t,e,r){return{id:n?n.segmentId():-1,start:t,end:e,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=r.create();function o(t,r){a.insertBefore(t,(function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(t,e){var n=function(t,e){var n=r.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(n,t.end),n}(t,e);return function(t,e,n){var i=r.node({isStart:!1,pt:e.end,seg:e,primary:n,other:t,status:null});t.other=i,o(i,t.pt)}(n,t,e),n}function l(t,e){var r=i(e,t.seg.end,t.seg);return function(t,e){n&&n.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(r,t.primary)}function c(i,o){var s=r.create();function c(t){return s.findTransition((function(r){var n=function(t,r){var n=t.seg.start,i=t.seg.end,a=r.seg.start,o=r.seg.end;return e.pointsCollinear(n,a,o)?e.pointsCollinear(i,a,o)||e.pointAboveOrOnLine(i,a,o)?1:-1:e.pointAboveOrOnLine(n,a,o)?1:-1}(t,r.ev);return n>0}))}function u(t,r){var i=t.seg,a=r.seg,o=i.start,s=i.end,c=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),p=e.pointsSame(s,u);if(f&&p)return r;var d=!f&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(f)return m?l(r,s):l(t,u),r;d&&(p||(m?l(r,s):l(t,u)),l(r,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(r,o):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,s));return!1}for(var h=[];!a.isEmpty();){var f=a.getHead();if(n&&n.vert(f.pt[0]),f.isStart){let e=function(){if(d){var t=u(f,d);if(t)return t}return!!m&&u(f,m)};n&&n.segmentNew(f.seg,f.primary);var p=c(f),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;n&&n.tempStatus(f.seg,!!d&&d.seg,!!m&&m.seg);var g,y,v=e();if(v)t?(y=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above):v.seg.otherFill=f.seg.myFill,n&&n.segmentUpdate(v.seg),f.other.remove(),f.remove();if(a.getHead()!==f){n&&n.rewind(f.seg);continue}t?(y=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=y?!f.seg.myFill.below:f.seg.myFill.below):null===f.seg.otherFill&&(g=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:i,f.seg.otherFill={above:g,below:g}),n&&n.status(f.seg,!!d&&d.seg,!!m&&m.seg),f.other.status=p.insert(r.node({ev:f}))}else{var x=f.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}h.push(f.seg)}a.getHead().remove()}return n&&n.done(),h}return t?{addRegion:function(t){for(var r,i,a,o=t[t.length-1],l=0;la!=p>a&&i<(f-u)*(a-h)/(p-h)+u&&(o=!o)}return o}}}),dn=f({"src/lib/polygon.js"(t,e){var r=Et().dot,n=k().BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),e=1;ea||c===n||cs||e&&l(t))}:function(t,e){var l=t[0],c=t[1];if(l===n||la||c===n||cs)return!1;var u,h,f,p,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(h,g)||c>Math.max(f,y)))if(cu||Math.abs(r(o,f))>i)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(t.pop()),{addPt:o,raw:t,filtered:r}}}}),mn=f({"src/components/selections/constants.js"(t,e){e.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),gn=f({"src/components/selections/select.js"(t,e){var r=fn(),n=pn(),i=Vt(),a=Ke().dashStyle,o=q(),s=zr(),l=Xe().makeEventData,c=Dr(),u=c.freeMode,h=c.rectMode,f=c.drawMode,p=c.openMode,d=c.selectMode,m=qr(),g=Vr(),y=Gr(),v=xe().clearOutline,x=Br(),_=x.handleEllipse,b=x.readPaths,w=Nr().newShapes,T=Ur(),k=nn().activateLastSelection,A=se(),M=A.sorterAsc,S=dn(),E=Jt(),C=ve().getFromId,I=Or(),L=rn().redrawReglTraces,P=mn(),z=P.MINSELECT,D=S.filter,O=S.tester,R=jr(),F=R.p2r,j=R.axValue,B=R.getTransform;function N(t){return void 0!==t.subplot}function U(t,e,r,n,i,a,o){var s,l,c,u,h,f,d,m,g,v=e._hoverdata,x=e._fullLayout.clickmode.indexOf("event")>-1,_=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){Z(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(f=J(b))){for(o&&o.remove(),g=0;g=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(r),l=d(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,t)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(t)&&(u=T(h,t)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){e&&k(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Y(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Y),c=r.map(Y);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function K(t,e,r){var n,a;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ct(et);ut([C(t,nt,"x"),C(t,pt,"y")])(Q,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),p._reselect=!1}if(!a&&p._deselect){var mt=p._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!x){var r=M.clickmode;E.done(Mt).then((function(){if(E.clear(Mt),2===t){for(_t.remove(),J=0;J-1&&U(e,k,n.xaxes,n.yaxes,n.subplot,n,_t),"event"===r&&ht(k,void 0);s.click(k,e,L.id)})).catch(A.error)}},n.doneFn=function(){kt.remove(),E.done(Mt).then((function(){E.clear(Mt),!S&&$&&n.selectionDefs&&($.subtract=xt,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Y)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),b&&ht(k,at)})).catch(A.error)}},clearOutline:v,clearSelectionsCache:W,selectOnClick:U}}}),yn=f({"src/components/annotations/arrow_paths.js"(t,e){e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),vn=f({"src/constants/axis_placeable_objects.js"(t,e){e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}}}),xn=f({"src/components/annotations/attributes.js"(t,e){var r=yn(),n=R(),i=ye(),a=ge().templatedArray;vn(),e.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),_n=f({"src/traces/scatter/constants.js"(t,e){e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),bn=f({"src/traces/scatter/fillcolor_attribute.js"(t,e){e.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}}),wn=f({"src/traces/scatter/attributes.js"(t,e){var r=Ee().axisHoverFormat,n=Dt().texttemplateAttrs,i=Dt().hovertemplateAttrs,a=Le(),o=R(),s=Pt().dash,l=Pt().pattern,c=Ke(),u=_n(),h=O().extendFlat,f=bn();e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:f(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),Tn=f({"src/components/selections/attributes.js"(t,e){var r=xn(),n=wn().line,i=Pt().dash,a=O().extendFlat,o=Lt().overrideAll,s=ge().templatedArray;vn(),e.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),kn=f({"src/components/selections/defaults.js"(t,e){var r=se(),n=nr(),i=je(),a=Tn(),o=qr();function s(t,e,i){function s(n,i){return r.coerce(t,e,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete e.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var f,p,d,m=u[h],g={_fullLayout:i},y=n.coerceRef(t,e,g,m);if((f=n.getFromId(g,y))._selectionIndices.push(e._index),d=o.rangeToShapePosition(f),p=o.shapePositionToRange(f),c){var v=m+"0",x=m+"1",_=t[v],b=t[x];t[v]=p(t[v],!0),t[x]=p(t[x],!0),n.coercePosition(e,g,s,y,v),n.coercePosition(e,g,s,y,x);var w=e[v],T=e[x];void 0!==w&&void 0!==T&&(e[v]=d(w),e[x]=d(T),t[v]=_,t[x]=b)}}c&&r.noneOrAll(t,e,["x0","x1","y0","y1"])}e.exports=function(t,e){i(t,e,{name:"selections",handleItemDefaults:s});for(var r=e.selections,n=0;n=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function G(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Z(t){P&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long"),P=!1)}function W(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function Y(t,e,r,i,a){for(var o,s,l,c,u=!1,h={},f={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(G(o),2!==n||yt||function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];it&&(r=r.concat(H)),at&&(r=r.concat(J)),nt.xaxes&&(r=r.concat(nt.xaxes)),nt.yaxes&&(r=r.concat(nt.yaxes));var n,i,a={};if("reset+autosize"===e)for(e="autosize",i=0;i-1&&S(a,o,H,J,e.id,Lt),l.indexOf("event")>-1&&f.click(o,a,e.id);else if(1===n&&yt){var u=g?z:P,h="s"===g||"w"===v?0:1,p=u._name+".range["+h+"]",d=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===v&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(_t).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(d),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(t){var e=u.d2r(t);void 0!==e&&s.call("_guiRelayout",o,p,e)}))}}}function Dt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+bt)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-bt),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Ct.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>L||o>L?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,bt>n?Tt.l=bt-a:Tt.r=bt+a),Ct.attr("d",W(Tt))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Ct.attr("d",W(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;u1&&(void 0!==a.maxallowed&&st===(a.range[0]1&&(void 0!==o.maxallowed&<===(o.range[0]1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))e.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;e.set(v)}return!m&&(f(g,y),p(t),!0)}var x,_,b,w,T,k,A,M,S=Object.keys(l).map(Number).sort(i),E=e.get(),C=E||[],I=u(y,h).get(),L=[],P=-1,z=C.length;for(x=0;xC.length-(A?0:1))n.warn("index out of range",h,b);else if(void 0!==k)T.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,b),s(k)?L.push(b):A?("add"===k&&(k={}),C.splice(b,0,k),I&&I.splice(b,0,{})):n.warn("Unrecognized full object edit value",h,b,k),-1===P&&(P=b);else for(_=0;_=0;x--)C.splice(L[x],1),I&&I.splice(L[x],1);if(C.length?E||e.set(C):e.set(null),m)return!1;if(f(g,y),d!==r){var D;if(-1===P)D=S;else{for(z=Math.max(C.length,z),D=[],x=0;x=P);x++)D.push(b);for(x=P;x0&&n.log("Clearing previous rejected promises from queue."),t._promises=[]},t.cleanLayout=function(e){var r;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(e));for(r=0;r3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===e.dragmode&&(e.dragmode="orbit"),o.clean(e),e.template&&e.template.layout&&t.cleanLayout(e.template.layout),e},t.cleanData=function(e){for(var a=0;a0)return t.substr(0,e)}t.hasParent=function(t,e){for(var r=g(e);r;){if(r in t)return!0;r=g(r)}return!1};var y=["x","y","z"];t.clearAxisTypes=function(t,e,r){for(var i=0;i=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&z(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,n,o,s){!function(t,e,r,n){var a=i.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var o in z(t,r,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,n,o);for(var l=function(t,e,n,o){var s,l,c,u,h,f=i.isPlainObject(o),p=[];for(var d in Array.isArray(n)||(n=[n]),n=P(n,t.data.length-1),e)for(var m=0;m0&&"string"!=typeof z.parts[O];)O--;var R=z.parts[O],F=z.parts[O-1]+"."+R,N=z.parts.slice(0,O).join("."),U=a(t.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==D){k[P]=D,S[P]="reverse"===R?D:j(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==D)for(var G in H.impliedEdits)E(i.relativeAttr(P,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(P))if(D){E("autosize",null);var W="height"===P?"width":"height";E(W,u[W])}else u[P]=t._initialAutoSize[P];else if("autosize"===P)E("width",D?null:u.width),E("height",D?null:u.height);else if(F.match(Z))L(F),a(u,N+"._inputRange").set(null);else if(F.match(Y)){L(F),a(u,N+"._inputRange").set(null);var $=a(u,N).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&a(u,N+"._inputDomain").set(null);if("type"===R){C=U;var K="linear"===V.type&&"log"===D,Q="log"===V.type&&"linear"===D;if(K||Q){if(C&&C.range)if(V.autorange)K&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var tt=C.range[0],et=C.range[1];K?(tt<=0&&et<=0&&E(N+".autorange",!0),tt<=0?tt=et/1e6:et<=0&&(et=tt/1e6),E(N+".range[0]",Math.log(tt)/Math.LN10),E(N+".range[1]",Math.log(et)/Math.LN10)):(E(N+".range[0]",Math.pow(10,tt)),E(N+".range[1]",Math.pow(10,et)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(t,V,D,E),l.getComponentMethod("images","convertCoords")(t,V,D,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(R.match(M)){var rt=a(u,P).get(),nt=(D||{}).type;nt&&"-"!==nt||(nt="linear"),l.getComponentMethod("annotations","convertCoords")(t,rt,nt,E),l.getComponentMethod("images","convertCoords")(t,rt,nt,E)}var it=b.containerArrayMatch(P);if(it){r=it.array,n=it.index;var at=it.property,ot=H||{editType:"calc"};""!==n&&""===at&&(b.isAddVal(D)?S[P]=null:b.isRemoveVal(D)?S[P]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",e)),A.update(T,ot),y[r]||(y[r]={});var st=y[r][n];st||(st=y[r][n]={}),st[at]=D,delete e[P]}else"reverse"===R?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===D&&!1!==q||!1!==D&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==q&&"select"!==q?T.plot=!0:H?A.update(T,H):T.calc=!0,z.set(D))}}for(r in y)b.applyContainerArrayChanges(t,p(s,r),y[r],T,p)||(T.plot=!0);for(var lt in I){var ct=(C=h.getFromId(t,lt))&&C._constraintGroup;if(ct)for(var ut in T.calc=!0,ct)I[ut]||(h.getFromId(t,ut)._constraintShrinkable=!0)}(J(t)||e.height||e.width)&&(T.plot=!0);var ht=u.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=a(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var f,p,d=0;function m(t){return Array.isArray(a)?d>=a.length?t.transitionOpts=a[d]:t.transitionOpts=a[0]:t.transitionOpts=a,d++,t}var g=[],y=null==e,v=Array.isArray(e);if(y||v||!i.isPlainObject(e)){if(y||-1!==["string","number"].indexOf(typeof e))for(f=0;f0&&bb)&&T.push(p);g=T}}g.length>0?function(e){if(0!==e.length){for(var i=0;in._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,u.transition(t,e.frame.data,e.frame.layout,w.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}()}}(g):(t.emit("plotly_animated"),o())}))},t.addFrames=function(t,e,r){if(t=i.getGraphDiv(t),null==e)return Promise.resolve();if(!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,c=t._transitionData._frames,h=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=c.length+2*e.length,p=[],d={};for(n=e.length-1;n>=0;n--)if(i.isPlainObject(e[n])){var m=e[n].name,g=(h[m]||d[m]||{}).name,y=e[n].name,v=h[g]||d[g];g&&y&&"number"==typeof y&&v&&S<5&&(S++,i.warn('addFrames: overwriting frame "'+(h[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:u.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=p[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+t._transitionData._counter++];);if(h[a.name]){for(o=0;o=0;r--)n=e[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,f=[t,l],p=[t,o];return s&&s.add(t,c,f,h,p),u.modifyFrames(t,o)},t.addTraces=function e(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=t.deleteTraces,h=e,f=[r,c],p=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r")?"":e.html(t).text()}));return e.remove(),n}(_)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(s,"'")}}}),Rn=f({"src/snapshot/svgtoimg.js"(t,e){var r=se(),n=he().EventEmitter,i=Dn();e.exports=function(t){var e=t.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=t.svg,u=t.format||"png",h=t.canvas,f=t.scale||1,p=t.width||300,d=t.height||150,m=f*p,g=f*d,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!t.promise)return e.emit("error",l)}n(r),t.promise||e.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!t.promise)return e.emit("error",r)},v.src=s}));return t.promise?a:e}}}),Fn=f({"src/plot_api/to_image.js"(t,e){var r=T(),n=zn(),i=Te(),a=se(),o=Dn(),s=On(),l=Rn(),c=g().version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var h,f,p,d;function m(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(h=t.data||[],f=t.layout||{},p=t.config||{},d={}):(t=a.getGraphDiv(t),h=a.extendDeep([],t.data),f=a.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(t,r){return a.coerce(e,g,u,t,r)}var v=y("format"),x=y("width"),_=y("height"),b=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=a.extendFlat({},f);x?A.width=x:null===e.width&&r(d.width)&&(A.width=d.width),_?A.height=_:null===e.height&&r(d.height)&&(A.height=d.height);var M=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,o.getDelay(k._fullLayout))}))}function C(){return new Promise((function(t,e){var r=s(k,v,b),u=k._fullLayout.width,h=k._fullLayout.height;function f(){n.purge(k),document.body.removeChild(k)}if("full-json"===v){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=c,p=JSON.stringify(p),f(),t(T?p:o.encodeJSON(p))}if(f(),"svg"===v)return t(T?r:o.encodeSVG(r));var d=document.createElement("canvas");d.id=a.randstr(),l({format:v,width:u,height:h,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){n.newPlot(k,h,A,M).then(S).then(E).then(C).then((function(e){t(function(t){return T?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}}}),jn=f({"src/plot_api/validate.js"(t,e){var r=se(),n=Te(),i=me(),a=W().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(t,e,n,i,a,u){u=u||[];for(var h=Object.keys(t),m=0;mx.length&&i.push(f("unused",a,y.concat(x.length)));var A,M,S,E,C,I=x.length,L=Array.isArray(k);if(L&&(I=Math.min(I,k.length)),2===_.dimensions)for(M=0;Mx[M].length&&i.push(f("unused",a,y.concat(M,x[M].length)));var P=x[M].length;for(A=0;A<(L?Math.min(P,k[M].length):P);A++)S=L?k[M][A]:k,E=v[M][A],C=x[M][A],r.validate(E,S)?C!==E&&C!==+E&&i.push(f("dynamic",a,y.concat(M,A),E,C)):i.push(f("value",a,y.concat(M,A),E))}else i.push(f("array",a,y.concat(M),v[M]));else for(M=0;M1&&p.push(f("object","layout"))),n.supplyDefaults(d);for(var m=d._fullData,g=l.length,y=0;yT?h.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else h.push({code:"data"});if(function t(e,n){for(var i in e)if("_"!==i.charAt(0)){var a=e[i],o=p(e,i,n);r(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:g,layout:f},""),h.length)return h.map(m)}}}),Vn=f({"src/plot_api/index.js"(t){var e=zn();t._doPlot=e._doPlot,t.newPlot=e.newPlot,t.restyle=e.restyle,t.relayout=e.relayout,t.redraw=e.redraw,t.update=e.update,t._guiRestyle=e._guiRestyle,t._guiRelayout=e._guiRelayout,t._guiUpdate=e._guiUpdate,t._storeDirectGUIEdit=e._storeDirectGUIEdit,t.react=e.react,t.extendTraces=e.extendTraces,t.prependTraces=e.prependTraces,t.addTraces=e.addTraces,t.deleteTraces=e.deleteTraces,t.moveTraces=e.moveTraces,t.purge=e.purge,t.addFrames=e.addFrames,t.deleteFrames=e.deleteFrames,t.animate=e.animate,t.setPlotConfig=e.setPlotConfig;var r=Ct().getGraphDiv,n=Zr().eraseActiveShape;t.deleteActiveShape=function(t){return n(r(t))},t.toImage=Fn(),t.validate=jn(),t.downloadImage=Nn();var i=Un();t.makeTemplate=i.makeTemplate,t.validateTemplate=i.validateTemplate}}),qn=f({"src/traces/scatter/xy_defaults.js"(t,e){var r=se(),n=Vt();e.exports=function(t,e,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}}}),Hn=f({"src/traces/scatter/period_defaults.js"(t,e){var r=se().dateTick0,n=k().ONEWEEK;function i(t,e){return r(e,t%n==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}}}),Gn=f({"src/traces/scatter/stack_defaults.js"(t,e){var r=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(e):(c=l[o]={traceIndices:[],traces:[e]},u=!0);for(var h={orientation:e.x&&!e.y?"h":"v"},f=0;f=0;f--){var p=t[f];if("scatter"===p.type&&p.xaxis===u.xaxis&&p.yaxis===u.yaxis){p.opacity=void 0;break}}}}}}}),ti=f({"src/traces/scatter/layout_defaults.js"(t,e){var r=se(),n=_e();e.exports=function(t,e){var i,a,o="group"===e.barmode;"group"===e.scattermode&&(i="scattergap",a=o?e.bargap:.2,r.coerce(t,e,n,i,a))}}}),ei=f({"src/plots/cartesian/align_period.js"(t,e){var r=T(),n=se(),i=n.dateTime2ms,a=n.incrementMonth,o=k().ONEAVGMONTH;e.exports=function(t,e,n,s){if("date"!==e.type)return{vals:s};var l=t[n+"periodalignment"];if(!l)return{vals:s};var c,u=t[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"==typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var f=e.calendar,p="start"===l,d="end"===l,m=t[n+"period0"],g=i(m,f)||0,y=[],v=[],x=[],_=s.length,b=0;b<_;b++){var w,T,k,A=s[b];if(c){for(w=Math.round((A-g)/(c*o)),k=a(g,c*w,f);k>A;)k=a(k,-c,f);for(;k<=A;)k=a(k,c,f);T=a(k,-c,f)}else{for(k=g+(w=Math.round((A-g)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}y[b]=p?T:d?k:(T+k)/2,v[b]=T,x[b]=k}return{vals:y,starts:v,ends:x}}}}),ri=f({"src/traces/scatter/colorscale_calc.js"(t,e){var r=Se().hasColorscale,n=Ge(),i=We();e.exports=function(t,e){i.hasLines(e)&&r(e,"line")&&n(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(r(e,"marker")&&n(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),r(e,"marker.line")&&n(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ni=f({"src/traces/scatter/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;nd&&I[y].gap;)y--;for(x=I[y].s,g=I.length-1;g>y;g--)I[g].s=x;for(;dh+c||!r(u))}for(var p=0;pS[h]&&h0?o:s)/(I._m*z*(I._m>0?o:s)))),a*=1e3}if(l===i){if(P&&(l=I.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Y(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[u(t[0],at,ot),u(t[1],st,lt)]}function ht(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0}function ft(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ht(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);return c&&((a&&o?c>0==a[t]>o[t]?a:o:a||o)[t]+=c),s}}function pt(t){var e=t[0],r=t[1],n=e===G[Z-1][0],i=r===G[Z-1][1];if(!n||!i)if(Z>1){var a=e===G[Z-2][0],o=r===G[Z-2][1];n&&(e===at||e===ot)&&a?o?Z--:G[Z-1]=t:i&&(r===st||r===lt)&&o?a?Z--:G[Z-1]=t:G[Z++]=t}else G[Z++]=t}function dt(t){G[Z-1][0]!==t[0]&&G[Z-1][1]!==t[1]&&pt([Q,tt]),pt(t),et=null,Q=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=c(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&$(o,t)<$(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===B||"vh"===B?nt=function(t,e){var r=[],n=ut(t),i=ut(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===B?nt=ft(0,at,ot):"vhv"===B&&(nt=ft(1,st,lt));var mt=l.isArrayOrTypedArray(R);function gt(e){if(e&&O&&(e.i=n,e.d=t,e.trace=E,e.marker=mt?R[e.i]:R,e.backoff=O),M=e[0]/z,S=e[1]/D,J=e[0]ot?ot:0,K=e[1]lt?lt:0,J||K){if(Z)if(et){var r=nt(et,e);r.length>1&&(dt(r[0]),G[Z++]=r[1])}else rt=nt(G[Z-1],e)[0],G[Z++]=rt;else G[Z++]=[J||e[0],K||e[1]];var i=G[Z-1];J&&K&&(i[0]!==J||i[1]!==K)?(et&&(Q!==J&&tt!==K?pt(Q&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[Q||J,tt||K]):Q&&tt&&pt([Q,tt])),pt([J,K])):Q-J&&tt-K&&pt([J||Q,K||tt]),et=e,Q=J,tt=K}else et&&dt(nt(et,e)[0]),G[Z++]=e;var a,o,s,l}for(n=0;nX(m,yt))break;f=m,(w=v[0]*y[0]+v[1]*y[1])>_?(_=w,p=m,g=!1):w=t.length||!m)break;gt(m),a=m}}else gt(p)}et&&pt([Q||et[0],tt||et[1]]),V.push(G.slice(0,Z))}var vt=B.slice(B.length-1);if(O&&"h"!==vt&&"v"!==vt){for(var xt=!1,_t=-1,bt=[],wt=0;wt=0?l=p:(l=p=f,f++),l=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(t){return v?t.transition():t}var _=u.xaxis,b=u.yaxis,w=f[0].trace,T=w.line,k=r.select(d),A=a(k,"g","errorbars"),M=a(k,"g","lines"),S=a(k,"g","points"),E=a(k,"g","text");if(n.getComponentMethod("errorbars","plot")(t,A,u,m),!0===w.visible){var C,I;x(k).style("opacity",w.opacity);var L,P,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,P=b.c2p(0,!0)):"x"===z&&(L=0,P=_.c2p(0,!0)),f[0][u.isRangePlot?"nodeRangePlot3":"node3"]=k;var D,O,R="",F=[],j=w._prevtrace,B=null,N=null;j&&(R=j._prevRevpath||"",I=j._nextFill,F=j._ownPolygons,B=j._fillsegments,N=j._fillElement);var U,V,q,H,G,Z,W="",Y="",X=[];w._polygons=[];var $=[],J=[],K=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){I&&I.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(U=s.steps(T.shape),V=s.steps(T.shape.split("").reverse().join(""))):U=V="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),T.smoothing):s.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},q=function(t){return V(t.reverse())},J=c(f,{xaxis:_,yaxis:b,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill}),$=new Array(J.length);var Q=0;for(g=0;g0,g=u(t,e,n);(h=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(t,e,n){e.each((function(e){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,t);var l=e[0].trace,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(t){l[t]=null})).remove(),u.order().each((function(t){l[t]=a(r.select(this),"path","js-fill")}))}))}(t,h,e),m?(c&&(p=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(t,n,e,r,g,this,l)}))}))):h.each((function(r,n){f(t,n,e,r,g,this,l)})),d&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),fi=f({"src/traces/scatter/marker_colorbar.js"(t,e){e.exports={container:"marker",min:"cmin",max:"cmax"}}}),pi=f({"src/traces/scatter/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,e,"x"),s=r.getFromTrace(a,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var c=t.orig_y;return void 0===c&&(c=t.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),di=f({"src/traces/scatter/style.js"(t,e){var r=v(),n=Ke(),i=Vt();function a(t,e,r){n.pointStyle(t.selectAll("path.point"),e,r)}function o(t,e,r){n.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=r.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){a(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){o(r.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(n.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,t,!1),i.getComponentMethod("errorbars","style")(e)},stylePoints:a,styleText:o,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,t),o(r,i,t))}}}}),mi=f({"src/traces/scatter/get_trace_color.js"(t,e){var r=q(),n=We();e.exports=function(t,e){var i,a;if("lines"===t.mode)return(i=t.line.color)&&r.opacity(i)?i:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(t.line||{}).color)&&r.opacity(i)&&n.hasLines(t)&&t.line.width?i:t.fillcolor}}}),gi=f({"src/traces/scatter/hover.js"(t,e){var r=se(),n=zr(),i=Vt(),a=mi(),o=q(),s=r.fillText;e.exports=function(t,e,l,c){var u=t.cd,h=u[0].trace,f=t.xa,p=t.ya,d=f.c2p(e),m=p.c2p(l),g=[d,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,_=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var b=function(t){var e=Math.max(v,t.mrc||0),r=f.c2p(t.x)-d,n=p.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},w=n.getDistanceFunction(c,(function(t){if(x){var e=f.c2p(t.xStart),r=f.c2p(t.xEnd);return d>=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(f.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return ar!=(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),d=Math.max(d,a)));return{x0:h=Math.max(h,0),x1:d=Math.min(d,f._length),y0:r,y1:r}}(h._polygons);null===P&&(P={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(t,{distance:t.maxHoverDistance,x0:P.x0,x1:P.x1,y0:P.y0,y1:P.y1,color:z,hovertemplate:!1}),delete t.index,h.text&&!r.isArrayOrTypedArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}}),yi=f({"src/traces/scatter/select.js"(t,e){var r=We();e.exports=function(t,e){var n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===e)for(n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",h=c[u],f={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=t.autotypenumbers,a(c,l)){var p=i(c),d=[];for(o=0;o0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),s||"array"!==c||(c=e.categoryorder="trace"),"trace"===c?e._initialCategories=[]:"array"===c?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=_(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=_(o[l]))&&(e.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[l]=o[l]=c}if(!1===n.autorange){var f=n.range;if(f[0]f[1])return void(e.enabled=!1)}else if(o[0]>f[0]&&o[1]_[1]-1/4096&&(e.domain=s),n.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return i("layer"),e}}}),ki=f({"src/plots/cartesian/layout_defaults.js"(t,e){var r=se(),n=q(),i=Xe().isUnifiedHover,a=Cr(),o=ge(),s=Bt(),l=Ce(),c=xi(),u=wi(),h=en(),f=Ti(),p=ve(),d=p.id2name,m=p.name2id,g=ye().AX_ID_PATTERN,y=Vt(),v=y.traceIs,x=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,y){var b,w,T=e.autotypenumbers,k={},A={},M={},S={},E={},C={},I={},L={},P={},z={};for(b=0;bs.duration?(function(){for(var r={},i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!e.xr1,f=!!e.yr1,p=[];if(h){var d=i.simpleMap(e.xr0,s.r2l),m=i.simpleMap(e.xr1,s.r2l),g=d[1]-d[0],y=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(d[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var v=i.simpleMap(e.yr0,l.r2l),x=i.simpleMap(e.yr1,l.r2l),_=v[1]-v[0],b=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*b/_),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;o.drawOne(t,s,{skipTitle:!0}),o.drawOne(t,l,{skipTitle:!0}),o.redrawComponents(t,[s._id,l._id]);var w=h?c/p[2]:1,T=f?u/p[3]:1,k=h?p[0]:0,A=f?p[1]:0,M=h?p[0]/p[2]*c:0,S=f?p[1]/p[3]*u:0,E=s._offset-M,C=l._offset-S;n.clipRect.call(a.setTranslate,k,A).call(a.setScale,1/w,1/T),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,T),a.setPointGroupScale(n.zoomScalePts,1/w,1/T),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}o.redrawComponents(t)}}}),Mi=f({"src/plots/cartesian/index.js"(t){var e=v(),r=Vt(),n=se(),i=Te(),a=Ke(),o=be().getModuleCalcData,s=ve(),l=ye(),c=ke(),u=n.ensureSingle;function h(t,e,r){return n.ensureSingle(t,e,r,(function(t){t.datum(r)}))}var f=l.zindexSeparator;function p(t,n,i,s,c){for(var u,h,f,p=l.traceLayerClasses,d=t._fullLayout,m=d._zindices,g=d._modules,y=[],v=[],x=0;x1,m=e.mainplotinfo;if(!e.mainplot||d)if(p)e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.xaxislayer=u(n,"g","xaxislayer-above"),e.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");e.shapelayer=u(g,"g","shapelayer"),e.imagelayer=u(g,"g","imagelayer"),m&&d?(e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer):(e.minorGridlayer=u(n,"g","minor-gridlayer"),e.gridlayer=u(n,"g","gridlayer"),e.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");e.shapelayerBetween=u(y,"g","shapelayer"),e.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),e.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),e.overaxesBelow=u(n,"g","overaxes-below")}e.overplot=u(n,"g","overplot"),e.plot=u(e.overplot,"g",i),a||(e.xlines=u(n,"path","xlines-above"),e.ylines=u(n,"path","ylines-above"),e.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),e.overaxesAbove=u(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+o),e.ylines=n.select(".ylines-"+c),e.xaxislayer=n.select(".xaxislayer-"+o),e.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",_=i+"-y";e.minorGridlayer=m.minorGridlayer,e.gridlayer=m.gridlayer,e.zerolinelayer=m.zerolinelayer,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",_),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",_),e.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",_),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",_),e.xlines=v.select(".overlines-"+o).select("."+x),e.ylines=v.select(".overlines-"+c).select("."+_),e.xaxislayer=v.select(".overaxes-"+o).select("."+x),e.yaxislayer=v.select(".overaxes-"+c).select("."+_)}a||(p||(h(e.minorGridlayer,"g",e.xaxis._id),h(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort),h(e.gridlayer,"g",e.xaxis._id),h(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(s.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function m(t,r){if(t){var n={};for(var i in t.each((function(t){var i=t[0];e.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o0){var g=m.id;if(-1!==g.indexOf(f))continue;g+=f+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x1&&(w+=f+b),_.push(n+w),r=0;r=0,x=e.indexOf("end")>=0,_=d.backoff*g+a.standoff,b=m.backoff*y+a.startstandoff;if("line"===p.nodeName){c={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=c.x-u.x,T=c.y-u.y;if(f=(h=Math.atan2(T,w))+Math.PI,_&&b&&_+b>Math.sqrt(w*w+T*T))return void D();if(_){if(_*_>w*w+T*T)return void D();var k=_*Math.cos(h),A=_*Math.sin(h);u.x+=k,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(b){if(b*b>w*w+T*T)return void D();var M=b*Math.cos(h),S=b*Math.sin(h);c.x-=M,c.y-=S,t.attr({x1:c.x,y1:c.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),C="";if(E<_+b)return void D();var I=p.getPointAtLength(0),L=p.getPointAtLength(.1);h=Math.atan2(I.y-L.y,I.x-L.x),c=p.getPointAtLength(Math.min(b,E)),C="0px,"+b+"px,";var P=p.getPointAtLength(E),z=p.getPointAtLength(E-.1);f=Math.atan2(P.y-z.y,P.x-z.x),u=p.getPointAtLength(Math.max(0,E-_)),C+=E-(C?b+_:_)+"px,"+E+"px",t.style("stroke-dasharray",C)}function D(){t.style("stroke-dasharray","0px,100px")}function O(e,i,c,u){e.path&&(e.noRotate&&(c=0),r.select(p.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&O(m,c,h,y),x&&O(d,u,f,g)}}}),Ci=f({"src/components/annotations/draw.js"(t,e){var r=v(),n=Vt(),i=Te(),a=se(),o=a.strTranslate,s=nr(),l=q(),c=Ke(),u=zr(),h=Me(),f=fr(),p=hr(),d=ge().arrayEditor,m=Ei();function g(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),i=s.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),x(t,r,e,!1,n,i)}function y(t,e,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return t?c?a+(l?-e:e)/t._length:t.p2r(t.r2p(a)+e):a+(l?-e:e)/u}function x(t,e,i,g,v,x){var _,b,w=t._fullLayout,T=t._fullLayout._size,k=t._context.edits;g?(_="annotation-"+g,b=g+".annotations"):(_="annotation",b="annotations");var A=d(t.layout,b,e),M=A.modifyBase,S=A.modifyItem,E=A.getUpdateObj;w._infolayer.selectAll("."+_+'[data-index="'+i+'"]').remove();var C="clip"+w._uid+"_ann"+i;if(e._input&&!1!==e.visible){var I={x:{},y:{}},L=+e.textangle||0,P=w._infolayer.append("g").classed(_,!0).attr("data-index",String(i)).style("opacity",e.opacity),z=P.append("g").classed("annotation-text-g",!0),D=k[e.showarrow?"annotationTail":"annotationPosition"],O=e.captureevents||k.annotationText||D,R=z.append("g").style("pointer-events",O?"all":null).call(f,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",Z(r.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){u.loneUnhover(w._hoverlayer.node())}));var F=e.borderwidth,j=e.borderpad,B=F+j,N=R.append("rect").attr("class","bg").style("stroke-width",F+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var q=e.font,H=w._meta?a.templateString(e.text,w._meta):e.text,G=R.append("text").classed("annotation-text",!0).text(H);k.annotationText?G.call(h.makeEditable,{delegate:R,gd:t}).call(W).on("edit",(function(r){e.text=r,this.call(W),S("text",r),v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0),n.call("_guiRelayout",t,E())})):G.call(W)}else r.selectAll("#"+C).remove();function Z(t){var r={index:i,annotation:e._input,fullAnnotation:e,event:t};return g&&(r.subplotId=g),r}function W(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,Y),r}function Y(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(N.node());var i=R.select(".annotation-text-math-group"),u=!i.empty(),d=c.bBox((u?i:G).node()),_=d.width,b=d.height,A=e.width||_,O=e.height||b,j=Math.round(A+2*B),q=Math.round(O+2*B);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Y=["x","y"],X=0;X1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var dt="domain"===ft;"x"===et?(K=e[et],$=dt?it._offset+it._length*K:$=T.l+T.w*K):(K=1-e[et],$=dt?it._offset+it._length*K:$=T.t+T.h*K),Q=e.showarrow?.5:K}if(e.showarrow){ht.head=$;var mt=e["a"+et];if(tt=ot*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=s.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=T.t+T.h*mt):ht.tail=T.l+T.w*mt:ht.tail=it._offset+it.r2p(mt),J=tt}else ht.tail=$+mt,J=tt+mt;ht.text=ht.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=a.constrain(ht.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ht.tail-3,ht.text),xt=Math.min(ht.tail+3,ht.text)-yt;vt>0?(ht.tail+=vt,ht.text+=vt):xt>0&&(ht.tail-=xt,ht.text-=xt)}ht.tail+=ut,ht.head+=ut}else J=tt=lt*H(Q,ct),ht.text=$+tt;ht.text+=ut,tt+=ut,J+=ut,e["_"+et+"padplus"]=lt/2+J,e["_"+et+"padminus"]=lt/2-J,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var _t=0,bt=0;if("left"!==e.align&&(_t=(A-_)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),u)i.select("svg").attr({x:B+_t-1,y:B+bt}).call(c.setClipUrl,U?C:null,t);else{var wt=B+bt-d.top,Tt=B+_t-d.left;G.call(h.positionText,Tt,wt).call(c.setClipUrl,U?C:null,t)}V.select("rect").call(c.setRect,B,B,A,O),N.call(c.setRect,F/2,F/2,j-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-j/2),Math.round(I.y.text-q/2)),z.attr({transform:"rotate("+L+","+I.x.text+","+I.y.text+")"});var kt,At=function(r,i){P.selectAll(".annotation-arrow-g").remove();var s=I.x.head,u=I.y.head,h=I.x.tail+r,f=I.y.tail+i,d=I.x.text+r,_=I.y.text+i,b=a.rotationXYMatrix(L,d,_),w=a.apply2DTransform(b),A=a.apply2DTransform2(b),C=+N.attr("width"),D=+N.attr("height"),O=d-.5*C,F=O+C,j=_-.5*D,B=j+D,U=[[O,j,O,B],[O,B,F,B],[F,B,F,j],[F,j,O,j]].map(A);if(!U.reduce((function(t,e){return t^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=a.segmentsIntersect(h,f,s,u,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,H=e.arrowside,G=P.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),Z=G.append("path").attr("d","M"+h+","+f+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(Z,H,e),k.annotationPosition&&Z.node().parentNode&&!g){var W=s,Y=u;if(e.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-f,2));W+=e.standoff*(h-s)/X,Y+=e.standoff*(f-u)/X}var $,J,K=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(f-Y),transform:o(W,Y)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");p.init({element:K.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);$=t.x,J=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w($,J),i=n[0]+t,a=n[1]+r;R.call(c.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",o(t,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&At(0,0),D&&p.init({element:R.node(),gd:t,prepFn:function(){kt=z.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(g)return;var i,a;if(v)i=y(v,t,"x",T,e);else{var s=e._xsize/T.w,l=e.x+(e._xshift-e.xshift)/T.w-s/2;i=p.align(l+t/T.w,s,0,1,e.xanchor)}if(x)a=y(x,r,"y",T,e);else{var c=e._ysize/T.h,u=e.y-(e._yshift+e.yshift)/T.h-c/2;a=p.align(u-r/T.h,c,0,1,e.yanchor)}S("x",i),S("y",a),v&&x||(n=p.getCursor(v?.5:i,x?.5:a,e.xanchor,e.yanchor))}z.attr({transform:o(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Z(n))},doneFn:function(){f(R),n.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var o,s,l=a(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},f=t._fullLayout.annotations;if(c.length||u.length){for(o=0;o1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=n(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*a[0],e.yaxis.r2l(l.y)*a[1],e.zaxis.r2l(l.z)*a[2]]),r(t.graphDiv,l,s,t.id,l._xa,l._ya))}}}}),Ui=f({"src/components/annotations3d/index.js"(t,e){var r=Vt(),n=se();e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Ri()}}},layoutAttributes:Ri(),handleDefaults:Fi(),includeBasePlot:function(t,e){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(t),s=0;s0?f+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function c(t,e,r){var n,o,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],o=e[s+"1"],l&&(c=e[s+"0shift"],u=e[s+"1shift"])):(n=e[s+"anchor"],o=e[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(e.path){var f,p,d,m,g=1/0,y=-1/0,v=e.path.match(i.segmentRE);for("date"===t.type&&(h=a.decodeDate(h)),f=0;fy&&(y=m)));return y>=g?[g,y]:void 0}}e.exports=function(t){var e=t._fullLayout,a=r.filterVisible(e.shapes);if(a.length&&t._fullData.length)for(var l=0;l0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(t,e){function n(n,i){return r.coerce(t,e,o,n,i)}n("visible","skip"===t.method||Array.isArray(t.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}e.exports=function(t,e){n(t,e,{name:a,handleItemDefaults:s})}}}),ea=f({"src/components/updatemenus/scrollbox.js"(t,e){e.exports=o;var r=v(),n=q(),i=Ke(),a=se();function o(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(t,e,a){var s=this.gd._fullLayout,l=s.width,c=s.height;this.position=t;var u,h,f,p,d=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,_="left"===v,b="up"===v,w=m,T=y;x||_||"right"===v||b||(this.position.direction="down",x=!0),x||b?(h=(u=d)+w,x?(f=g,T=(p=Math.min(f+T,c))-f):T=(p=g+T)-(f=Math.max(p-T,0))):(p=(f=g)+T,_?w=(h=d+w)-(u=Math.max(h-w,0)):(u=d,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:f,w,h:T};var k=m>w,A=o.barLength+2*o.barPad,M=o.barWidth+2*o.barPad,S=d,E=g+y;E+M>c&&(E=c-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),k?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=y>T,L=o.barWidth+2*o.barPad,P=o.barLength+2*o.barPad,z=d+m,D=g;z+L>l&&(z=l-L);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),I?(this.vbar=O.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:D,width:L,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=I?h+L+.5:h+.5,B=f-.5,N=k?p+M+.5:p+.5,U=s._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(N)-Math.floor(B)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=r.event.dx),this.vbar&&(e-=r.event.dy),this.setTranslate(t,e)},o.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=r.event.deltaY),this.vbar&&(e+=r.event.deltaY),this.setTranslate(t,e)},o.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var n=t+this._hbarXMin,i=n+this._hbarTranslateMax;t=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,s=o+this._vbarTranslateMax;e=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},o.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=a.constrain(t||0,0,r),e=a.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var o=t/r;this.hbar.call(i.setTranslate,t+o*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}}}),ra=f({"src/components/updatemenus/draw.js"(t,e){var r=v(),n=Te(),i=q(),a=Ke(),o=se(),s=Me(),l=ge().arrayEditor,c=Ae().LINE_SPACING,u=Ki(),h=ea();function f(t){return t._index}function p(t,e){return+t.attr(u.menuIndexAttrName)===e._index}function d(t,e,r,n,i,a,o,s){e.active=o,l(t.layout,u.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(u.menuIndexAttrName,"-1"),m(t,n,i,a,e),s||g(t,n,i,a,e))}function m(t,e,r,n,i){var s=o.ensureSingle(e,"g",u.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,t).call(M,i,f,d),o.ensureSingle(e,"text",u.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(S,String(p(r,i)?-1:i._index)),g(t,e,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(T,i)})),a.setTranslate(e,l.lx,l.ly)}function g(t,e,i,a,s){i||(i=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),f=h.enter().append("g").classed(c,!0),p=h.exit();"dropdown"===s.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var _={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},k={l:_.x+s.borderwidth,t:_.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,t).call(M,s,_),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(d(t,s,0,e,i,a,-1),n.executeAPICommand(t,o.method,o.args2)):(d(t,s,0,e,i,a,l),n.executeAPICommand(t,o.method,o.args))),t.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,s),h.call(b,s)}))})),h.call(b,s),x?(k.w=Math.max(v.openWidth,v.headerWidth),k.h=_.y-k.t):(k.w=_.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=s.direction,a&&(h.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,f=i._dims,p=i.active;if(h)for(s=0,l=0;l0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,f);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),y=0;y0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,s=o.ensureSingle(t,"rect",u.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(t,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._context.staticPlot,i=t._fullLayout,o=function(t,e){for(var r=t[u.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),n.autoMargin(t,m(e))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h0?t.touches[0].clientX:0}function g(t,e,r,n){var i=a.ensureSingle(t,"rect",d.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(e,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(t,e,r,n){var i=e._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function x(t,e,n,o){var l,c=e.calcdata,f=t.selectAll("g."+d.rangePlotClassName).data(n._subplotsWith,a.identity);f.enter().append("g").attr("class",(function(t){return d.rangePlotClassName+" "+t})).call(s.setClipUrl,o._clipId,e),f.order(),f.exit().remove(),f.each((function(t,a){var s=r.select(this),f=0===a,p=h.getFromId(e,t,"y"),d=p._name,m=o[d],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[d]={type:p.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(g.layout[d].rangebreaks=p.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[d];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};f?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(e,x,function(t,e){for(var r=[],n=0;n=n.max)e=j[r+1];else if(t=n.pmax)e=j[r+1];else if(ti._length||v+b<0)return;u=y+b,f=v+b;break;case l:if(_="col-resize",y+b>i._length)return;u=y+b,f=v;break;case c:if(_="col-resize",v+b<0)return;u=y,f=v+b;break;default:_="ew-resize",u=g,f=g+b}if(f0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a1){f||p||d||"independent"===k("pattern")&&(f=!0),g._hasSubplotGrid=f;var x,_,b="top to bottom"===k("roworder"),w=f?.2:.1,T=f?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,_=e._splomGridDflt.yside),g._domains={x:c("x",k,w,x,v),y:c("y",k,T,_,y,b)}}else delete e.grid}function k(t,e){return r.coerce(n,g,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,c,h,f=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var x=f.subplots||[];c=r.subplots=new Array(m);var _=1;for(n=0;n0,h=t._context.staticPlot;e.each((function(e){var f,p=e[0].trace,d=p.error_x||{},m=p.error_y||{};p.ids&&(f=function(t){return t.id});var g=a.hasMarkers(p)&&p.marker.maxdisplayed>0;m.visible||d.visible||(e=[]);var y=r.select(this).selectAll("g.errorbar").data(e,f);if(y.exit().remove(),e.length){d.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,t),y.each((function(t){var e=r.select(this),i=function(t,e,r){var i={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(i.yh=r.c2p(t.yh),i.ys=r.c2p(t.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(i.xh=e.c2p(t.xh),i.xs=e.c2p(t.xs),n(i.xs)||(i.noXS=!0,i.xs=e.c2p(t.xs,!0))),i}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var f=m.width;a="M"+(i.x-f)+","+i.yh+"h"+2*f+"m-"+f+",0V"+i.ys,i.noYS||(a+="m-"+f+",0h"+2*f),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(d.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(d.copy_ystyle?m:d).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),p.size()?u&&(p=p.transition().duration(s.duration).ease(s.easing)):p=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),p.attr("d",a)}else p.remove()}}))}}))}}}),Ia=f({"src/components/errorbars/style.js"(t,e){var r=v(),n=q();e.exports=function(t){t.each((function(t){var e=t[0].trace,i=e.error_y||{},a=e.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),La=f({"src/components/errorbars/index.js"(t,e){var r=se(),n=Lt().overrideAll,i=Aa(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Ma(),calc:Ea(),makeComputeError:Sa(),plot:Ca(),style:Ia(),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}}}),Pa=f({"src/components/colorbar/constants.js"(t,e){e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),za=f({"src/components/colorbar/draw.js"(t,e){var r=v(),n=D(),i=Te(),a=Vt(),o=nr(),s=hr(),l=se(),c=l.strTranslate,u=O().extendFlat,h=fr(),f=Ke(),p=q(),d=Qe(),m=Me(),g=Se().flipScale,y=wi(),x=Ti(),_=Ce(),b=Ae(),w=b.LINE_SPACING,T=b.FROM_TL,k=b.FROM_BR,A=Pa().cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return u(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var h=0;h0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var pt=Math.pow(10,Math.floor(Math.log(ft)/Math.LN10));ut*=pt*l.roundUp(ft/pt,[2,5,10]),(Math.abs(Z.start)/Z.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}lt.domain=s?[ot+P/j.h,ot+Q-P/j.h]:[ot+L/j.w,ot+Q-L/j.w],lt.setScale(),t.attr("transform",c(Math.round(j.l),Math.round(j.t)));var dt,mt=t.select("."+A.cbtitleunshift).attr("transform",c(-Math.round(j.l),-Math.round(j.t))),gt=lt.ticklabelposition,yt=lt.title.font.size,vt=t.select("."+A.cbaxis),xt=0,_t=0;function bt(r,n){var i={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:F._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;t.selectAll("."+o+",."+o+"-math-group").remove(),d.draw(a,r,u(i,n||{}))}function wt(){var t,e;(s&&ct||!s&&!ct)&&("top"===V&&(t=L+j.l+tt*z,e=P+j.t+et*(1-ot-Q)+3+.75*yt),"bottom"===V&&(t=L+j.l+tt*z,e=P+j.t+et*(1-ot)-3-.25*yt),"right"===V&&(e=P+j.t+et*D+3+.75*yt,t=L+j.l+tt*ot),bt(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":s?"start":"middle"}}))}function Tt(){if(s&&!ct||!s&&ct){var t,n,i=lt.position||0,o=lt._offset+lt._length/2;if("right"===V)n=o,t=j.l+tt*i+10+yt*(lt.showticklabels?1:.5);else if(t=o,"bottom"===V&&(n=j.t+et*i+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===V){var l=U.text.split("
").length;n=j.t+et*i+10-$-w*yt*l}bt((s?"h":"v")+lt._id+"title",{avoid:{selection:r.select(a).selectAll("g."+lt._id+"tick"),side:V,offsetTop:s?0:j.t,offsetLeft:s?j.l:0,maxShift:s?F.width:F.height},attributes:{x:t,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}}function kt(){if(!s&&!ct||s&&ct){var i,u=t.select("."+A.cbtitle),h=u.select("text"),p=[-M/2,M/2],d=u.select(".h"+lt._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),d?(i=f.bBox(d),_t=i.width,(xt=i.height)>g&&(p[1]-=(xt-g)/2)):h.node()&&!h.classed(A.jsPlaceholder)&&(i=f.bBox(h.node()),_t=i.width,xt=i.height),s){if(xt){if(xt+=5,"top"===V)lt.domain[1]-=xt/j.h,p[1]*=-1;else{lt.domain[0]+=xt/j.h;var y=m.lineCount(h);p[1]+=(1-y)*g}u.attr("transform",c(p[0],p[1])),lt.setScale()}}else _t&&("right"===V&&(lt.domain[0]+=(_t+yt/2)/j.w),u.attr("transform",c(p[0],p[1])),lt.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",s?c(0,Math.round(j.h*(1-lt.domain[1]))):c(Math.round(j.w*lt.domain[0]),0)),vt.attr("transform",s?c(0,Math.round(-j.t)):c(Math.round(-j.l),0));var v=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(Y);v.enter().append("rect").classed(A.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var o=[0===i?q[0]:(Y[i]+Y[i-1])/2,i===Y.length-1?q[1]:(Y[i]+Y[i+1])/2].map(lt.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",rt).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(e._fillgradient)f.gradient(c,a,e._id,s?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=G(t).replace("e-","");c.attr("fill",n(u).toHexString())}}));var _=t.select("."+A.cblines).selectAll("path."+A.cbline).data(N.color&&N.width?X:[]);_.enter().append("path").classed(A.cbline,!0),_.exit().remove(),_.each((function(t){var e=rt,n=Math.round(lt.c2p(t))+N.width/2%1;r.select(this).attr("d","M"+(s?e+","+n:n+","+e)+(s?"h":"v")+$).call(f.lineGroupStyle,N.width,H(t),N.dash)})),vt.selectAll("g."+lt._id+"tick,path").remove();var b=rt+$+(M||0)/2-("outside"===e.ticks?1:0),T=o.calcTicks(lt),k=o.getTickSigns(lt)[2];return o.drawTicks(a,lt,{vals:"inside"===lt.ticks?o.clipEnds(lt,T):T,layer:vt,path:o.makeTickPath(lt,b,k),transFn:o.makeTransTickFn(lt)}),o.drawLabels(a,lt,{vals:T,layer:vt,transFn:o.makeTransTickLabelFn(lt),labelFns:o.makeLabelFns(lt,b)})}function At(){var r,o=$+M/2;-1===gt.indexOf("inside")&&(r=f.bBox(vt.node()),o+=s?r.width:r.height),dt=mt.select("text");var l=0,u=s&&"top"===V,d=!s&&"right"===V,m=0;if(dt.node()&&!dt.classed(A.jsPlaceholder)){var y,x=mt.select(".h"+lt._id+"title-math-group").node();x&&(s&&ct||!s&&!ct)?(l=(r=f.bBox(x)).width,y=r.height):(l=(r=f.bBox(mt.node())).right-j.l-(s?rt:st),y=r.bottom-j.t-(s?st:rt),s||"top"!==V||(o+=r.height,m=r.height)),d&&(dt.attr("transform",c(l/2+yt/2,0)),l*=2),o=Math.max(o,s?l:y)}var _=2*(s?L:P)+o+S+M/2,w=0;!s&&U.text&&"bottom"===I&&D<=0&&(_+=w=_/2,m+=w),F._hColorbarMoveTitle=w,F._hColorbarMoveCBTitle=m;var B=S+M,N=(s?rt:st)-B/2-(s?L:0),q=(s?st:rt)-(s?K:P+m-w);t.select("."+A.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(_-w,2)).attr(s?"height":"width",Math.max(K+B,2)).call(p.fill,E).call(p.stroke,e.bordercolor).style("stroke-width",S);var H=d?Math.max(l-10,0):0;t.selectAll("."+A.cboutline).attr("x",(s?rt:st+L)+H).attr("y",(s?st+P-K:rt)+(u?xt:0)).attr(s?"width":"height",Math.max($,2)).attr(s?"height":"width",Math.max(K-(s?2*P+xt:2*L+H),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":M});var G=s?nt*_:0,Z=s?0:(1-it)*_-m;if(G=R?j.l-G:-G,Z=O?j.t-Z:-Z,t.attr("transform",c(G,Z)),!s&&(S||n(E).getAlpha()&&!n.equals(F.paper_bgcolor,E))){var W=vt.selectAll("text"),Y=W[0].length,X=t.select("."+A.cbbg).node(),J=f.bBox(X),Q=f.getTranslate(t),tt=2;W.each((function(t,e){var r=0,n=Y-1;if(e===r||e===n){var i,a=f.bBox(this),o=f.getTranslate(this);if(e===n){var s=a.right+o.x;(i=J.right+Q.x+st-S-tt+z-s)>0&&(i=0)}else if(e===r){var l=a.left+o.x;(i=J.left+Q.x+st+S+tt-l)<0&&(i=0)}i&&(Y<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var et={},at=T[C],ot=k[C],ut=T[I],ht=k[I],ft=_-$;s?("pixels"===g?(et.y=D,et.t=K*ut,et.b=K*ht):(et.t=et.b=0,et.yt=D+h*ut,et.yb=D-h*ht),"pixels"===b?(et.x=z,et.l=_*at,et.r=_*ot):(et.l=ft*at,et.r=ft*ot,et.xl=z-v*at,et.xr=z+v*ot)):("pixels"===g?(et.x=z,et.l=K*at,et.r=K*ot):(et.l=et.r=0,et.xl=z+h*at,et.xr=z-h*ot),"pixels"===b?(et.y=1-D,et.t=_*ut,et.b=_*ht):(et.t=ft*ut,et.b=ft*ht,et.yt=D-v*ut,et.yb=D+v*ht));var pt=e.y<.5?"b":"t",_t=e.x<.5?"l":"r";a._fullLayout._reservedMargin[e._id]={};var bt={r:F.width-N-G,l:N+et.r,b:F.height-q-Z,t:q+et.b};R&&O?i.autoMargin(a,e._id,et):R?a._fullLayout._reservedMargin[e._id][pt]=bt[pt]:O||s?a._fullLayout._reservedMargin[e._id][_t]=bt[_t]:a._fullLayout._reservedMargin[e._id][pt]=bt[pt]}return l.syncOrAsync([i.previousPromises,wt,kt,Tt,i.previousPromises,At],a)}(g,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,l="v"===e.orientation,u=r._fullLayout,f=u._size;s.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,a){t.attr("transform",n+c(r,a)),i=s.align((l?e._uFrac:e._vFrac)+r/f.w,l?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=s.align((l?e._vFrac:1-e._uFrac)-a/f.h,l?e._lenFrac:e._thickFrac,0,1,e.yanchor);var u=s.getCursor(i,o,e.xanchor,e.yanchor);h(t,u)},doneFn:function(){if(h(t),void 0!==i&&void 0!==o){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=o,void 0!==e._traceIndex?a.call("_guiRestyle",r,n,e._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}}}),Da=f({"src/components/colorbar/index.js"(t,e){e.exports={moduleType:"component",name:"colorbar",attributes:Ie(),supplyDefaults:Ue(),draw:za().draw,hasColorbar:ze()}}}),Oa=f({"src/components/legend/index.js"(t,e){e.exports={moduleType:"component",name:"legend",layoutAttributes:dr(),supplyLayoutDefaults:gr(),draw:kr(),style:Tr()}}}),Ra=f({"src/locale-en.js"(t,e){e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),Fa=f({"src/locale-en-us.js"(t,e){e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),ja=f({"src/snapshot/cloneplot.js"(t,e){var r=Vt(),n=se(),i=n.extendFlat,a=n.extendDeep;function o(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var n,s,l=t.data,c=t.layout,u=a([],l),h=a({},c,o(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var p=Object.keys(h);for(n=0;n-1&&(h[p[n]].title={text:""});for(n=0;n=0)return t}else if("string"==typeof t&&"%"===(t=t.trim()).slice(-1)&&r(t.slice(0,-1))&&(t=+t.slice(0,-1))>=0)return t+"%"}function p(t,e,r,i,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),f=!(!1===o.moduleHasTextangle),p=!(!1===o.moduleHasInsideanchor),d=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),_=!(t.textfont&&t.textfont.color);if(_&&delete x.color,h(i,"insidetextfont",x),d){var b=n.extendFlat({},v);_&&delete b.color,h(i,"pathbar.textfont",b)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),f&&i("textangle"),i("texttemplate")}g&&p&&i("insidetextanchor")}e.exports={supplyDefaults:function(t,e,r,c){function h(r,i){return n.coerce(t,e,u,r,i)}if(o(t,e,c,h)){s(t,e,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",e.x&&!e.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var f=h("textposition");p(t,0,c,h,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(t,e,h,r,c);var d=(e.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(t,e,d||i.defaultLine,{axis:"y"}),m(t,e,d||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1},crossTraceDefaults:function(t,e){var r,i;function a(t,e){return n.coerce(i._input,i,u,t,e)}for(var o=0;o0&&!f[y]&&(h=!0),f[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:e},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==p&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");e.barcornerradius=o(v)}else delete e.barmode}}}),Xa=f({"src/traces/bar/arrays_to_calcdata.js"(t,e){var r=se();e.exports=function(t,e){for(var n=0;na))return r}return void 0!==n?n:t.dflt},t.coerceColor=function(t,e,n){return r(e).isValid()?e:void 0!==n?n:t.dflt},t.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt},t.getValue=function(t,e){var r;return n(t)?e1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){p(r.select(this),e[0].trace,t)})),o.getComponentMethod("errorbars","style")(e)},styleTextPoints:d,styleOnSelect:function(t,e,n){var s=e[0].trace;s.selectedpoints?function(t,e,n){i.selectedPointStyle(t.selectAll("path"),e),function(t,e,n){t.each((function(t){var o,s=r.select(this);if(t.selected){o=a.ensureUniformFontSize(n,m(s,t,e,n));var l=e.selected.textfont&&e.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,n)}(n,s,t):(p(n,s,t),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:b,resizeText:s}}}),to=f({"src/traces/bar/plot.js"(t,e){var r=v(),n=T(),i=se(),a=Me(),o=q(),s=Ke(),l=Vt(),c=nr().tickText,u=Ja(),h=u.recordMinTextSize,f=u.clearMinTextSize,p=Qa(),d=Ka(),m=qa(),g=Ha(),y=g.text,x=g.textposition,_=Xe().appendArrayPointValue,b=m.TEXTPAD;function w(t){return t.id}function k(t){return(t>0)-(t<0)}function A(t,e){return t0}function E(t,e,r,n,i){return!(t<0||e<0)&&(r<=t&&n<=e||r<=e&&n<=t||(i?t>=r*(e/n):e>=n*(t/r)))}function C(t){return"auto"===t?0:t}function I(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,f=((a.leftToRight||0)+1)/2,p=1-f,d=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(e-t),_=Math.abs(n-r),w=x>2*b&&_>2*b?b:0;x-=2*w,_-=2*w;var T=C(l);"auto"!==l||y<=x&&v<=_||!(y>x||v>_)||(y>_||v>x)&&yb){var E=function(t,e,r,n,i,a,o,s,l){var c,u,h,f,p,d=Math.max(0,Math.abs(e-t)-2*b),m=Math.max(0,Math.abs(n-r)-2*b),g=a-b,y=o?g-Math.sqrt(g*g-(g-o)*(g-o)):g,v=l?2*g:s?g-o:2*y,x=l?2*g:s?2*y:g-o;return i.y/i.x>=m/(d-v)?f=m/i.y:i.y/i.x<=(m-x)/d?f=d/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(d-g)*(d-g)+(m/2-g)*(m/2-g)-g*g,f=(-(u=-2*i.x*(d-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(d/2-g)*(d/2-g)+(m/2-g)*(m/2-g)-g*g,f=(-(u=-i.x*(d/2-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(d/2-g)*(d/2-g)+(m-g)*(m-g)-g*g,f=(-(u=-i.x*(d/2-g)-2*i.y*(m-g))+Math.sqrt(u*u-4*c*h))/(2*c)),f=Math.min(1,f),p=s?Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(m-i.y*f)/2)*(g-(m-i.y*f)/2)))-o):Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(d-i.x*f)/2)*(g-(d-i.x*f)/2)))-o),{scale:f,pad:p}}(t,e,r,n,S,m,g,o,d);k=E.scale,M=E.pad}else k=1,s&&(k=Math.min(1,x/S.x,_/S.y)),M=0;var L=i.left*p+i.right*f,P=(i.top+i.bottom)/2,z=(t+b)*p+(e-b)*f,D=(r+n)/2,O=0,R=0;if(h||u){var F=(o?S.x:S.y)/2;m&&(u||d)&&(w+=M);var j=o?A(t,e):A(r,n);o?h?(z=t+j*w,O=-j*F):(z=e-j*w,O=j*F):h?(D=r+j*w,R=-j*F):(D=n-j*w,R=j*F)}return{textX:L,textY:P,targetX:z,targetY:D,anchorX:O,anchorY:R,scale:k,rotate:T}}e.exports={plot:function(t,e,u,m,g,v){var T=e.xaxis,P=e.yaxis,z=t._fullLayout,D=t._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},f("bar",z));var O=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),f=l[0].trace,m=l[0].t,O="waterfall"===f.type,R="funnel"===f.type,F="histogram"===f.type,j="bar"===f.type,B=j||R,N=0;O&&f.connector.visible&&"between"===f.connector.mode&&(N=f.connector.line.width/2);var U="h"===f.orientation,V=S(g),q=i.ensureSingle(u,"g","points"),H=function(t){if(t.ids)return w}(f),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var S,O,R=r.select(this),q=function(t,e,r,n){var i=[],a=[],o=n?e:r,s=n?r:e;return i[0]=o.c2p(t.s0,!0),a[0]=s.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),a[1]=s.c2p(t.p1,!0),n?[i,a]:[a,i]}(u,T,P,U),H=q[0][0],G=q[0][1],Z=q[1][0],W=q[1][1],Y=0==(U?G-H:W-Z);if(Y&&B&&d.getLineWidth(f,u)&&(Y=!1),Y||(Y=!(n(H)&&n(G)&&n(Z)&&n(W))),u.isBlank=Y,Y&&(U?G=H:W=Z),N&&!Y&&(U?(H-=A(H,G)*N,G+=A(H,G)*N):(Z-=A(Z,W)*N,W+=A(Z,W)*N)),"waterfall"===f.type){if(!Y){var X=f[u.dir].marker;S=X.line.width,O=X.color}}else S=d.getLineWidth(f,u),O=u.mc||f.marker.color;function $(t){var e=r.round(S/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(t)-e,2):t}var J=o.opacity(O)<1||S>.01?$:function(t,e,r){return r&&t===e?t:Math.abs(t-e)>=2?$(t):t>e?Math.ceil(t):Math.floor(t)};t._context.staticPlot||(H=J(H,G,U),G=J(G,H,U),Z=J(Z,W,!U),W=J(W,Z,!U));var K,Q=U?T.c2p:P.c2p;K=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var tt,et,rt=j||F?function(t,e){if(!t)return 0;var r,n=U?Math.abs(W-Z):Math.abs(G-H),i=U?Math.abs(G-H):Math.abs(W-Z),a=J(Math.abs(Q(K,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===e?n*(Math.min(50,t)/100):t,J(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,nt="M"+H+","+Z+"V"+W+"H"+G+"V"+Z+"Z",it=0;if(rt&&u.s){var at=0===k(u.s0)||k(u.s)===k(u.s0)?u.s1:u.s0;if((it=J(u.hasB?0:Math.abs(Q(K,!0)-Q(at,!0))))0?Math.sqrt(it*(2*rt-it)):0,ht=ot>0?Math.max:Math.min;tt="M"+H+","+Z+"V"+(W-ct*st)+"H"+ht(G-(rt-it)*ot,H)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st-ut)+"V"+(Z+rt*st+ut)+"A "+rt+","+rt+" 0 0 "+lt+" "+ht(G-(rt-it)*ot,H)+","+(Z+ct*st)+"Z"}else if(u.hasB)tt="M"+(H+rt*ot)+","+Z+"A "+rt+","+rt+" 0 0 "+lt+" "+H+","+(Z+rt*st)+"V"+(W-rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot)+","+W+"H"+(G-rt*ot)+"A "+rt+","+rt+" 0 0 "+lt+" "+G+","+(W-rt*st)+"V"+(Z+rt*st)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-rt*ot)+","+Z+"Z";else{var ft=(et=Math.abs(W-Z)+it)0?Math.sqrt(it*(2*rt-it)):0,dt=st>0?Math.max:Math.min;tt="M"+(H+ft*ot)+","+Z+"V"+dt(W-(rt-it)*st,Z)+"A "+rt+","+rt+" 0 0 "+lt+" "+(H+rt*ot-pt)+","+W+"H"+(G-rt*ot+pt)+"A "+rt+","+rt+" 0 0 "+lt+" "+(G-ft*ot)+","+dt(W-(rt-it)*st,Z)+"V"+Z+"Z"}}else tt=nt}else tt=nt;var mt=M(i.ensureSingle(R,"path"),z,g,v);if(mt.style("vector-effect",D?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*(W-Z))||Y&&t._context.staticPlot?"M0,0Z":tt).call(s.setClipUrl,e.layerClipId,t),!z.uniformtext.mode&&V){var gt=s.makePointStyleFns(f);s.singlePointStyle(u,mt,f,gt,t)}!function(t,e,r,n,o,l,u,f,m,g,v,w,T){var k,S=e.xaxis,P=e.yaxis,z=t._fullLayout;function D(e,r,n){return i.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+k,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,t)}var O=n[0].trace,R="h"===O.orientation,F=function(t,e,r,n,a){var o,s=e[0].trace,l=s.texttemplate;return o=l?function(t,e,r,n,a){var o=e[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,f,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(t){return c(u,u.c2l(t),!0).text}function v(t){return c(f,f.c2l(t),!0).text}g?(l="y",u=a,h="x",f=n):(l="x",u=n,h="y",f=a);var x=e[r],b={};b.label=x.p,b.labelLabel=b[l+"Label"]=y(x.p);var w=i.castOption(o,x.i,"text");(0===w||w)&&(b.text=w),b.value=x.s,b.valueLabel=b[h+"Label"]=v(x.s);var T={};_(T,o,x.i),(p||void 0===T.x)&&(T.x=g?b.value:b.label),(p||void 0===T.y)&&(T.y=g?b.label:b.value),(p||void 0===T.xLabel)&&(T.xLabel=g?b.valueLabel:b.labelLabel),(p||void 0===T.yLabel)&&(T.yLabel=g?b.labelLabel:b.valueLabel),d&&(b.delta=+x.rawS||x.s,b.deltaLabel=v(b.delta),b.final=x.v,b.finalLabel=v(b.final),b.initial=b.final-b.delta,b.initialLabel=v(b.initial)),m&&(b.value=x.s,b.valueLabel=v(b.value),b.percentInitial=x.begR,b.percentInitialLabel=i.formatPercent(x.begR),b.percentPrevious=x.difR,b.percentPreviousLabel=i.formatPercent(x.difR),b.percentTotal=x.sumR,b.percenTotalLabel=i.formatPercent(x.sumR));var k=i.castOption(o,x.i,"customdata");return k&&(b.customdata=k),i.texttemplateString(s,b,t._d3locale,T,b,o._meta||{})}(t,e,r,n,a):s.textinfo?function(t,e,r,n){var a=t[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(t){return c(o?n:r,t,!0).text}function h(t){return c(o?r:n,+t,!0).text}var f,p=a.textinfo,d=t[e],m=p.split("+"),g=[],y=function(t){return-1!==m.indexOf(t)};if(y("label")&&g.push(u(t[e].p)),y("text")&&(0===(f=i.castOption(a,d.i,"text"))||f)&&g.push(f),s){var v=+d.rawS||d.s,x=d.v,_=x-v;y("initial")&&g.push(h(_)),y("delta")&&g.push(h(v)),y("final")&&g.push(h(x))}if(l){y("value")&&g.push(h(d.s));var b=0;y("percent initial")&&b++,y("percent previous")&&b++,y("percent total")&&b++;var w=b>1;y("percent initial")&&(f=i.formatPercent(d.begR),w&&(f+=" of initial"),g.push(f)),y("percent previous")&&(f=i.formatPercent(d.difR),w&&(f+=" of previous"),g.push(f)),y("percent total")&&(f=i.formatPercent(d.sumR),w&&(f+=" of total"),g.push(f))}return g.join("
")}(e,r,n,a):d.getValue(s.text,r),d.coerceString(y,o)}(z,n,o,S,P);k=function(t,e){var r=d.getValue(t.textposition,e);return d.coerceEnumerated(x,r)}(O,o);var j="stack"===w.mode||"relative"===w.mode,B=n[o],N=!j||B._outmost,U=B.hasB,V=g&&g-v>b;if(F&&"none"!==k&&(!B.isBlank&&l!==u&&f!==m||"auto"!==k&&"inside"!==k)){var q=z.font,H=p.getBarColor(n[o],O),G=p.getInsideTextFont(O,o,q,H),Z=p.getOutsideTextFont(O,o,q),W=O.insidetextanchor||"end",Y=r.datum();R?"log"===S.type&&Y.s0<=0&&(l=S.range[0]0&&K>0;it=V?U?E(rt-2*g,nt,J,K,R)||E(rt,nt-2*g,J,K,R):R?E(rt-(g-v),nt,J,K,R)||E(rt,nt-2*(g-v),J,K,R):E(rt,nt-(g-v),J,K,R)||E(rt-2*(g-v),nt,J,K,R):E(rt,nt,J,K,R),at&&it?k="inside":(k="outside",X.remove(),X=null)}else k="inside";if(!X){var ot=(X=D(r,F,Q=i.ensureUniformFontSize(t,"outside"===k?Z:G))).attr("transform");if(X.attr("transform",""),J=($=s.bBox(X.node())).width,K=$.height,X.attr("transform",ot),J<=0||K<=0)return void X.remove()}var st,lt=O.textangle;st="outside"===k?function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,f=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*b?b:0:f>2*b?b:0;var d=1;l&&(d=s?Math.min(1,p/h):Math.min(1,f/u));var m=C(c),g=I(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,_=(t+e)/2,w=(r+n)/2,T=0,k=0,M=s?A(e,t):A(r,n);return s?(_=e-M*o,T=M*y):(w=n+M*o,k=-M*y),{textX:v,textY:x,targetX:_,targetY:w,anchorX:T,anchorY:k,scale:d,rotate:m}}(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"outside"===O.constraintext,angle:lt}):L(l,u,f,m,$,{isHorizontal:R,constrained:"both"===O.constraintext||"inside"===O.constraintext,angle:lt,anchor:W,hasB:U,r:g,overhead:v}),st.fontSize=Q.size,h("histogram"===O.type?"bar":O.type,st,z),B.transform=st;var ct=M(X,z,w,T);i.setTransormAndDisplay(ct,st)}else r.select("text").remove()}(t,e,R,l,w,H,G,Z,W,rt,it,g,v),e.layerClipId&&s.hideOutsideRangePoint(u,R.select("text"),T,P,f.xcalendar,f.ycalendar)}));var Z=!1===f.cliponaxis;s.setClipUrl(u,Z?null:e.layerClipId,t)}));l.getComponentMethod("errorbars","plot")(t,O,e,g)},toMoveInsideBar:L}}}),eo=f({"src/traces/bar/hover.js"(t,e){var r=zr(),n=Vt(),i=q(),a=se().fillText,o=Ka().getLineWidth,s=nr().hoverLabelText,l=k().BADNUM;function c(t,e,n,i,o){var c,u,h,f,p,d,m,g=t.cd,y=g[0].trace,v=g[0].t,x="closest"===i,_="waterfall"===y.type,b=t.maxHoverDistance,w=t.maxSpikeDistance;"h"===y.orientation?(c=n,u=e,h="y",f="x",p=D,d=P):(c=e,u=n,h="x",f="y",d=D,p=P);var T=y[h+"period"],k=x||T;function A(t){return S(t,-1)}function M(t){return S(t,1)}function S(t,e){var r=t.w;return t[h]+e*r/2}function E(t){return t[h+"End"]-t[h+"Start"]}var C=x?A:T?function(t){return t.p-E(t)/2}:function(t){return Math.min(A(t),t.p-v.bardelta/2)},I=x?M:T?function(t){return t.p+E(t)/2}:function(t){return Math.max(M(t),t.p+v.bardelta/2)};function L(t,e,n){return o.finiteRange&&(n=0),r.inbox(t-c,e-c,n+Math.min(1,Math.abs(e-t)/m)-1)}function P(t){return L(C(t),I(t),b)}function z(t){var e=t[f];if(_){var r=Math.abs(t.rawS)||0;u>0?e+=r:u<0&&(e-=r)}return e}function D(t){var e=u,n=t.b,i=z(t);return r.inbox(n-e,i-e,b+(i-e)/(i-n)-1)}var O=t[h+"a"],R=t[f+"a"];m=Math.abs(O.r2c(O.range[1])-O.r2c(O.range[0]));var F=r.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(r.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==l){k||(C=function(t){return Math.min(A(t),t.p-v.bargroupwidth/2)},I=function(t){return Math.max(M(t),t.p+v.bargroupwidth/2)});var j=g[t.index],B=y.base?j.b+j.s:j.s;t[f+"0"]=t[f+"1"]=R.c2p(j[f],!0),t[f+"LabelVal"]=B;var N=v.extents[v.extents.round(j.p)];t[h+"0"]=O.c2p(x?C(j):N[0],!0),t[h+"1"]=O.c2p(x?I(j):N[1],!0);var U,V,q,H,G=void 0!==j.orig_p;return t[h+"LabelVal"]=G?j.orig_p:j.p,t.labelLabel=s(O,t[h+"LabelVal"],y[h+"hoverformat"]),t.valueLabel=s(R,t[f+"LabelVal"],y[f+"hoverformat"]),t.baseLabel=s(R,j.b,y[f+"hoverformat"]),t.spikeDistance=(V=u,q=(U=j).b,H=z(U),(r.inbox(q-V,H-V,w+(H-V)/(H-q)-1)+function(t){return L(A(t),M(t),w)}(j))/2),t[h+"Spike"]=O.c2p(j.p,!0),a(j,y,t),t.hovertemplate=y.hovertemplate,t}}function u(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,a=o(t,e);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}e.exports={hoverPoints:function(t,e,r,i,a){var o=c(t,e,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),ro=f({"src/traces/bar/event_data.js"(t,e){e.exports=function(t,e,r){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),"h"===r.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}}}),no=f({"src/traces/bar/select.js"(t,e){function r(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var n,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(n=0;n0?(g="v",y=x>0?Math.min(b,_):Math.min(_)):x>0?(g="h",y=Math.min(b)):y=0;if(y){e._length=y;var S=i("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(i("x0",0),i("dx",1)):"h"===S&&0===v&&(i("y0",0),i("dy",1)):"v"===S&&0===x?i("x0"):"h"===S&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function u(t,e,n,i){var a=i.prefix,o=r.coerce2(t,e,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";e._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",e.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",e.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete e.marker;var h=n("hoveron");"all"!==h&&-1===h.indexOf("points")||n("hovertemplate"),r.coerceSelectionMarkerOpacity(e,n)}e.exports={supplyDefaults:function(t,e,n,o){function s(n,i){return r.coerce(t,e,l,n,i)}if(c(t,e,s,o),!1!==e.visible){a(t,e,o,s),s("xhoverformat"),s("yhoverformat");var h=e._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(e.line.color,.5));var f=!1;if(h){var p=s("mean"),d=s("sd");p&&p.length&&(f=!0,d&&d.length&&(f="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",f)),s("showwhiskers","quartiles"===g),"sd"!==g&&"sd"!==m||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(t.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(t,e,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(t,e){var n,i;function a(t){return r.coerce(i._input,i,l,t)}for(var s=0;sE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return v.d2c((e[t]||[])[l])},q=1/0,H=-1/0;for(l=0;l=E.q1&&E.q3>=E.med){var Z=V("lowerfence");E.lf=Z!==o&&Z<=E.q1?Z:f(E,I,L);var W=V("upperfence");E.uf=W!==o&&W>=E.q3?W:p(E,I,L);var Y=V("mean");E.mean=Y!==o?Y:L?a.mean(I,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Y!==o&&X>=0?X:L?a.stdev(I,L,E.mean):E.q3-E.q1,E.lo=d(E),E.uo=m(E);var $=V("notchspan");$=$!==o&&$>0?$:g(E,L),E.ln=E.med-$,E.un=E.med+$;var J=E.lf,K=E.uf;e.boxpoints&&I.length&&(J=Math.min(J,I[0]),K=Math.max(K,I[L-1])),e.notched&&(J=Math.min(J,E.ln),K=Math.max(K,E.un)),E.min=J,E.max=K}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(N),M.push(E)}}e._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var tt=v.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ht;(E={}).pos=E[b]=j[l],C=E.pts=nt[l].sort(u),L=(I=E[x]=C.map(h)).length,E.min=I[0],E.max=I[L-1],E.mean=a.mean(I,L),E.sd=a.stdev(I,L,E.mean)*e.sdmultiple,E.med=a.interp(I,.5),L%2&&(lt||ct)?(lt?(ut=I.slice(0,L/2),ht=I.slice(L/2+1)):ct&&(ut=I.slice(0,L/2+1),ht=I.slice(L/2)),E.q1=a.interp(ut,.5),E.q3=a.interp(ht,.5)):(E.q1=a.interp(I,.25),E.q3=a.interp(I,.75)),E.lf=f(E,I,L),E.uf=p(E,I,L),E.lo=d(E),E.uo=m(E);var ft=g(E,L);E.ln=E.med-ft,E.un=E.med+ft,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=C.filter(N),M.push(E)}e.notched&&a.isTypedArray(tt)&&(tt=Array.from(tt)),e._extremes[v._id]=n.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(a.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:B,posLetter:b,valLetter:x,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean||"sd"===e.sizemode?s(t,"mean ± σ:").replace("σ",1===e.sdmultiple?"σ":e.sdmultiple+"σ"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},T[S]++,M):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(t,e,r){for(var n in l)a.isArrayOrTypedArray(e[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(e[n][r[0]])&&(t[l[n]]=e[n][r[0]][r[1]]):t[l[n]]=e[n][r])}function u(t,e){return t.v-e.v}function h(t){return t.v}function f(t,e,r){return 0===r?t.q1:Math.min(t.q1,e[Math.min(a.findBin(2.5*t.q1-1.5*t.q3,e,!0)+1,r-1)])}function p(t,e,r){return 0===r?t.q3:Math.max(t.q3,e[Math.max(a.findBin(2.5*t.q3-1.5*t.q1,e),0)])}function d(t){return 4*t.q1-3*t.q3}function m(t){return 4*t.q3-3*t.q1}function g(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}}}),ho=f({"src/traces/box/cross_trace_calc.js"(t,e){var r=nr(),n=se(),i=en().getAxisGroup,a=["v","h"];function o(t,e,a,o){var s,l,c,u=e.calcdata,h=e._fullLayout,f=o._id,p=f.charAt(0),d=[],m=0;for(s=0;s1,_=1-h[t+"gap"],b=1-h[t+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,Z=E.marker.size/2,W=0;H+G>=0&&((W=V*(H+G))>M?(q=!0,N=Z,j=W):W>R&&(N=Z,j=M)),W<=M&&(j=M);var Y=0;H-G<=0&&((Y=-V*(H-G))>S?(q=!0,U=Z,B=Y):Y>F&&(U=Z,B=S)),Y<=S&&(B=S)}else j=M,B=S;var X=new Array(c.length);for(l=0;lt.lo&&(x.so=!0)}return a}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,s)}function s(t,e,i,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,h=a.bPos,f=a.bPosPxOffset||0,p=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+h,!0),n=c.l2p(e-o)+f,a=c.l2p(e+s)+f,d=u?(n+a)/2:c.l2p(e)+f,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+n+"L"+y+","+d+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+n+","+m+"L"+d+","+y+"Z":""))}))}e.exports={plot:function(t,e,i,l){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(t){var e,n,i=r.select(this),l=t[0],f=l.t,p=l.trace;f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty?i.remove():("h"===p.orientation?(e=h,n=u):(e=u,n=h),a(i,{pos:e,val:n},p,f,c),o(i,{x:u,y:h},p,f),s(i,{pos:e,val:n},p,f))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),po=f({"src/traces/box/style.js"(t,e){var r=v(),n=q(),i=Ke();e.exports={style:function(t,e,a){var o=a||r.select(t).selectAll("g.trace.boxes");o.style("opacity",(function(t){return t[0].trace.opacity})),o.each((function(e){var a=r.select(this),o=e[0].trace,s=o.line.width;function l(t,e,r,i){t.style("stroke-width",e+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(t){if(!t.empty){var e=r.select(this),n=o[t.dir];l(e,n.line.width,n.line.color,n.fillcolor),e.style("opacity",o.selectedpoints&&!t.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,t)}}))},styleOnSelect:function(t,e,r){var n=e[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,t)}}}}),mo=f({"src/traces/box/hover.js"(t,e){var r=nr(),n=se(),i=zr(),a=q(),o=n.fillText;function s(t,e,o,s){var l,c,u,h,f,p,d,m,g,y,v,x,_,b,w=t.cd,T=t.xa,k=t.ya,A=w[0].trace,M=w[0].t,S="violin"===A.type,E=M.bdPos,C=M.wHover,I=function(t){return u.c2l(t.pos)+M.bPos-u.c2l(p)};S&&"both"!==A.side?("positive"===A.side&&(g=function(t){var e=I(t);return i.inbox(e,e+C,y)},x=E,_=0),"negative"===A.side&&(g=function(t){var e=I(t);return i.inbox(e-C,e,y)},x=0,_=E)):(g=function(t){var e=I(t);return i.inbox(e-C,e+C,y)},x=_=E),b=S?function(t){return i.inbox(t.span[0]-f,t.span[1]-f,y)}:function(t){return i.inbox(t.min-f,t.max-f,y)},"h"===A.orientation?(f=e,p=o,d=b,m=g,l="y",u=k,c="x",h=T):(f=o,p=e,d=g,m=b,l="x",u=T,c="y",h=k);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function P(t){return(d(t)+m(t))/2}y=t.maxHoverDistance-L,v=t.maxSpikeDistance-L;var z=i.getDistanceFunction(s,d,m,P);if(i.getClosest(w,z,t),!1===t.index)return[];var D=w[t.index],O=A.line.color,R=(A.marker||{}).color;a.opacity(O)&&A.line.width?t.color=O:a.opacity(R)&&A.boxpoints?t.color=R:t.color=A.fillcolor,t[l+"0"]=u.c2p(D.pos+M.bPos-_,!0),t[l+"1"]=u.c2p(D.pos+M.bPos+x,!0),t[l+"LabelVal"]=void 0!==D.orig_p?D.orig_p:D.pos;var F=l+"Spike";t.spikeDistance=P(D)*v/y,t[F]=u.c2p(D.pos,!0);var j=A.boxmean||"sd"===A.sizemode||(A.meanline||{}).visible,B=A.boxpoints||A.points,N=B&&j?["max","uf","q3","med","mean","q1","lf","min"]:B&&!j?["max","uf","q3","med","q1","lf","min"]:!B&&j?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]0&&(a=!0);for(var l=0;la){var o=a-n[t];return n[t]=a,o}}return 0},max:function(t,e,n,i){var a=i[e];if(r(a)){if(a=Number(a),!r(n[t]))return n[t]=a,a;if(n[t]l?t>a?t>1.1*n?n:t>1.1*i?i:a:t>o?o:t>s?s:l:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function f(t,e,r,i,o,s){if(i&&t>a){var l=p(e,o,s),c=p(r,o,s),u=t===n?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var i=e.c2d(t,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}e.exports=function(t,e,r,i,o){var s,l,h=-1.1*e,f=-.1*e,p=t-f,d=r[0],m=r[1],g=Math.min(u(d+f,d+p,i,o),u(m+f,m+p,i,o)),y=Math.min(u(d+h,d+f,i,o),u(m+h,m+f,i,o));if(g>y&&ya){var v=s===n?1:6,x=s===n?"M12":"M1";return function(e,r){var a=i.c2d(e,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var u=i.d2c(a,0,o);if(uo.r2l(j)&&(N=a.tickIncrement(N,_.size,!0,p)),D.start=o.l2r(N),F||n.nestedProperty(e,y+".start").set(D.start)}var U=_.end,V=o.r2l(z.end),q=void 0!==V;if((_.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,d);D.end=o.l2r(H),q||n.nestedProperty(e,y+".start").set(D.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=n.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[D,d]}e.exports={calc:function(t,e){var i,f,p,d,m=[],g=[],y="h"===e.orientation,v=a.getFromId(t,y?e.yaxis:e.xaxis),x=y?"y":"x",_={x:"y",y:"x"}[x],b=e[x+"calendar"],w=e.cumulative,T=h(t,e,v,x),k=T[0],A=T[1],M="string"==typeof k.size,S=[],E=M?S:k,C=[],I=[],L=[],P=0,z=e.histnorm,D=e.histfunc,O=-1!==z.indexOf("density");w.enabled&&O&&(z=z.replace(/ ?density$/,""),O=!1);var R,F="max"===D||"min"===D?null:0,j=s.count,B=l[z],N=!1,U=function(t){return v.r2c(t,0,b)};for(n.isArrayOrTypedArray(e[_])&&"count"!==D&&(R=e[_],N="avg"===D,j=s[D]),i=U(k.start),p=U(k.end)+(i-a.tickIncrement(i,k.size,!1,b))/1e6;i=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var J=Math.min(m.length,g.length),K=[],Q=0,tt=J-1;for(i=0;i=Q;i--)if(g[i]){tt=i;break}for(i=Q;i<=tt;i++)if(r(m[i])&&r(g[i])){var et={p:m[i],s:g[i],b:0};w.enabled||(et.pts=L[i],Z?et.ph0=et.ph1=L[i].length?A[L[i][0]]:m[i]:(e._computePh=!0,et.ph0=H(S[i]),et.ph1=H(S[i+1],!0))),K.push(et)}return 1===K.length&&(K[0].width1=a.tickIncrement(K[0].p,k.size,!1,b)-K[0].p),o(K,e),n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(K,e,X),K},calcAllAutoBins:h}}}),Io=f({"src/traces/histogram2d/calc.js"(t,e){var r=se(),n=nr(),i=Ao(),a=Mo(),o=So(),s=Eo(),l=Co().calcAllAutoBins;function c(t,e,r,n){var i,a=new Array(t);if(n)for(i=0;iS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],C=[],I=[],L="string"==typeof w.size,P="string"==typeof A.size,z=[],D=[],O=L?z:w,R=P?D:A,F=0,j=[],B=[],N=e.histnorm,U=e.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],Z=!1,W=[],Y=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(Z="avg"===U,H=i[U]);var $=w.size,J=x(w.start),K=x(w.end)+(J-n.tickIncrement(J,$,!1,y))/1e6;for(s=J;s=0&&p=0&&dm&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-m))))}return y}e.exports=function(t,e){var n,o=1;for(a(t,e),n=0;n.01;n++)o=a(t,e,i(o));return o>.01&&r.log("interp2d didn't converge quickly",o),t}}}),Do=f({"src/traces/heatmap/find_empties.js"(t,e){var r=se().maxRowLength;e.exports=function(t){var e,n,i,a,o,s,l,c,u=[],h={},f=[],p=t[0],d=[],m=[0,0,0],g=r(t);for(n=0;n=0;o--)(s=((h[[(n=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}}}),Oo=f({"src/traces/heatmap/make_bound_array.js"(t,e){var r=Vt(),n=se().isArrayOrTypedArray;e.exports=function(t,e,i,a,o,s){var l,c,u,h=[],f=r.traceIs(t,"contour"),p=r.traceIs(t,"histogram");if(n(e)&&e.length>1&&!p&&"category"!==s.type){var d=e.length;if(!(d<=o))return f?e.slice(0,o):e.slice(0,o+1);if(f)h=Array.from(e).slice(0,o);else if(1===o)h="log"===s.type?[.5*e[0],2*e[0]]:[e[0]-.5,e[0]+.5];else if("log"===s.type){for(h=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],u=1;u1){var e=(t[t.length-1]-t[0])/(t.length-1),r=Math.abs(e/100);for(k=0;kr)return!1}return!0}(M.rangebreaks||S.rangebreaks)&&(T=function(t,e,r){for(var n=[],i=-1,a=0;a0;)k=A.c2p(B[I]),I--;for(k0;)C=M.c2p(N[I]),I--;C=A._length||k<=0||E>=M._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void _(z);"fast"===X?(J=Z,K=G):(J=Q,K=tt);var et=document.createElement("canvas");et.width=J,et.height=K;var rt,nt,it=et.getContext("2d",{willReadFrequently:!0}),at=f(O,{noNumericCheck:!0,returnArray:!0});"fast"===X?(rt=W?function(t){return Z-1-t}:s.identity,nt=Y?function(t){return G-1-t}:s.identity):(rt=function(t){return s.constrain(Math.round(A.c2p(B[t])-v),0,Q)},nt=function(t){return s.constrain(Math.round(M.c2p(N[t])-E),0,tt)});var ot,st,lt,ct,ut=nt(0),ht=[ut,ut],ft=W?0:1,pt=Y?0:1,dt=0,mt=0,gt=0,yt=0;function vt(t,e){if(void 0!==t){var r=at(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),dt+=e,mt+=r[0]*e,gt+=r[1]*e,yt+=r[2]*e,r}return[0,0,0,0]}function xt(t,e,r,n){var i=t[r.bin0];if(void 0===i)return vt(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,vt(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==X){var _t,bt=0;try{_t=new Uint8Array(J*K*4)}catch(t){_t=new Array(J*K*4)}if("smooth"===X){var wt,Tt,kt,At=U||B,Mt=V||N,St=new Array(At.length),Et=new Array(Mt.length),Ct=new Array(Q),It=U?w:b,Lt=V?w:b;for(I=0;IXt||Xt>M._length))for(L=Gt;LJt||Jt>A._length)){var Kt=c({x:$t,y:Yt},O,t._fullLayout);Kt.x=$t,Kt.y=Yt;var Qt=D.z[I][L];void 0===Qt?(Kt.z="",Kt.zLabel=""):(Kt.z=Qt,Kt.zLabel=o.tickText(Ut,Qt,"hover").text);var te=D.text&&D.text[I]&&D.text[I][L];void 0!==te&&!1!==te||(te=""),Kt.text=te;var ee=s.texttemplateString(Bt,Kt,t._fullLayout._d3locale,Kt,O._meta||{});if(ee){var re=ee.split("
"),ne=re.length,ie=0;for(P=0;P=b[0].length||p<0||p>b.length)return}else{if(r.inbox(e-x[0],e-x[x.length-1],0)>0||r.inbox(s-_[0],s-_[_.length-1],0)>0)return;if(d){var E;for(M=[2*x[0]-x[1]],E=1;E=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ss=f({"src/traces/contour/attributes.js"(t,e){var r=_o(),n=wn(),i=Ee(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Le(),l=Pt().dash,c=R(),u=O().extendFlat,h=os(),f=h.COMPARISON_OPS2,p=h.INTERVAL_OPS,d=n.line;e.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(f).concat(p),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},d.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),ls=f({"src/traces/histogram2dcontour/attributes.js"(t,e){var r=ts(),n=ss(),i=Le(),a=Ee().axisHoverFormat,o=O().extendFlat;e.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),cs=f({"src/traces/contour/contours_defaults.js"(t,e){e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}}}),us=f({"src/traces/contour/label_defaults.js"(t,e){var r=se();e.exports=function(t,e,n,i){if(i||(i={}),t("contours.showlabels")){var a=e.font;r.coerceFont(t,"contours.labelfont",a,{overrideDflt:{color:n}}),t("contours.labelformat")}!1!==i.hasHover&&t("zhoverformat")}}}),hs=f({"src/traces/contour/style_defaults.js"(t,e){var r=Ve(),n=us();e.exports=function(t,e,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,r(t,e,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),fs=f({"src/traces/histogram2dcontour/defaults.js"(t,e){var r=se(),n=es(),i=cs(),a=hs(),o=wo(),s=ls();e.exports=function(t,e,l,c){function u(n,i){return r.coerce(t,e,s,n,i)}n(t,e,u,c),!1!==e.visible&&(i(t,e,u,(function(n){return r.coerce2(t,e,s,n)})),a(t,e,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),e.contours&&"heatmap"===e.contours.coloring&&o(u,c))}}}),ps=f({"src/traces/contour/set_contours.js"(t,e){var r=nr(),n=se();function i(t,e,n){var i={type:"linear",range:[t,e]};return r.autoTicks(i,(e-t)/(n||15)),i}e.exports=function(t,e){var a=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),t._input.contours||(t._input.contours={}),n.extendFlat(t._input.contours,{start:a.start,end:a.end,size:a.size}),t._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,f=t._input.contours;u>h&&(a.start=f.start=h,h=a.end=f.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,t.ncontours).dtick,f.size=a.size=c)}}}}),ds=f({"src/traces/contour/end_plus.js"(t,e){e.exports=function(t){return t.end+t.size/1e6}}}),ms=f({"src/traces/contour/calc.js"(t,e){var r=Ze(),n=Ro(),i=ps(),a=ds();e.exports=function(t,e){var o=n(t,e),s=o[0].z;i(e,s);var l,c=e.contours,u=r.extractOpts(e);if("heatmap"===c.coloring&&u.auto&&!1===e.autocontour){var h=c.start,f=a(c),p=c.size||1,d=Math.floor((f-h)/p)+1;isFinite(p)||(p=1,d=1);var m=h-p/2;l=[m,m+d*p]}else l=s;return r.calc(t,e,{vals:l,cLetter:"z"}),o}}}),gs=f({"src/traces/contour/constants.js"(t,e){e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),ys=f({"src/traces/contour/make_crossings.js"(t,e){var r=gs();function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);return 5===r||10===r?t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}e.exports=function(t){var e,i,a,o,s,l,c,u,h,f=t[0].z,p=f.length,d=f[0].length,m=2===p||2===d;for(i=0;i20&&e?208===t||1114===t?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(t)?a=1:-1!==n.LEFTSTART.indexOf(t)?i=1:-1!==n.TOPSTART.indexOf(t)?a=-1:i=-1,[i,a]}(h,a,e),p=[o(t,e,[-f[0],-f[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),y=f.slice();for(c=0;c<1e4;c++){if(h>20?(h=n.CHOOSESADDLE[h][(f[0]||f[1])<0?0:1],t.crossings[u]=n.SADDLEREMAINDER[h]):delete t.crossings[u],!(f=n.NEWDELTA[h])){r.log("Found bad marching index:",h,e,t.level);break}p.push(o(t,e,f)),e[0]+=f[0],e[1]+=f[1],u=e.join(","),i(p[p.length-1],p[p.length-2],s,l)&&p.pop();var v=f[0]&&(e[0]<0||e[0]>m-2)||f[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&f[0]===y[0]&&f[1]===y[1]||a&&v)break;h=t.crossings[u]}1e4===c&&r.log("Infinite loop in contour?");var x,_,b,w,T,k,A,M,S,E,C,I,L,P,z,D=i(p[0],p[p.length-1],s,l),O=0,R=.2*t.smoothing,F=[],j=0;for(c=1;c=j;c--)if((x=F[c])=j&&x+F[_]M&&S--,t.edgepaths[S]=C.concat(p,E));break}V||(t.edgepaths[M]=p.concat(E))}for(M=0;M":o(">"),"<":o("<"),"=":o("=")}}}),_s=f({"src/traces/contour/empty_pathinfo.js"(t,e){var r=se(),n=xs(),i=ds();e.exports=function(t,e,a){for(var o="constraint"===t.type?n[t._operation](t.value):t,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:e.xaxis,yaxis:e.yaxis,x:a.x,y:a.y},f=o.start;f1e3){r.warn("Too many contours, clipping at 1000",t);break}return l}}}),bs=f({"src/traces/contour/convert_to_constraints.js"(t,e){var r=se();function n(t){return r.extendFlat({},t,{edgepaths:r.extendDeep([],t.edgepaths),paths:r.extendDeep([],t.paths),starts:r.extendDeep([],t.starts)})}e.exports=function(t,e){var i,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&r.warn("Contour data invalid for the specified inequality operation."),a=t[0],i=0;io.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&f===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),hc&&(n.prefixBoundary=!0)}}}}}),Ts=f({"src/traces/contour/plot.js"(t){var e=v(),r=se(),n=Ke(),i=Ze(),a=Me(),o=nr(),s=tr(),l=Bo(),c=ys(),u=vs(),h=_s(),f=bs(),p=ws(),d=gs(),m=d.LABELOPTIMIZER;function g(t,e){var i,a,o,s,l,c,u,h="",f=0,p=t.edgepaths.map((function(t,e){return e})),d=!0;function m(t){return Math.abs(t[1]-e[2][1])<.01}function g(t){return Math.abs(t[0]-e[0][0])<.01}function y(t){return Math.abs(t[0]-e[2][0])<.01}for(;p.length;){for(c=n.smoothopen(t.edgepaths[f],t.smoothing),h+=d?c:c.replace(/^M/,"L"),p.splice(p.indexOf(f),1),i=t.edgepaths[f][t.edgepaths[f].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",f,t);break}for(u=i,Math.abs(u[1]-e[0][1])<.01&&!y(i)?a=e[1]:g(i)?a=e[0]:m(i)?a=e[3]:y(i)&&(a=e[2]),l=0;l=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===t.edgepaths.length){r.log("unclosed perimeter path");break}f=s,(d=-1===p.indexOf(f))&&(f=p[0],h+="Z")}for(f=0;fi.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(f<1||p<1)return 1/0;var d=m.EDGECOST*(1/(f-1)+1/(p-1));d+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,_=0;_2*m.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(f<=m.MAXCOST)return u},t.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),h=Math.cos(c),f=function(t,e){return[s+t*h-e*u,l+t*u+e*h]},p=[f(-a/2,-o/2),f(-a/2,o/2),f(a/2,o/2),f(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},t.drawLabels=function(t,n,i,o,s){var l=t.selectAll("text").data(n,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var r=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;e.select(this).text(t.text).attr({x:r,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),f=0;fy&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(n=parseFloat(e.value[0]),e.value=[n,n+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:r(e.value)&&(n=parseFloat(e.value),e.value=[n,n+1])):(t("contours.value",0),r(e.value)||(l(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(i,g),"="===y?p=g.showlines=!0:(p=i("contours.showlines"),m=i("fillcolor",a((t.line||{}).color||h,.5))),p&&(d=i("line.color",m&&o(m)?a(e.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,d,f)}}}),Ls=f({"src/traces/contour/defaults.js"(t,e){var r=se(),n=bo(),i=Hn(),a=Is(),o=cs(),s=hs(),l=wo(),c=ss();e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,c,n,i)}if(n(t,e,f,h)){i(t,e,h,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var p="constraint"===f("contours.type");f("connectgaps",r.isArray1D(e.z)),p?a(t,e,f,h,u):(o(t,e,f,(function(n){return r.coerce2(t,e,c,n)})),s(t,e,f,h)),e.contours&&"heatmap"===e.contours.coloring&&l(f,h),f("zorder")}else e.visible=!1}}}),Ps=f({"src/traces/contour/index.js"(t,e){e.exports={attributes:ss(),supplyDefaults:Ls(),calc:ms(),plot:Ts().plot,style:As(),colorbar:Ms(),hoverPoints:Ss(),moduleType:"trace",name:"contour",basePlotModule:Mi(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),zs=f({"lib/contour.js"(t,e){e.exports=Ps()}}),Ds=f({"src/traces/scatterternary/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=bn(),a=wn(),o=N(),s=Le(),l=Pt().dash,c=O().extendFlat,u=a.marker,h=a.line,f=u.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:f.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Os=f({"src/traces/scatterternary/defaults.js"(t,e){var r=se(),n=_n(),i=We(),a=Zn(),o=Wn(),s=Yn(),l=Xn(),c=$n(),u=Ds();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}var d,m=p("a"),g=p("b"),y=p("c");if(m?(d=m.length,g?(d=Math.min(d,g.length),y&&(d=Math.min(d,y.length))):d=y?Math.min(d,y.length):0):g&&y&&(d=Math.min(g.length,y.length)),d){e._length=d,p("sum"),p("text"),p("hovertext"),"fills"!==e.hoveron&&p("hovertemplate"),p("mode",d"),o.hovertemplate=f.hovertemplate,a}function x(t,e){y.push(t._hovertitle+": "+e)}}}}),Ns=f({"src/traces/scatterternary/event_data.js"(t,e){e.exports=function(t,e,r,n,i){if(e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),n[i]){var a=n[i];t.a=a.a,t.b=a.b,t.c=a.c}else t.a=e.a,t.b=e.b,t.c=e.c;return t}}}),Us=f({"src/plots/ternary/ternary.js"(t,e){var r=v(),n=D(),i=Vt(),a=se(),o=a.strTranslate,s=a._,l=q(),c=Ke(),u=tr(),h=O().extendFlat,f=Te(),p=nr(),d=hr(),m=zr(),g=Dr(),y=g.freeMode,x=g.rectMode,_=Qe(),b=Sn().prepSelect,w=Sn().selectOnClick,T=Sn().clearOutline,k=Sn().clearSelectionsCache,A=ye();function M(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e),this.updateFx(e),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}e.exports=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;aE*_?i=(a=_)*E:a=(i=x)/E,s=y*i/x,f=v*a/_,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=b,p.xaxis={type:"linear",range:[w+2*k-b,b-w-2*T],domain:[m-s/2,m+s/2],_id:"x"},u(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,b-T-k],domain:[g-f/2,g+f/2],_id:"y"},u(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,b-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});u(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[b-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(S,p.graphDiv._fullLayout),S.setScale();var C=p.caxis=h({},t.caxis,{range:[b-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+f*E],anchor:"free",position:0,_id:"y",_length:i});u(C,p.graphDiv._fullLayout),C.setScale();var I="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",I),p.layers.plotbg.select("path").attr("d",I);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",L);var P=o(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),p.clipDefRelative.select("path").attr("transform",null);var z=o(r-S._offset,n+a);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var D=o(r+i/2,n)+"rotate(30)"+o(0,-M._offset);p.layers.aaxis.attr("transform",D),p.layers.agrid.attr("transform",D);var O=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);p.layers.caxis.attr("transform",O),p.layers.cgrid.attr("transform",O),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),c.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.layers,a=e.aaxis,o=e.baxis,l=e.caxis;if(e.drawAx(a),e.drawAx(o),e.drawAx(l),t){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=_.draw(r,"a"+n,{propContainer:a,propName:e.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:e.x0+e.w/2,y:e.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=_.draw(r,"b"+n,{propContainer:o,propName:e.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:e.x0-u,y:e.y0+e.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=_.draw(r,"c"+n,{propContainer:l,propName:e.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:e.x0+e.w+u,y:e.y0+e.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},S.drawAx=function(t){var e,r=this,n=r.graphDiv,i=t._name,o=i.charAt(0),s=t._id,l=r.layers[i],c=o+"tickLayout",u=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);r[c]!==u&&(l.selectAll("."+s+"tick").remove(),r[c]=u),t.setScale();var h=p.calcTicks(t),f=p.clipEnds(t,h),d=p.makeTransTickFn(t),m=p.getTickSigns(t)[2],g=a.deg2rad(30),y=m*(t.linewidth||1)/2,v=m*t.ticklen,x=r.w,_=r.h,b="b"===o?"M0,"+y+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+y+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,w={a:"M0,0l"+_+",-"+x/2,b:"M0,0l-"+x/2+",-"+_,c:"M0,0l-"+_+","+x/2}[o];p.drawTicks(n,t,{vals:"inside"===t.ticks?f:h,layer:l,path:b,transFn:d,crisp:!1}),p.drawGrid(n,t,{vals:f,layer:r.layers[o+"grid"],path:w,transFn:d,crisp:!1}),p.drawLabels(n,t,{vals:h,layer:l,transFn:d,labelFns:p.makeLabelFns(t,0,30)})};var C=A.MINZOOM/2+.87,I="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",P="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function R(t){r.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,u,h,f,p,g,v,_,T,k,M=this,S=M.layers.plotbg.select("path").node(),C=M.graphDiv,D=C._fullLayout._zoomlayer;function O(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=C._fullLayout.clickmode;R(C),2===t&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,O({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,C,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&m.click(C,e,M.id)}function j(t,e){return 1-e/M.h}function B(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function N(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(n,i){var a=r+n*t,o=u+i*e,s=Math.max(0,Math.min(1,j(0,u),j(0,o))),l=Math.max(0,Math.min(1,B(r,u),B(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),d=(s/2+c)*M.w,m=(1-s/2-l)*M.w,y=(d+m)/2,x=m-d,b=(1-s)*M.h,w=b-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),_=!0),C.emit("plotly_relayouting",O(p))}function V(){R(C),p!==h&&(i.call("_guiRelayout",C,O(p)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long"),z=!1))}function q(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(p={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,p.b,p.c].sort(a.sorterAsc),s=i.indexOf(p.a),l=i.indexOf(p.b),u=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[s],b:i[l],c:i[u]},e=(h.a-p.a)*M.yaxis._m,t=(h.c-p.c-h.b+p.b)*M.xaxis._m);var f=o(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",f);var d=o(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,M),C.emit("plotly_relayouting",O(p))}function H(){i.call("_guiRelayout",C,O(p))}this.dragOptions={element:S,gd:C,plotinfo:{id:M.id,domain:C._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(i,s,c){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=C._fullLayout._invScaleX,e=C._fullLayout._invScaleY;var d=M.dragOptions.dragmode=C._fullLayout.dragmode;y(d)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===d?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,i){var s=S.getBoundingClientRect();r=e-s.left,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,d=a.apply3DTransform(c)(r,u);r=d[0],u=d[1],h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,f=M.aaxis.range[1]-h.a,g=n(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),v="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",_=!1,T=D.append("path").attr("class","zoombox").attr("transform",o(M.x0,M.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=D.append("path").attr("class","zoombox-corners").attr("transform",o(M.x0,M.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(C)}(0,s,c)):"pan"===d?(M.dragOptions.moveFn=q,M.dragOptions.clickFn=F,M.dragOptions.doneFn=H,h={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=h,M.clearOutline(C)):(x(d)||y(d))&&b(i,s,c,M.dragOptions,d)}},S.onmousemove=function(t){m.hover(C,t,M.id),C._fullLayout._lasthover=S,C._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){C._dragging||d.unhover(C,t)},d.init(this.dragOptions)}}}),Vs=f({"src/plots/ternary/layout_attributes.js"(t,e){var r=V(),n=Ta().attributes,i=Ce(),a=Lt().overrideAll,o=O().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=e.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),qs=f({"src/plots/subplot_defaults.js"(t,e){var r=se(),n=ge(),i=Ta().defaults;e.exports=function(t,e,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,f=o.partition||"x",p=e._subplots[c],d=p.length,m=d&&p[0].replace(/\d+$/,"");function g(t,e){return r.coerce(s,l,u,t,e)}for(var y=0;y=u&&(p.min=0,m.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function d(t,e,r,n){var a=h[e._name];function f(r,n){return i.coerce(t,e,a,r,n)}f("uirevision",n.uirevision),e.type="linear";var p=f("color"),d=p!==a.color.dflt?p:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=f("title.text",g);e._hovertitle=y===g?y:m,i.coerceFont(f,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:d}}),f("min"),c(t,e,f,"linear"),s(t,e,f,"linear"),o(t,e,f,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(t,e,f,{outerTicks:!0}),f("showticklabels")&&(i.coerceFont(f,"tickfont",r.font,{overrideDflt:{color:d}}),f("tickangle"),f("tickformat")),u(t,e,f,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),f("hoverformat"),f("layer")}e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:h,handleDefaults:p,font:e.font,paper_bgcolor:e.paper_bgcolor})}}}),Gs=f({"src/plots/ternary/index.js"(t){var e=Us(),r=be().getSubplotCalcData,n=se().counterRegex,i="ternary";t.name=i;var a=t.attr="subplot";t.idRoot=i,t.idRegex=t.attrRegex=n(i),(t.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},t.layoutAttributes=Vs(),t.supplyLayoutDefaults=Hs(),t.plot=function(t){for(var n=t._fullLayout,a=t.calcdata,o=n._subplots[i],s=0;s0){var _,b,w,T,k,A=t.xa,M=t.ya;"h"===d.orientation?(k=e,_="y",w=M,b="x",T=A):(k=s,_="x",w=A,b="y",T=M);var S=p[t.index];if(k>=S.span[0]&&k<=S.span[1]){var E=n.extendFlat({},t),C=T.c2p(k,!0),I=o.getKdeValue(S,d,k),L=o.getPositionOnKdePath(S,d,C),P=w._offset,z=w._length;E[_+"0"]=L[0],E[_+"1"]=L[1],E[b+"0"]=E[b+"1"]=C,E[b+"Label"]=b+": "+i.hoverLabelText(T,k,d[b+"hoverformat"])+", "+p[0].t.labels.kde+" "+I.toFixed(3);for(var D=0,O=0;O path").each((function(t){if(!t.isBlank){var e=s.marker;r.select(this).call(i.fill,t.mc||e.color).call(i.stroke,t.mlc||e.line.color).call(n.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),yl=f({"src/traces/funnel/hover.js"(t,e){var r=q().opacity,n=eo().hoverOnBars,i=se().formatPercent;e.exports=function(t,e,a,o,s){var l=n(t,e,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,f=c[l.index];l[(h?"x":"y")+"LabelVal"]=f.s,l.percentInitial=f.begR,l.percentInitialLabel=i(f.begR,1),l.percentPrevious=f.difR,l.percentPreviousLabel=i(f.difR,1),l.percentTotal=f.sumR,l.percentTotalLabel=i(f.sumR,1);var p=f.hi||u.hoverinfo,d=[];if(p&&"none"!==p&&"skip"!==p){var m="all"===p,g=p.split("+"),y=function(t){return m||-1!==g.indexOf(t)};y("percent initial")&&d.push(l.percentInitialLabel+" of initial"),y("percent previous")&&d.push(l.percentPreviousLabel+" of previous"),y("percent total")&&d.push(l.percentTotalLabel+" of total")}return l.extraText=d.join("
"),l.color=function(t,e){var n=t.marker,i=e.mc||n.color,a=e.mlc||n.line.color,o=e.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,f),[l]}}}}),vl=f({"src/traces/funnel/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"percentInitial"in e&&(t.percentInitial=e.percentInitial),"percentPrevious"in e&&(t.percentPrevious=e.percentPrevious),"percentTotal"in e&&(t.percentTotal=e.percentTotal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),xl=f({"src/traces/funnel/index.js"(t,e){e.exports={attributes:sl(),layoutAttributes:ll(),supplyDefaults:cl().supplyDefaults,crossTraceDefaults:cl().crossTraceDefaults,supplyLayoutDefaults:ul(),calc:fl(),crossTraceCalc:pl(),plot:dl(),style:ml().style,hoverPoints:yl(),eventData:vl(),selectPoints:no(),moduleType:"trace",name:"funnel",basePlotModule:Mi(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),_l=f({"lib/funnel.js"(t,e){e.exports=xl()}}),bl=f({"src/traces/waterfall/constants.js"(t,e){e.exports={eventDataKeys:["initial","delta","final"]}}}),wl=f({"src/traces/waterfall/attributes.js"(t,e){var r=Ha(),n=wn().line,i=N(),a=Ee().axisHoverFormat,o=Dt().hovertemplateAttrs,s=Dt().texttemplateAttrs,l=bl(),c=O().extendFlat,u=q();function h(t){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}e.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),Tl=f({"src/traces/waterfall/layout_attributes.js"(t,e){e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),kl=f({"src/constants/delta.js"(t,e){e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Al=f({"src/traces/waterfall/defaults.js"(t,e){var r=se(),n=Kn(),i=Wa().handleText,a=qn(),o=Hn(),s=wl(),l=q(),c=kl(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function f(t,e,r){t(e+".marker.color",r),t(e+".marker.line.color",l.defaultLine),t(e+".marker.line.width")}e.exports={supplyDefaults:function(t,e,n,l){function c(n,i){return r.coerce(t,e,s,n,i)}if(a(t,e,l,c)){o(t,e,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var p=c("textposition");i(t,e,l,c,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==e.textposition&&(c("texttemplate"),e.texttemplate||c("textinfo")),f(c,"increasing",u),f(c,"decreasing",h),f(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else e.visible=!1},crossTraceDefaults:function(t,e){var i,a;function o(t){return r.coerce(a._input,a,s,t)}if("group"===e.waterfallmode)for(var l=0;l0&&(g+=f?"M"+h[0]+","+d[1]+"V"+d[0]:"M"+h[1]+","+d[0]+"H"+h[0]),"between"!==p&&(o.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;r.select(this).call(i.fill,e.color).call(i.stroke,e.line.color).call(n.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?a:1)}})),l(o,s,t),o.selectAll(".lines").each((function(){var t=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}}}),Ll=f({"src/traces/waterfall/hover.js"(t,e){var r=nr().hoverLabelText,n=q().opacity,i=eo().hoverOnBars,a=kl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;e.exports=function(t,e,a,l,c){var u=i(t,e,a,l,c);if(u){var h=u.cd,f=h[0].trace,p="h"===f.orientation,d=p?"x":"y",m=p?t.xa:t.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=k(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=k(u.final),u.initialLabel=k(u.initial);var x=g.hi||f.hoverinfo,_=[];if(x&&"none"!==x&&"skip"!==x){var b="all"===x,w=x.split("+"),T=function(t){return b||-1!==w.indexOf(t)};g.isSum||(!T("final")||T(p?"x":"y")||_.push(u.finalLabel),T("delta")&&(y<0?_.push(u.deltaLabel+" "+s):_.push(u.deltaLabel+" "+o)),T("initial")&&_.push("Initial: "+u.initialLabel))}return _.length&&(u.extraText=_.join("
")),u.color=function(t,e){var r=t[e.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(f,g),[u]}function k(t){return r(m,t,f[d+"hoverformat"])}}}}),Pl=f({"src/traces/waterfall/event_data.js"(t,e){e.exports=function(t,e){return t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,"initial"in e&&(t.initial=e.initial),"delta"in e&&(t.delta=e.delta),"final"in e&&(t.final=e.final),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t}}}),zl=f({"src/traces/waterfall/index.js"(t,e){e.exports={attributes:wl(),layoutAttributes:Tl(),supplyDefaults:Al().supplyDefaults,crossTraceDefaults:Al().crossTraceDefaults,supplyLayoutDefaults:Ml(),calc:Sl(),crossTraceCalc:El(),plot:Cl(),style:Il().style,hoverPoints:Ll(),eventData:Pl(),selectPoints:no(),moduleType:"trace",name:"waterfall",basePlotModule:Mi(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Dl=f({"lib/waterfall.js"(t,e){e.exports=zl()}}),Ol=f({"src/traces/image/constants.js"(t,e){e.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var e=t.slice(0,3);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var e=t.slice(0,4);return e[1]=e[1]+"%",e[2]=e[2]+"%",e},suffix:["°","%","%",""]}}}}}),Rl=f({"src/traces/image/attributes.js"(t,e){var r,n,i=N(),a=wn().zorder,o=Dt().hovertemplateAttrs,s=O().extendFlat,l=Ol().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n0?s-4:s;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},t.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,l=0,c=n-i;lc?c:l+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};var e,r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0;e<64;++e)r[e]=a[e],n[a.charCodeAt(e)]=e;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,n){for(var i,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),Ul=f({"node_modules/ieee754/index.js"(t){t.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}}}),Vl=f({"node_modules/buffer/index.js"(t){var e=Nl(),r=Ul(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);const i=function(t){if(o.isBuffer(t)){const e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return l(t),a(t<0?0:0|f(t))}function u(t){const e=t.length<0?0:0|f(t.length),r=a(e);for(let n=0;n=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:H(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){let a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=e.length;let o;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function T(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function k(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:e<128&&(a=e);break;case 2:r=t[i+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(a=l));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(e+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(W(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const l=Math.min(a,s),c=this.slice(n,i),u=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function M(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function z(t,e,r,n,i){N(e,n,i,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function D(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,n,i,a){return e=+e,n>>>=0,a||D(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function R(t,e,n,i,a){return e=+e,n>>>=0,a||D(t,0,n,8),r.write(t,e,n,i,52,8),n+8}o.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=$((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=e,i=1,a=this[t+--n];for(;n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=$((function(t){U(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||I(t,4,this.length),r.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),r.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),r.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||L(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=$((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=$((function(t,e=0){return z(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=0,a=1,o=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/a|0)-o&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=$((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=$((function(t,e=0){return z(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function N(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){U(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||V(e,t.length-(r+1))}(n,i,a)}function U(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){if(Math.floor(t)!==t)throw U(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=B(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(t,e){let r;e=e||1/0;const n=t.length;let i=null;const a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}var X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function $(t){return"undefined"==typeof BigInt?J:t}function J(){throw new Error("BigInt not supported")}}}),ql=f({"node_modules/has-symbols/shams.js"(t,e){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}}}),Hl=f({"node_modules/has-tostringtag/shams.js"(t,e){var r=ql();e.exports=function(){return r()&&!!Symbol.toStringTag}}}),Gl=f({"node_modules/es-errors/index.js"(t,e){e.exports=Error}}),Zl=f({"node_modules/es-errors/eval.js"(t,e){e.exports=EvalError}}),Wl=f({"node_modules/es-errors/range.js"(t,e){e.exports=RangeError}}),Yl=f({"node_modules/es-errors/ref.js"(t,e){e.exports=ReferenceError}}),Xl=f({"node_modules/es-errors/syntax.js"(t,e){e.exports=SyntaxError}}),$l=f({"node_modules/es-errors/type.js"(t,e){e.exports=TypeError}}),Jl=f({"node_modules/es-errors/uri.js"(t,e){e.exports=URIError}}),Kl=f({"node_modules/has-symbols/index.js"(t,e){var r="undefined"!=typeof Symbol&&Symbol,n=ql();e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&n()}}}),Ql=f({"node_modules/has-proto/index.js"(t,e){var r={foo:{}},n=Object;e.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}}),tc=f({"node_modules/function-bind/implementation.js"(t,e){var r=Object.prototype.toString,n=Math.max,i=function(t,e){for(var r=[],n=0;n1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=C(t,0,1),r=C(t,-1);if("%"===e&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return E(t,L,(function(t,e,r,i){n[n.length]=r?E(i,P,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=z("%"+n+"%",e),a=i.name,o=i.value,c=!1,u=i.alias;u&&(n=u[0],S(r,M([0,1],u)));for(var h=1,p=!0;h=r.length){var y=f(o,d);o=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[d]}else p=A(o,d),o=o[d];p&&!c&&(b[a]=o)}}return o}}}),ic=f({"node_modules/es-define-property/index.js"(t,e){var r=nc()("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(t){r=!1}e.exports=r}}),ac=f({"node_modules/gopd/index.js"(t,e){var r=nc()("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(t){r=null}e.exports=r}}),oc=f({"node_modules/define-data-property/index.js"(t,e){var r=ic(),n=Xl(),i=$l(),a=ac();e.exports=function(t,e,o){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=o}}}}),sc=f({"node_modules/has-property-descriptors/index.js"(t,e){var r=ic(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(t){return!0}},e.exports=n}}),lc=f({"node_modules/set-function-length/index.js"(t,e){var r=nc(),n=oc(),i=sc()(),a=ac(),o=$l(),s=r("%Math.floor%");e.exports=function(t,e){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||s(e)!==e)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(t,"length",e,!0,!0):n(t,"length",e)),t}}}),cc=f({"node_modules/call-bind/index.js"(t,e){var r=ec(),n=nc(),i=lc(),a=$l(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=ic(),u=n("%Math.max%");e.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=l(r,s,arguments);return i(e,1+u(0,t.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h}}),uc=f({"node_modules/call-bind/callBound.js"(t,e){var r=nc(),n=cc(),i=n(r("String.prototype.indexOf"));e.exports=function(t,e){var a=r(t,!!e);return"function"==typeof a&&i(t,".prototype.")>-1?n(a):a}}}),hc=f({"node_modules/is-arguments/index.js"(t,e){var r=Hl()(),n=uc()("Object.prototype.toString"),i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===n(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"[object Function]"===n(t.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=o?i:a}}),fc=f({"node_modules/is-generator-function/index.js"(t,e){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Hl()(),s=Object.getPrototypeOf;e.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(t);if(!s)return!1;if(void 0===r){var e=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&s(e)}return s(t)===r}}}),pc=f({"node_modules/is-callable/index.js"(t,e){var r,n,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(t){t!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(t){try{var e=i.call(t);return s.test(e)}catch(t){return!1}},c=function(t){try{return!l(t)&&(i.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};"object"==typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(p=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})),e.exports=a?function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{a(t,null,r)}catch(t){if(t!==n)return!1}return!l(t)&&c(t)}:function(t){if(p(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(h)return c(t);if(l(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&c(t)}}}),dc=f({"node_modules/for-each/index.js"(t,e){var r=pc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(t,e,a){if(!r(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(t)?function(t,e,r){for(var n=0,a=t.length;n-1?e:"Object"===e&&function(t){var e=!1;return r(d,(function(r,n){if(!e)try{r(t),e=h(n,1)}catch(t){}})),e}(t)}return o?function(t){var e=!1;return r(d,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=h(n,1))}catch(t){}})),e}(t):null}}}),yc=f({"node_modules/is-typed-array/index.js"(t,e){var r=dc(),n=mc(),i=uc(),a=i("Object.prototype.toString"),o=Hl()(),s=ac(),l="undefined"==typeof globalThis?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!s&&function(t){var e=!1;return r(f,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}}}),vc=f({"node_modules/util/support/types.js"(t){var e=hc(),r=fc(),n=gc(),i=yc();function a(t){return t.call.bind(t)}var o,s,l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);function d(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function m(t){return"[object Map]"===u(t)}function g(t){return"[object Set]"===u(t)}function y(t){return"[object WeakMap]"===u(t)}function v(t){return"[object WeakSet]"===u(t)}function x(t){return"[object ArrayBuffer]"===u(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function b(t){return"[object DataView]"===u(t)}function w(t){return"undefined"!=typeof DataView&&(b.working?b(t):t instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),t.isArgumentsObject=e,t.isGeneratorFunction=r,t.isTypedArray=i,t.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):i(t)||w(t)},t.isUint8Array=function(t){return"Uint8Array"===n(t)},t.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===n(t)},t.isUint16Array=function(t){return"Uint16Array"===n(t)},t.isUint32Array=function(t){return"Uint32Array"===n(t)},t.isInt8Array=function(t){return"Int8Array"===n(t)},t.isInt16Array=function(t){return"Int16Array"===n(t)},t.isInt32Array=function(t){return"Int32Array"===n(t)},t.isFloat32Array=function(t){return"Float32Array"===n(t)},t.isFloat64Array=function(t){return"Float64Array"===n(t)},t.isBigInt64Array=function(t){return"BigInt64Array"===n(t)},t.isBigUint64Array=function(t){return"BigUint64Array"===n(t)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(t){return"undefined"!=typeof Set&&(g.working?g(t):t instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),t.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(y.working?y(t):t instanceof WeakMap)},v.working="undefined"!=typeof WeakSet&&v(new WeakSet),t.isWeakSet=function(t){return v(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,b.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&b(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(t){return"[object SharedArrayBuffer]"===u(t)}function A(t){return void 0!==T&&(void 0===k.working&&(k.working=k(new T)),k.working?k(t):t instanceof T)}function M(t){return d(t,h)}function S(t){return d(t,f)}function E(t){return d(t,p)}function C(t){return l&&d(t,o)}function I(t){return c&&d(t,s)}t.isSharedArrayBuffer=A,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},t.isGeneratorObject=function(t){return"[object Generator]"===u(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},t.isNumberObject=M,t.isStringObject=S,t.isBooleanObject=E,t.isBigIntObject=C,t.isSymbolObject=I,t.isBoxedPrimitive=function(t){return M(t)||S(t)||E(t)||C(t)||I(t)},t.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||A(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))}}),xc=f({"node_modules/util/support/isBufferBrowser.js"(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}}),_c=f({"(disabled):node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}})),l=i[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function c(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return u(r)}var x,T="",k=!1,A=["{","}"];return f(r)&&(k=!0,A=["[","]"]),w(r)&&(T=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(T=" "+RegExp.prototype.toString.call(r)),_(r)&&(T=" "+Date.prototype.toUTCString.call(r)),b(r)&&(T=" "+u(r)),0!==o.length||k&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,T,A)):A[0]+T+A[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=d(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function d(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function b(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=vc(),t.isArray=f,t.isBoolean=p,t.isNull=d,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=_,t.types.isDate=_,t.isError=b,t.types.isNativeError=b,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},t.isBuffer=xc();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(S&&t[S]){var r;if("function"!=typeof(r=t[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:s,value:function(t,e){return o(this,function(t){for(var e=1;e2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,a,o,s;if("string"==typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(i(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(i(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r}}),kc=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(t,e){var r=Tc().codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,n,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}}}),Ac=f({"node_modules/util-deprecate/browser.js"(t,e){function r(t){try{if(!window.localStorage)return!1}catch(t){return!1}var e=window.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}}),Mc=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(t,e){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var n;e.exports=T,T.WritableState=w;var i,a={deprecate:Ac()},o=Bl(),s=Vl().Buffer,l=window.Uint8Array||function(){},c=wc(),u=kc().getHighWaterMark,h=Tc().codes,f=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,d=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function b(){}function w(t,e,i){n=n||Sc(),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=u(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new d;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(C,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),C(t,e))}(t,r,n,e,i);else{var a=S(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),n?process.nextTick(A,t,r,a,i):A(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function T(t){var e=this instanceof(n=n||Sc());if(!e&&!i.call(T,this))return new T(t);this._writableState=new w(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function k(t,e,r,n,i,a,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):r?t._writev(i,e.onwrite):t._write(i,a,e.onwrite),e.sync=!1}function A(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),C(t,e)}function M(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,a=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,k(t,e,!0,e.length,a,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(k(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),C(t,e)}))}function C(t,e){var r=S(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(E,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}jl()(T,o),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!i.call(this,t)||this===T&&t&&t._writableState instanceof w}})):i=function(t){return t instanceof this},T.prototype.pipe=function(){_(this,new m)},T.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,o=!i.objectMode&&(n=t,s.isBuffer(n)||n instanceof l);return o&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof e&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ending?function(t,e){var r=new v;_(t,r),process.nextTick(e,r)}(this,r):(o||function(t,e,r,n){var i;return null===r?i=new y:"string"==typeof r||e.objectMode||(i=new f("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,a){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=e.objectMode?1:n.length;e.length+=l;var c=e.length-1))throw new x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new p("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,C(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=c.destroy,T.prototype._undestroy=c.undestroy,T.prototype._destroy=function(t,e){e(t)}}}),Sc=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(t,e){var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=l;var n,i,a,o=zc(),s=Mc();for(jl()(l,o),n=r(s.prototype),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}t.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(t.lastNeed=a-1),a):--n=0?(a>0&&(t.lastNeed=a-2),a):--n=0?(a>0&&(2===a?a=0:t.lastNeed=a-3),a):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}}),Ic=f({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(t,e){var r=Tc().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function t(e,i,a){if("function"==typeof i)return t(e,null,i);i||(i={}),a=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i)c.endEmitted?_(t,new x):A(t,c,e,!0);else if(c.ended)_(t,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?A(t,c,e,!1):I(t,c)):A(t,c,e,!1)}else i||(c.reading=!1,I(t,c));return!c.ended&&(c.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;n("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(n("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(C,t))}function C(t){var e=t._readableState;n("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function I(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(L,t,e))}function L(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){n("readable nexttick read 0"),t.read(0)}function D(t,e){n("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(n("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function F(t){var e=t._readableState;n("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function B(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return n("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?F(this):E(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&F(this),null;var i,a=e.needReadable;return n("need readable",a),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&F(this)),null!==i&&this.emit("data",i),i},T.prototype._read=function(t){_(this,new v("_read()"))},T.prototype.pipe=function(t,e){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,e);var o=e&&!1===e.end||t===process.stdout||t===process.stderr?m:l;function s(e,i){n("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),u=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function l(){n("onend"),t.end()}a.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;n("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,O(t))}}(r);t.on("drain",c);var u=!1;function h(e){n("ondata");var i=t.write(e);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==B(a.pipes,t))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function f(e){n("onerror",e),m(),t.removeListener("error",f),0===i(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),m()}function d(){n("onfinish"),t.removeListener("close",p),m()}function m(){n("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",f),t.once("close",p),t.once("finish",d),t.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?E(this):i.reading||process.nextTick(z,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(P,this),r},T.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(P,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(n("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(D,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var a in t.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||(r.objectMode||a&&a.length)&&(e.push(a)||(i=!0,t.pause()))})),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function(e){return function(){return t[e].apply(t,arguments)}}(a));for(var o=0;o0,(function(t){c||(c=t),t&&h.forEach(s),i||(h.forEach(s),u(c))}))}));return e.reduce(l)}}}),Fc=f({"node_modules/stream-browserify/index.js"(t,e){e.exports=n;var r=he().EventEmitter;function n(){r.call(this)}jl()(n,r),n.Readable=zc(),n.Writable=Mc(),n.Duplex=Sc(),n.Transform=Dc(),n.PassThrough=Oc(),n.finished=Ic(),n.pipeline=Rc(),n.Stream=n,n.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",a),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(u(),0===r.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",c),t.on("error",c),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t}}}),jc=f({"node_modules/util/util.js"(t){var e=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=a)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}})),l=i[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,e,n.depth)}function s(t,e){var r=o.styles[e];return r?"["+o.colors[r][0]+"m"+t+"["+o.colors[r][1]+"m":t}function l(t,e){return t}function c(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var a=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):d(e)?t.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),b(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(b(r))return u(r)}var x,T="",k=!1,A=["{","}"];return f(r)&&(k=!0,A=["[","]"]),w(r)&&(T=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(T=" "+RegExp.prototype.toString.call(r)),_(r)&&(T=" "+Date.prototype.toUTCString.call(r)),b(r)&&(T=" "+u(r)),0!==o.length||k&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),x=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(x,T,A)):A[0]+T+A[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=d(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function d(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function b(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=vc(),t.isArray=f,t.isBoolean=p,t.isNull=d,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=_,t.types.isDate=_,t.isError=b,t.types.isNativeError=b,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},t.isBuffer=xc();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=jl(),t._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}t.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(S&&t[S]){var r;if("function"!=typeof(r=t[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,S,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],a=0;a2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,a,o,l;if(void 0===s&&(s=ru()),s("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))l="The ".concat(t," ").concat(i," ").concat(h(e,"type"));else{var c=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";l='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(h(e,"type"))}return l+=". Received type ".concat(r(n))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=jc());var n=l.inspect(e);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(t,e,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),r=0;r0,"At least one arg needs to be specified");var n="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:n+="".concat(e[0]," argument");break;case 2:n+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:n+=e.slice(0,i-1).join(", "),n+=", and ".concat(e[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),e.exports.codes=c}}),Nc=f({"node_modules/assert/build/internal/assert/assertion_error.js"(t,e){function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;et.length)&&(r=t.length),t.substring(r-e.length,r)===e}var y="",v="",x="",_="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function T(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function k(t,e,r){var n="",i="",a=0,o="",s=!1,l=T(t),c=l.split("\n"),u=T(e).split("\n"),h=0,f="";if("strictEqual"===r&&"object"===p(t)&&"object"===p(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var d=c[0].length+u[0].length;if(d<=10){if(!("object"===p(t)&&null!==t||"object"===p(e)&&null!==e||0===t&&0===e))return"".concat(b[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&d<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][h]===u[0][h];)h++;h>2&&(f="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",h),"^"),h=0)}}for(var m=c[c.length-1],w=u[u.length-1];m===w&&(h++<2?o="\n ".concat(m).concat(o):n=m,c.pop(),u.pop(),0!==c.length&&0!==u.length);)m=c[c.length-1],w=u[u.length-1];var k=Math.max(c.length,u.length);if(0===k){var A=l.split("\n");if(A.length>30)for(A[26]="".concat(y,"...").concat(_);A.length>27;)A.pop();return"".concat(b.notIdentical,"\n\n").concat(A.join("\n"),"\n")}h>3&&(o="\n".concat(y,"...").concat(_).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var M=0,S=b[r]+"\n".concat(v,"+ actual").concat(_," ").concat(x,"- expected").concat(_),E=" ".concat(y,"...").concat(_," Lines skipped");for(h=0;h1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(_),s=!0):C>3&&(i+="\n ".concat(u[h-2]),M++),i+="\n ".concat(u[h-1]),M++),a=h,n+="\n".concat(x,"-").concat(_," ").concat(u[h]),M++;else if(u.length1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(_),s=!0):C>3&&(i+="\n ".concat(c[h-2]),M++),i+="\n ".concat(c[h-1]),M++),a=h,i+="\n".concat(v,"+").concat(_," ").concat(c[h]),M++;else{var I=u[h],L=c[h],P=L!==I&&(!g(L,",")||L.slice(0,-1)!==I);P&&g(I,",")&&I.slice(0,-1)===L&&(P=!1,L+=","),P?(C>1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(_),s=!0):C>3&&(i+="\n ".concat(c[h-2]),M++),i+="\n ".concat(c[h-1]),M++),a=h,i+="\n".concat(v,"+").concat(_," ").concat(L),n+="\n".concat(x,"-").concat(_," ").concat(I),M+=2):(i+=n,n="",1!==C&&0!==h||(i+="\n ".concat(L),M++))}if(M>20&&h30)for(h[26]="".concat(y,"...").concat(_);h.length>27;)h.pop();e=1===h.length?A.call(this,"".concat(u," ").concat(h[0])):A.call(this,"".concat(u,"\n\n").concat(h.join("\n"),"\n"))}else{var f=T(a),d="",g=b[n];"notDeepEqual"===n||"notEqual"===n?(f="".concat(b[n],"\n\n").concat(f)).length>1024&&(f="".concat(f.slice(0,1021),"...")):(d="".concat(T(l)),f.length>512&&(f="".concat(f.slice(0,509),"...")),d.length>512&&(d="".concat(d.slice(0,509),"...")),"deepEqual"===n||"equal"===n?f="".concat(g,"\n\n").concat(f,"\n\nshould equal\n\n"):d=" ".concat(n," ").concat(d)),e=A.call(this,"".concat(f).concat(d))}return Error.stackTraceLimit=c,e.generatedMessage=!r,Object.defineProperty(s(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=l,e.operator=n,Error.captureStackTrace&&Error.captureStackTrace(s(e),i),e.stack,e.name="AssertionError",o(e)}return l=M,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return d(this,n(n({},e),{},{customInspect:!1,depth:0}))}}])&&i(l.prototype,c),g&&i(l,g),Object.defineProperty(l,"prototype",{writable:!1}),M}(l(Error),d.custom);e.exports=A}}),Uc=f({"node_modules/object-keys/isArguments.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}}}),Vc=f({"node_modules/object-keys/implementation.js"(t,e){var r,n,i,a,o,s,l,c,u,h,f,p;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Uc(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),p=function(t){if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(t){return!1}},r=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),u=e&&"[object String]"===i.call(t),h=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var f=l&&r;if(u&&t.length>0&&!n.call(t,0))for(var d=0;d0)for(var m=0;m2?arguments[2]:{},o=r(e);n&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;st.length)&&(e=t.length);for(var r=0,n=new Array(e);r10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function P(t){return Object.keys(t).filter(L).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function z(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i0)return function(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===c&&!1===isNaN(t))return e.long?s(l=t,a,"day")||s(l,i,"hour")||s(l,n,"minute")||s(l,r,"second")||l+" ms":function(t){return t>=a?Math.round(t/a)+"d":t>=i?Math.round(t/i)+"h":t>=n?Math.round(t/n)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}}),iu=f({"node_modules/stream-parser/node_modules/debug/src/debug.js"(t,e){var r;function n(e){function n(){if(n.enabled){var e=n,i=+new Date,a=i-(r||i);e.diff=a,e.prev=r,e.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(r())}}),ou=f({"node_modules/stream-parser/index.js"(t,e){var r=ru(),n=au()("stream-parser");function i(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function a(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||i(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function s(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||i(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function l(t,e,r){this._parserInit||i(this),n("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function c(t,e,r){this._parserInit||i(this),n("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function u(t,e,r,i){if(t._parserBytesLeft-=e.length,n("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return i;var a=t._parserCallback;if(a&&0===t._parserState&&t._parserBuffers.length>1&&(e=Buffer.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),a){var o=[];e&&o.push(e),r&&o.push(r);var s=a.length>o.length;s&&o.push(f(i));var l=a.apply(t,o);if(!s||i===l)return i}}e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),t._bytes=a,t._skipBytes=o,e&&(t._passthrough=s),e?t._transform=c:t._write=l};var h=f((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return u(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return u(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function f(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}}),su=f({"node_modules/probe-image-size/lib/common.js"(t){var e=Fc().Transform,r=ou();function n(){e.call(this,{readableObjectMode:!0})}function i(t,e,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=t,e&&(this.code=e),r&&(this.statusCode=r)}n.prototype=Object.create(e.prototype),n.prototype.constructor=n,r(n.prototype),t.ParserStream=n,t.sliceEq=function(t,e,r){for(var n=e,i=0;i>4&15,i=15&t[4],a=t[5]>>4&15,s=r(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),a=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),u=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(u=0===t.value?r[u]:e[u=e[u=r[u]]]),"irot"===t.type)for(var n=0;n0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},i.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},i.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},i.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},i.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));default:return null}},i.prototype.scan_ifd=function(t,e,i){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw r("unexpected EOF","EBADDATA");for(var d=[],m=f,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:h,data_offset:f+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=i,e.exports.get_orientation=function(t){var e=0;try{return new i(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}}}),uu=f({"node_modules/probe-image-size/lib/parse_sync/avif.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=lu(),o=cu(),s=r("ftyp");e.exports=function(t){if(n(t,4,s)){var e=a.unbox(t,0);if(e){var r=a.getMimeType(e.data);if(r){for(var l,c=e.end;;){var u=a.unbox(t,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var f={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(f.variants=h.variants),h.orientation&&(f.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=t.length){var p=i(t,h.exif_location.offset),d=t.slice(h.exif_location.offset+p+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(d);m>0&&(f.orientation=m)}return f}}}}}}}}),hu=f({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("BM");e.exports=function(t){if(!(t.length<26)&&n(t,0,a))return{width:i(t,18),height:i(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),fu=f({"node_modules/probe-image-size/lib/parse_sync/gif.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");e.exports=function(t){if(!(t.length<10)&&(n(t,0,a)||n(t,0,o)))return{width:i(t,6),height:i(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),pu=f({"node_modules/probe-image-size/lib/parse_sync/ico.js"(t,e){var r=su().readUInt16LE;e.exports=function(t){var e=r(t,0),n=r(t,2),i=r(t,4);if(0===e&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),du=f({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(t,e){var r=su().readUInt16BE,n=su().str2arr,i=su().sliceEq,a=cu(),o=n("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var n,s,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)n=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;n=r(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&n>=10&&i(t,e,o)&&(s=a.get_orientation(t.slice(e+6,e+n))),n>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=s),c}e+=n}}}}),mu=f({"node_modules/probe-image-size/lib/parse_sync/png.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("‰PNG\r\n\n"),o=r("IHDR");e.exports=function(t){if(!(t.length<24)&&n(t,0,a)&&n(t,12,o))return{width:i(t,16),height:i(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gu=f({"node_modules/probe-image-size/lib/parse_sync/psd.js"(t,e){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("8BPS\0");e.exports=function(t){if(!(t.length<22)&&n(t,0,a))return{width:i(t,18),height:i(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),yu=f({"node_modules/probe-image-size/lib/parse_sync/svg.js"(t,e){function r(t){return"number"==typeof t&&isFinite(t)&&t>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(t){return l.test(t)?t.match(l)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||c(t,e+8):"VP8L"===p&&d>=9?r=r||u(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(i=o.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return i>0&&(r.orientation=i),r}}}}}),_u=f({"node_modules/probe-image-size/lib/parsers_sync.js"(t,e){e.exports={avif:uu(),bmp:hu(),gif:fu(),ico:pu(),jpeg:du(),png:mu(),psd:gu(),svg:yu(),tiff:vu(),webp:xu()}}}),bu=f({"node_modules/probe-image-size/sync.js"(t,e){var r=_u();e.exports=function(t){return function(t){for(var e=Object.keys(r),n=0;n0;)g=h.c2p(w+_*M),_--;for(_=0;void 0===v&&_0;)x=f.c2p(T+_*S),_--;gz[0];if(D||O){var R=m+E/2,F=v+C/2;L+="transform:"+i(R+"px",F+"px")+"scale("+(D?-1:1)+","+(O?-1:1)+")"+i(-R+"px",-F+"px")+";"}}I.attr("style",L);var j=new Promise((function(t){if(u._hasZ)t();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===k&&u._canvas.el.height===A&&u._canvas.source===u.source)t();else{var e=document.createElement("canvas");e.width=k,e.height=A;var r=e.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:e,source:u.source},t()},n.setAttribute("src",u.source)}})).then((function(){var t;if(u._hasZ)t=B((function(t,e){var r=b[e][t];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(d)t=u.source;else{var e=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,k,A).data;t=B((function(t,r){var n=4*(r*k+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}I.attr({"xlink:href":t,height:C,width:E,x:m,y:v})}));t._promises.push(j)}function B(t){var e=document.createElement("canvas");e.width=E,e.height=C;var r,i=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return n.constrain(Math.round(h.c2p(w+t*M)-m),0,E)},s=function(t){return n.constrain(Math.round(f.c2p(T+t*S)-v),0,C)},l=o.colormodel[u.colormodel],p=l.colormodel||u.colormodel,d=l.fmt;for(_=0;_0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,f=Math.floor((e-s.x0)/l.dx),p=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[p][f]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),h){var d,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(d=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,_=x.length,b=l._scaler(h),w=v.suffix,T=[];(l.hovertemplate||d)&&(T.push("["+[b[0]+w[0],b[1]+w[1],b[2]+w[2]].join(", ")),4===_&&T.push(", "+b[3]+w[3]),T.push("]"),T=T.join(""),t.extraText=x.toUpperCase()+": "+T),i(l.hovertext)&&i(l.hovertext[p])?y=l.hovertext[p][f]:i(l.text)&&i(l.text[p])&&(y=l.text[p][f]);var k=u.c2p(s.y0+(p+.5)*l.dy),A=s.x0+(f+.5)*l.dx,M=s.y0+(p+.5)*l.dy,S="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(t,{index:[p,f],x0:c.c2p(s.x0+f*l.dx),x1:c.c2p(s.x0+(f+1)*l.dx),y0:k,y1:k,color:b,xVal:A,xLabelVal:A,yVal:M,yLabelVal:M,zLabelVal:S,text:y,hovertemplateLabels:{zLabel:S,colorLabel:T,"color[0]Label":b[0]+w[0],"color[1]Label":b[1]+w[1],"color[2]Label":b[2]+w[2],"color[3]Label":b[3]+w[3]}})]}}}}}),Su=f({"src/traces/image/event_data.js"(t,e){e.exports=function(t,e){return"xVal"in e&&(t.x=e.xVal),"yVal"in e&&(t.y=e.yVal),e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),t.color=e.color,t.colormodel=e.trace.colormodel,t.z||(t.z=e.color),t}}}),Eu=f({"src/traces/image/index.js"(t,e){e.exports={attributes:Rl(),supplyDefaults:Fl(),calc:Tu(),plot:ku(),style:Au(),hoverPoints:Mu(),eventData:Su(),moduleType:"trace",name:"image",basePlotModule:Mi(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Cu=f({"lib/image.js"(t,e){e.exports=Eu()}}),Iu=f({"src/traces/pie/attributes.js"(t,e){var r=N(),n=Ta().attributes,i=R(),a=V(),o=Dt().hovertemplateAttrs,s=Dt().texttemplateAttrs,l=O().extendFlat,c=Pt().pattern,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Lu=f({"src/traces/pie/defaults.js"(t,e){var r=T(),n=se(),i=Iu(),a=Ta().defaults,o=Wa().handleText,s=se().coercePattern;function l(t,e){var i=n.isArrayOrTypedArray(t),a=n.isArrayOrTypedArray(e),o=Math.min(i?t.length:1/0,a?e.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(t,e,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}e.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(t,e,r,s){function u(r,a){return n.coerce(t,e,i,r,a)}var h=l(u("labels"),u("values")),f=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),f){e._length=f,c(t,e,s,u,!0),u("scalegroup");var p,d=u("text"),m=u("texttemplate");if(m||(p=u("textinfo",n.isArrayOrTypedArray(d)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||p&&"none"!==p){var g=u("textposition");o(t,e,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===p&&u("textposition","none");a(e,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");y||"middle center"!==v||(e.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else e.visible=!1}}}}),Pu=f({"src/traces/pie/layout_attributes.js"(t,e){e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),zu=f({"src/traces/pie/layout_defaults.js"(t,e){var r=se(),n=Pu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("piecolorway",e.colorway),i("extendpiecolors")}}}),Du=f({"src/traces/pie/calc.js"(t,e){var r=T(),n=D(),i=q(),a={};function o(t){return function(e,r){return!!e&&!!(e=n(e)).isValid()&&(e=i.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e)}}function s(t,e){var r,i=JSON.stringify(t),a=e[i];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?y:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u"),name:h.hovertemplate||-1!==f.indexOf("name")?h.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:m.castOption(b.bgcolor,t.pts)||t.color,borderColor:m.castOption(b.bordercolor,t.pts),fontFamily:m.castOption(w.family,t.pts),fontSize:m.castOption(w.size,t.pts),fontColor:m.castOption(w.color,t.pts),nameLength:m.castOption(b.namelength,t.pts),textAlign:m.castOption(b.align,t.pts),hovertemplate:m.castOption(h.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[g(t,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[g(t,h)],event:r.event})}})),t.on("mouseout",(function(t){var n=e._fullLayout,a=e._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(t.originalEvent=r.event,e.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var n=e._fullLayout,a=e._fullData[c.index];e._dragging||!1===n.hovermode||(e._hoverdata=[g(t,a)],i.click(e,r.event))}))}function _(t,e,r){var n=m.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=m.castOption(t._input.textfont.color,e.pts));var i=m.castOption(t.insidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,o=m.castOption(t.insidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,s=m.castOption(t.insidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,l=m.castOption(t.insidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,c=m.castOption(t.insidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,u=m.castOption(t.insidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,h=m.castOption(t.insidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,f=m.castOption(t.insidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n||a.contrast(e.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:f}}function b(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||p){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||h){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||f)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,_=0,b=0;b=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:A(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*d);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:A(a,o/e),rotate:M(i+Math.PI/2)}}function A(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function C(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function I(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),h=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(h+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?h*=2:-1!==a.title.position.indexOf("right")&&(h+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=h/t.titleBox.width,n=L(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(t,e){var r=t.trace,n=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function P(t){var e,r=t.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function z(t,e){for(var r=[],n=0;n1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(o){var _=s.castOption(a,e.i,"texttemplate");if(_){var b={label:(n=e).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,e.pts);(y(w)||""===w)&&(b.text=w),e.text=s.texttemplateString(_,b,t._fullLayout._d3locale,b,a._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var i=t._context.staticPlot,h=t._fullLayout,d=h._size;p("pie",h),b(e,t),z(e,d);var g=s.makeTraceGroups(h._pielayer,e,"trace").each((function(e){var p=r.select(this),g=e[0],y=g.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),p.attr("stroke-linejoin","round"),p.each((function(){var v=r.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var b=[[[],[]],[[],[]]],T=!1;v.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,b[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,p=r.select(this),d=p.selectAll("path.surface").data([n]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),p.call(x,t,e),y.pull){var v=+m.castOption(y.pull,n.pts)||0;v>0&&(l+=v*n.pxmid[0],c+=v*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var k=y.hole;if(n.v===g.vTotal){var A="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";k?d.attr("d","M"+(l+k*n.px0[0])+","+(c+k*n.px0[1])+L(n.px0,n.pxmid,!1,k)+L(n.pxmid,n.px0,!1,k)+"Z"+A):d.attr("d",A)}else{var M=L(n.px0,n.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(l+k*n.px1[0])+","+(c+k*n.px1[1])+L(n.px1,n.px0,!1,k)+"l"+S*n.px0[0]+","+S*n.px0[1]+M+"Z")}else d.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+M+"Z")}O(t,n,g);var E=m.castOption(y.textposition,n.pts),I=p.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=s.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=m.castOption(t.outsidetextfont.color,e.pts)||m.castOption(t.textfont.color,e.pts)||r.color,i=m.castOption(t.outsidetextfont.family,e.pts)||m.castOption(t.textfont.family,e.pts)||r.family,a=m.castOption(t.outsidetextfont.size,e.pts)||m.castOption(t.textfont.size,e.pts)||r.size,o=m.castOption(t.outsidetextfont.weight,e.pts)||m.castOption(t.textfont.weight,e.pts)||r.weight,s=m.castOption(t.outsidetextfont.style,e.pts)||m.castOption(t.textfont.style,e.pts)||r.style,l=m.castOption(t.outsidetextfont.variant,e.pts)||m.castOption(t.textfont.variant,e.pts)||r.variant,c=m.castOption(t.outsidetextfont.textcase,e.pts)||m.castOption(t.textfont.textcase,e.pts)||r.textcase,u=m.castOption(t.outsidetextfont.lineposition,e.pts)||m.castOption(t.textfont.lineposition,e.pts)||r.lineposition,h=m.castOption(t.outsidetextfont.shadow,e.pts)||m.castOption(t.textfont.shadow,e.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:c,lineposition:u,shadow:h}}(y,n,h.font):_(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,p).call(u.convertToTspans,t);var d,v=o.bBox(i.node());if("outside"===E)d=C(v,n);else if(d=w(v,n,g),"auto"===E&&d.scale<1){var x=s.ensureUniformFontSize(t,y.outsidetextfont);i.call(o.font,x),d=C(v=o.bBox(i.node()),n)}var b=d.textPosAngle,k=void 0===b?n.pxmid:D(g.r,b);if(d.targetX=l+k[0]*d.rCenter+(d.x||0),d.targetY=c+k[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var A=d.targetY;n.yLabelMin=A-v.height/2,n.yLabelMid=A,n.yLabelMax=A+v.height/2,n.labelExtraX=0,n.labelExtraY=0,T=!0}d.fontSize=p.size,f(y.type,d,h),e[a].transform=d,s.setTransormAndDisplay(i,d)}))}function L(t,e,r,i){var a=i*(e[0]-t[0]),o=i*(e[1]-t[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var e,n=s.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,t),e="middle center"===y.title.position?function(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}(g):I(g,d),n.attr("transform",c(e.x,e.y)+l(Math.min(1,e.scale))+c(e.tx,e.ty))})),T&&function(t,e){var r,n,i,a,o,l,c,u,h,f,p,d,g;function y(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function x(t,r){r||(r={});var i,u,h,p,d=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?t.yLabelMin:t.yLabelMax,y=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),x=d-g;if(x*c>0&&(t.labelExtraY=x),s.isArrayOrTypedArray(e.pull))for(u=0;u=(m.castOption(e.pull,h.pts)||0)||((t.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-t.labelExtraY)*c>0&&(t.labelExtraY+=x):(y+t.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-f.indexOf(t)),(p=h.cxFinal+a(h.px0[0],h.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*l>0&&(t.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=t[n][r]).sort(i),h=t[1-n][r],f=h.concat(u),d=[],p=0;pMath.abs(h)?l+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(o+t.labelExtraX+c):l+="l"+t.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(v,y),T&&y.automargin){var A=o.bBox(p.node()),M=y.domain,S=d.w*(M.x[1]-M.x[0]),E=d.h*(M.y[1]-M.y[0]),L=(.5*S-g.r)/d.w,P=(.5*E-g.r)/d.h;n.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-L,xr:M.x[1]+L,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(g.cx-g.r-A.left,0),r:Math.max(A.right-(g.cx+g.r),0),b:Math.max(A.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-A.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var t=r.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:O,transformInsideText:w,determineInsideTextFont:_,positionTitleOutside:I,prerenderTitles:b,layoutAreas:z,attachFxHandlers:x,computeTransform:R}}}),Fu=f({"src/traces/pie/style.js"(t,e){var r=v(),n=wr(),i=Ja().resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");i(t,e,"pie"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),ju=f({"src/traces/pie/base_plot.js"(t){var e=Te();t.name="pie",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Bu=f({"src/traces/pie/index.js"(t,e){e.exports={attributes:Iu(),supplyDefaults:Lu().supplyDefaults,supplyLayoutDefaults:zu(),layoutAttributes:Pu(),calc:Du().calc,crossTraceCalc:Du().crossTraceCalc,plot:Ru().plot,style:Fu(),styleOne:wr(),moduleType:"trace",name:"pie",basePlotModule:ju(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Nu=f({"lib/pie.js"(t,e){e.exports=Bu()}}),Uu=f({"src/traces/sunburst/base_plot.js"(t){var e=Te();t.name="sunburst",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Vu=f({"src/traces/sunburst/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),qu=f({"src/traces/sunburst/attributes.js"(t,e){var r=N(),n=Dt().hovertemplateAttrs,i=Dt().texttemplateAttrs,a=Le(),o=Ta().attributes,s=Iu(),l=Vu(),c=O().extendFlat,u=Pt().pattern;e.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}}),Hu=f({"src/traces/sunburst/layout_attributes.js"(t,e){e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Gu=f({"src/traces/sunburst/defaults.js"(t,e){var r=se(),n=qu(),i=Ta().defaults,a=Wa().handleText,o=Lu().handleMarkerDefaults,s=Ze(),l=s.hasColorscale,c=s.handleDefaults;e.exports=function(t,e,s,u){function h(i,a){return r.coerce(t,e,n,i,a)}var f=h("labels"),p=h("parents");if(f&&f.length&&p&&p.length){var d=h("values");d&&d.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(t,e,u,h);var m=e._hasColorscale=l(t,"marker","colors")||(t.marker||{}).coloraxis;m&&c(t,e,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(t,e,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(e,u,h),e._length=null}else e.visible=!1}}}),Zu=f({"src/traces/sunburst/layout_defaults.js"(t,e){var r=se(),n=Hu();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("sunburstcolorway",e.colorway),i("extendsunburstcolors")}}}),Wu=f({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(t,e){var r,n;r=t,n=function(t){function e(t,e){return t.parent===e.parent?1:2}function r(t,e){return t+e.x}function n(t,e){return Math.max(t,e.y)}function i(t){var e=0,r=t.children,n=r&&r.length;if(n)for(;--n>=0;)e+=r[n].value;else e=1;t.value=e}function a(t,e){var r,n,i,a,s,u=new c(t),h=+t.value&&(u.value=t.value),f=[u];for(null==e&&(e=o);r=f.pop();)if(h&&(r.value=+r.data.value),(i=e(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)f.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(t){return t.children}function s(t){t.data=t.data.data}function l(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(t){var e,r,n,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(e[r]);return this},sum:function(t){return this.eachAfter((function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(r){r!==t&&e.push({source:r.parent,target:r})})),e},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(t){for(var e,r,n=0,i=(t=function(t){for(var e,r,n=t.length;n;)r=Math.random()*n--|0,e=t[n],t[n]=t[r],t[r]=e;return t}(u.call(t))).length,a=[];n0&&r*r>n*n+i*i}function m(t,e){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=t.x-n*s-a*l,r.y=t.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=e.x+n*s-a*l,r.y=e.y+n*l+a*s)):(r.x=e.x+r.r,r.y=e.y)}function _(t,e){var r=t.r+e.r-1e-6,n=e.x-t.x,i=e.y-t.y;return r>0&&r*r>n*n+i*i}function b(t){var e=t._,r=t.next._,n=e.r+r.r,i=(e.x*r.r+r.x*e.r)/n,a=(e.y*r.r+r.y*e.r)/n;return i*i+a*a}function w(t){this._=t,this.next=null,this.previous=null}function T(t){if(!(i=t.length))return 0;var e,r,n,i,a,o,s,l,c,u,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(i>2))return e.r+r.r;x(r,e,n=t[2]),e=new w(e),r=new w(r),n=new w(n),e.next=n.previous=r,r.next=e.previous=n,n.next=r.previous=e;t:for(s=3;sf&&(f=s),g=u*u*m,(p=Math.max(f/g,g/h))>d){u-=s;break}d=p}y.push(o={value:u,dice:l1?e:1)},r}(H),W=function t(e){function r(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,l,c,u,h=-1,f=o.length,p=t.value;++h1?e:1)},r}(H);t.cluster=function(){var t=e,i=1,a=1,o=!1;function s(e){var s,l=0;e.eachAfter((function(e){var i=e.children;i?(e.x=function(t){return t.reduce(r,0)/t.length}(i),e.y=function(t){return 1+t.reduce(n,0)}(i)):(e.x=s?l+=t(e,s):0,e.y=0,s=e)}));var c=function(t){for(var e;e=t.children;)t=e[0];return t}(e),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),h=c.x-t(c,u)/2,f=u.x+t(u,c)/2;return e.eachAfter(o?function(t){t.x=(t.x-e.x)*i,t.y=(e.y-t.y)*a}:function(t){t.x=(t.x-h)/(f-h)*i,t.y=(1-(e.y?t.y/e.y:1))*a})}return s.separation=function(e){return arguments.length?(t=e,s):t},s.size=function(t){return arguments.length?(o=!1,i=+t[0],a=+t[1],s):o?null:[i,a]},s.nodeSize=function(t){return arguments.length?(o=!0,i=+t[0],a=+t[1],s):o?[i,a]:null},s},t.hierarchy=a,t.pack=function(){var t=null,e=1,r=1,n=A;function i(i){return i.x=e/2,i.y=r/2,t?i.eachBefore(E(t)).eachAfter(C(n,.5)).eachBefore(I(1)):i.eachBefore(E(S)).eachAfter(C(A,1)).eachAfter(C(n,i.r/Math.min(e,r))).eachBefore(I(Math.min(e,r)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=null==(r=e)?null:k(r),i):t;var r},i.size=function(t){return arguments.length?(e=+t[0],r=+t[1],i):[e,r]},i.padding=function(t){return arguments.length?(n="function"==typeof t?t:M(+t),i):n},i},t.packEnclose=h,t.packSiblings=function(t){return T(t),t},t.partition=function(){var t=1,e=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(n){n.children&&P(n,n.x0,t*(n.depth+1)/e,n.x1,t*(n.depth+2)/e);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=k(e),r):t},r.parentId=function(t){return arguments.length?(e=k(t),r):e},r},t.tree=function(){var t=F,e=1,r=1,n=null;function i(i){var l=function(t){for(var e,r,n,i,a,o=new V(t,0),s=[o];e=s.pop();)if(n=e._.children)for(e.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=e.children[i]=new V(n[i],i)),r.parent=e;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>h.depth&&(h=t)}));var f=c===u?1:t(c,u)/2,p=f-c.x,d=e/(u.x+f+p),m=r/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}return i}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var a=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,a=e,o=e,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,f=l.m;s=B(s),a=j(a),s&&a;)l=j(l),(o=B(o)).a=e,(i=s.z+h-a.z-c+t(s._,a._))>0&&(N(U(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,f+=l.m,u+=o.m;s&&!B(o)&&(o.t=s,o.m+=h-u),a&&!j(l)&&(l.t=a,l.m+=c-f,n=e)}return n}(e,i,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],i):n?null:[e,r]},i.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],i):n?[e,r]:null},i},t.treemap=function(){var t=Z,e=!1,r=1,n=1,i=[0],a=A,o=A,s=A,l=A,c=A;function u(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),i=[0],e&&t.eachBefore(L),t}function h(e){var r=i[e.depth],n=e.x0+r,u=e.y0+r,h=e.x1-r,f=e.y1-r;h=r-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[e],f=n/2+h,p=e+1,d=r-1;p>>1;c[m]l-a){var v=(i*y+o*g)/n;t(e,p,g,i,a,v,l),t(p,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;t(e,p,g,i,a,o,x),t(p,r,y,i,x,o,l)}}(0,l,t.value,e,r,n,i)},t.treemapDice=P,t.treemapResquarify=W,t.treemapSlice=q,t.treemapSliceDice=function(t,e,r,n,i){(1&t.depth?q:P)(t,e,r,n,i)},t.treemapSquarify=Z,Object.defineProperty(t,"__esModule",{value:!0})},n("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}}),Yu=f({"src/traces/sunburst/calc.js"(t){var e=Wu(),r=T(),n=se(),i=Ze().makeColorScaleFuncFromTrace,a=Du().makePullColorFn,o=Du().generateExtendedColors,s=Ze().calc,l=k().ALMOST_EQUAL,c={},u={},h={};function f(t,e,r){var n=0,i=t.children;if(i){for(var a=i.length,o=0;o=0};v?(c=Math.min(y.length,_.length),u=function(t){return M(y[t])&&S(t)},h=function(t){return String(y[t])}):(c=Math.min(x.length,_.length),u=function(t){return M(x[t])&&S(t)},h=function(t){return String(x[t])}),w&&(c=Math.min(c,b.length));for(var E=0;E1){for(var P=n.randstr(),z=0;z>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?vh(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?vh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=nh.exec(t))?new bh(e[1],e[2],e[3],1):(e=ih.exec(t))?new bh(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ah.exec(t))?vh(e[1],e[2],e[3],e[4]):(e=oh.exec(t))?vh(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sh.exec(t))?Eh(e[1],e[2]/100,e[3]/100,1):(e=lh.exec(t))?Eh(e[1],e[2]/100,e[3]/100,e[4]):ch.hasOwnProperty(t)?yh(ch[t]):"transparent"===t?new bh(NaN,NaN,NaN,0):null}function yh(t){return new bh(t>>16&255,t>>8&255,255&t,1)}function vh(t,e,r,n){return n<=0&&(t=e=r=NaN),new bh(t,e,r,n)}function xh(t){return t instanceof hh||(t=gh(t)),t?new bh((t=t.rgb()).r,t.g,t.b,t.opacity):new bh}function _h(t,e,r,n){return 1===arguments.length?xh(t):new bh(t,e,r,null==n?1:n)}function bh(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function wh(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}`}function Th(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}${Sh(255*(isNaN(this.opacity)?1:this.opacity))}`}function kh(){const t=Ah(this.opacity);return`${1===t?"rgb(":"rgba("}${Mh(this.r)}, ${Mh(this.g)}, ${Mh(this.b)}${1===t?")":`, ${t})`}`}function Ah(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Mh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Sh(t){return((t=Mh(t))<16?"0":"")+t.toString(16)}function Eh(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Lh(t,e,r,n)}function Ch(t){if(t instanceof Lh)return new Lh(t.h,t.s,t.l,t.opacity);if(t instanceof hh||(t=gh(t)),!t)return new Lh;if(t instanceof Lh)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(r-n)/s+6*(r0&&l<1?0:o,new Lh(o,s,l,t.opacity)}function Ih(t,e,r,n){return 1===arguments.length?Ch(t):new Lh(t,e,r,null==n?1:n)}function Lh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Ph(t){return(t=(t||0)%360)<0?t+360:t}function zh(t){return Math.max(0,Math.min(1,t||0))}function Dh(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}var Oh,Rh,Fh,jh,Bh,Nh,Uh,Vh,qh,Hh=h({"node_modules/d3-color/src/color.js"(){uh(),Ku=1/(Ju=.7),Qu="\\s*([+-]?\\d+)\\s*",th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,nh=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),ih=new RegExp(`^rgb\\(${eh},${eh},${eh}\\)$`),ah=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${th}\\)$`),oh=new RegExp(`^rgba\\(${eh},${eh},${eh},${th}\\)$`),sh=new RegExp(`^hsl\\(${th},${eh},${eh}\\)$`),lh=new RegExp(`^hsla\\(${th},${eh},${eh},${th}\\)$`),ch={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Xu(hh,gh,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fh,formatHex:fh,formatHex8:ph,formatHsl:dh,formatRgb:mh,toString:mh}),Xu(bh,_h,$u(hh,{brighter(t){return t=null==t?Ku:Math.pow(Ku,t),new bh(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ju:Math.pow(Ju,t),new bh(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new bh(Mh(this.r),Mh(this.g),Mh(this.b),Ah(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wh,formatHex:wh,formatHex8:Th,formatRgb:kh,toString:kh})),Xu(Lh,Ih,$u(hh,{brighter(t){return t=null==t?Ku:Math.pow(Ku,t),new Lh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ju:Math.pow(Ju,t),new Lh(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new bh(Dh(t>=240?t-240:t+120,i,n),Dh(t,i,n),Dh(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Lh(Ph(this.h),zh(this.s),zh(this.l),Ah(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ah(this.opacity);return`${1===t?"hsl(":"hsla("}${Ph(this.h)}, ${100*zh(this.s)}%, ${100*zh(this.l)}%${1===t?")":`, ${t})`}`}}))}}),Gh=h({"node_modules/d3-color/src/math.js"(){Oh=Math.PI/180,Rh=180/Math.PI}});function Zh(t){if(t instanceof Yh)return new Yh(t.l,t.a,t.b,t.opacity);if(t instanceof tf)return ef(t);t instanceof bh||(t=xh(t));var e,r,n=Kh(t.r),i=Kh(t.g),a=Kh(t.b),o=Xh((.2225045*n+.7168786*i+.0606169*a)/jh);return n===i&&i===a?e=r=o:(e=Xh((.4360747*n+.3850649*i+.1430804*a)/Fh),r=Xh((.0139322*n+.0971045*i+.7141733*a)/Bh)),new Yh(116*o-16,500*(e-o),200*(o-r),t.opacity)}function Wh(t,e,r,n){return 1===arguments.length?Zh(t):new Yh(t,e,r,null==n?1:n)}function Yh(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Xh(t){return t>qh?Math.pow(t,1/3):t/Vh+Nh}function $h(t){return t>Uh?t*t*t:Vh*(t-Nh)}function Jh(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Kh(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qh(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof tf)return new tf(t.h,t.c,t.l,t.opacity);if(t instanceof Yh||(t=Zh(t)),0===t.a&&0===t.b)return new tf(NaN,0=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,s=n()=>t}});function Tf(t,e){return function(r){return t+r*e}}function kf(t,e){var r=e-t;return r?Tf(t,r>180||r<-180?r-360*Math.round(r/360):r):_f(isNaN(t)?e:t)}function Af(t){return 1==(t=+t)?Mf:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):_f(isNaN(e)?r:e)}}function Mf(t,e){var r=e-t;return r?Tf(t,r):_f(isNaN(t)?e:t)}var Sf,Ef,Cf,If=h({"node_modules/d3-interpolate/src/color.js"(){wf()}});function Lf(t){return function(e){var r,n,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;ra&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Uf(r,n)})),a=Gf.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:Uf(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:Uf(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Uf(t,r)},{i:s-2,x:Uf(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++rXf,interpolateArray:()=>Rf,interpolateBasis:()=>yf,interpolateBasisClosed:()=>xf,interpolateCubehelix:()=>Sp,interpolateCubehelixLong:()=>Ep,interpolateDate:()=>Bf,interpolateDiscrete:()=>Jf,interpolateHcl:()=>Tp,interpolateHclLong:()=>kp,interpolateHsl:()=>yp,interpolateHslLong:()=>vp,interpolateHue:()=>Qf,interpolateLab:()=>wp,interpolateNumber:()=>Uf,interpolateNumberArray:()=>zf,interpolateObject:()=>qf,interpolateRgb:()=>Sf,interpolateRgbBasis:()=>Ef,interpolateRgbBasisClosed:()=>Cf,interpolateRound:()=>ep,interpolateString:()=>Wf,interpolateTransformCss:()=>up,interpolateTransformSvg:()=>hp,interpolateZoom:()=>dp,piecewise:()=>Pp,quantize:()=>Dp});var Fp,jp,Bp,Np=h({"node_modules/d3-interpolate/src/index.js"(){$f(),jf(),vf(),bf(),Nf(),Kf(),tp(),Vf(),Of(),Zf(),ip(),Yf(),mp(),xp(),Pf(),bp(),Ap(),Cp(),Lp(),zp(),Op()}}),Up=f({"src/traces/sunburst/fill_one.js"(t,e){var r=Ke(),n=q();e.exports=function(t,e,i,a,o){var s=e.data.data,l=s.i,c=o||s.color;if(l>=0){e.i=s.i;var u=i.marker;u.pattern&&u.colors&&u.pattern.shape||(u.color=c,e.color=c),r.pointStyle(t,i,a,e)}else n.fill(t,c)}}}),Vp=f({"src/traces/sunburst/style.js"(t,e){var r=v(),n=q(),i=se(),a=Ja().resizeText,o=Up();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");a(t,e,"sunburst"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),qp=f({"src/traces/sunburst/helpers.js"(t){var e=se(),r=q(),n=fr(),i=_r();function a(t){return t.data.data.pid}t.findEntryWithLevel=function(e,r){var n;return r&&e.eachAfter((function(e){if(t.getPtId(e)===r)return n=e.copy()})),n||e},t.findEntryWithChild=function(e,r){var n;return e.eachAfter((function(e){for(var i=e.children||[],a=0;a0)},t.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},t.isHeader=function(e,r){return!(t.isLeaf(e)||e.depth===r._maxDepth-1)},t.getParent=function(e,r){return t.findEntryWithLevel(e,a(r))},t.listPath=function(e,r){var n=e.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return t.listPath(n,r).concat(i)},t.getPath=function(e){return t.listPath(e,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(t,r){var n=e.formatPercent(t,0);return"0%"===n&&(n=i.formatPiePercent(t,r)),n}}}),Hp=f({"src/traces/sunburst/fx.js"(t,e){var r=v(),n=Vt(),i=Xe().appendArrayPointValue,a=zr(),o=se(),s=fe(),l=qp(),c=_r().formatPieValue;function u(t,e,r){for(var n=t.data.data,a={curveNumber:e.index,pointNumber:n.i,data:e._input,fullData:e},o=0;o"),name:A||D("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),fontWeight:k("hoverlabel.font.weight"),fontStyle:k("hoverlabel.font.style"),fontVariant:k("hoverlabel.font.variant"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:L,eventData:h};g&&(F.x0=E-n.rInscribed*n.rpx1,F.x1=E+n.rInscribed*n.rpx1,F.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(F.x=E,F.idealAlign=E<0?"left":"right");var j=[];a.loneHover(F,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:j}),h[0].bbox=j[0],d._hasHoverLabel=!0}if(y){var B=t.select("path.surface");f.styleOne(B,n,v,i,{hovered:!0})}d._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,f.eventDataKeys)],event:r.event})}})),t.on("mouseout",(function(e){var n=i._fullLayout,o=i._fullData[d.index],s=r.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,f.eventDataKeys)],event:r.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");f.styleOne(l,s,o,i,{hovered:!1})}})),t.on("click",(function(t){var e=i._fullLayout,o=i._fullData[d.index],c=g&&(l.isHierarchyRoot(t)||l.isLeaf(t)),h=l.getPtId(t),p=l.isEntry(t)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(p),v={points:[u(t,o,f.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+d.type+"click",v);if(!1!==x&&e.hovermode&&(i._hoverdata=[u(t,o,f.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,e._tracePreGUI[o.uid],{level:o.level});var _={data:[{level:y}],traces:[d.index]},b={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(e._hoverlayer.node()),n.call("animate",i,_,b)}}))}}}),Gp=f({"src/traces/sunburst/plot.js"(t){var e=v(),r=Wu(),n=(Np(),m(Rp)).interpolate,i=Ke(),a=se(),o=Me(),s=Ja(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=Ru(),h=_r().getRotationAngle,f=u.computeTransform,p=u.transformInsideText,d=Vp().styleOne,g=Qa().resizeText,y=Hp(),x=Vu(),_=qp();function b(s,c,u,m){var g=s._context.staticPlot,v=s._fullLayout,b=!v.uniformtext.mode&&_.hasTransition(m),T=e.select(u).selectAll("g.slice"),k=c[0],A=k.trace,M=k.hierarchy,S=_.findEntryWithLevel(M,A.level),E=_.getMaxDepth(A),C=v._size,I=A.domain,L=C.w*(I.x[1]-I.x[0]),P=C.h*(I.y[1]-I.y[0]),z=.5*Math.min(L,P),D=k.cx=C.l+C.w*(I.x[1]+I.x[0])/2,O=k.cy=C.t+C.h*(1-I.y[0])-P/2;if(!S)return T.remove();var R=null,F={};b&&T.each((function(t){F[_.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&_.isEntry(t)&&(R=t)}));var j=function(t){return r.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),B=S.height+1,N=0,U=E;k.hasMultipleRoots&&_.isHierarchyRoot(S)&&(j=j.slice(1),B-=1,N=1,U+=1),j=j.filter((function(t){return t.y1<=U}));var V=h(A.rotation);V&&j.forEach((function(t){t.x0+=V,t.x1+=V}));var q=Math.min(B,E),H=function(t){return(t-N)/q*z},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},Z=function(t){return a.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,D,O)},W=function(t){return D+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Y=function(t){return O+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(j,_.getPtId)).enter().append("g").classed("slice",!0),b?T.exit().transition().each((function(){var t=e.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=_.getPtId(t),i=F[r],a=F[_.getPtId(S)];if(a){var o=(t.x1>a.x1?2*Math.PI:0)+V;e=t.rpx1X?2*Math.PI:0)+V;e={x0:o,x1:o}}else e={rpx0:z,rpx1:z},a.extendFlat(e,K(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return n(e,i)}(t);return function(t){return Z(e(t))}})):h.attr("d",Z),u.call(y,S,s,c,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(_.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(d,r,A,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),T=a.ensureUniformFontSize(s,_.determineTextFont(A,r,v.font));w.text(t.formatSliceLabel(r,S,A,c,v)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,T).call(o.convertToTspans,s);var M=i.bBox(w.node());r.transform=p(M,r,k),r.transform.targetX=W(r),r.transform.targetY=Y(r);var E=function(t,e){var r=t.transform;return f(r,e),r.fontSize=T.size,l(A.type,r,v),a.getTextTransform(r)};b?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[_.getPtId(t)],i=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},R)if(t.parent)if(X){var o=t.x1>X?2*Math.PI:0;e.x0=e.x1=o}else a.extendFlat(e,K(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var s=n(e.transform.textPosAngle,t.transform.textPosAngle),c=n(e.rpx1,t.rpx1),u=n(e.x0,t.x0),h=n(e.x1,t.x1),f=n(e.transform.scale,i.scale),p=n(e.transform.rotate,i.rotate),d=0===i.rCenter?3:0===e.transform.rCenter?1/3:1,m=n(e.transform.rCenter,i.rCenter),g=function(t){return m(Math.pow(t,d))};return function(t){var e=c(t),r=u(t),n=h(t),a=g(t),o={pxmid:G(e,(r+n)/2),rpx1:e,transform:{textPosAngle:s(t),rCenter:a,x:i.x,y:i.y}};return l(A.type,i,v),{transform:{targetX:W(o),targetY:Y(o),scale:f(t),rotate:p(t),rCenter:a}}}}(t);return function(t){return E(e(t),M)}})):w.attr("transform",E(r,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}t.plot=function(t,r,n,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&_.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),e.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){b(t,e,this,n)}))}))):(a.each((function(e){b(t,e,this,n)})),s.uniformtext.mode&&g(t,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},t.formatSliceLabel=function(t,e,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!(o||s&&"none"!==s))return"";var l=i.separators,c=n[0],u=t.data.data,h=c.hierarchy,f=_.isHierarchyRoot(t),p=_.getParent(h,t),d=_.getValue(t);if(!o){var m,g=s.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(_.formatValue(u.v,l)),!f){y("current path")&&v.push(_.getPath(t.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var b=x>1;if(x){var w,T=function(t){m=_.formatPercent(w,l),b&&(m+=" of "+t),v.push(m)};y("percent parent")&&!f&&(w=d/_.getValue(p),T("parent")),y("percent entry")&&(w=d/_.getValue(e),T("entry")),y("percent root")&&(w=d/_.getValue(h),T("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("
")}var k=a.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=_.formatValue(u.v,l)),A.currentPath=_.getPath(t.data),f||(A.percentParent=d/_.getValue(p),A.percentParentLabel=_.formatPercent(A.percentParent,l),A.parent=_.getPtLabel(p)),A.percentEntry=d/_.getValue(e),A.percentEntryLabel=_.formatPercent(A.percentEntry,l),A.entry=_.getPtLabel(e),A.percentRoot=d/_.getValue(h),A.percentRootLabel=_.formatPercent(A.percentRoot,l),A.root=_.getPtLabel(h),u.hasOwnProperty("color")&&(A.color=u.color);var M=a.castOption(r,u.i,"text");return(a.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(k,A,i._d3locale,A,r._meta||{})}}}),Zp=f({"src/traces/sunburst/index.js"(t,e){e.exports={moduleType:"trace",name:"sunburst",basePlotModule:Uu(),categories:[],animatable:!0,attributes:qu(),layoutAttributes:Hu(),supplyDefaults:Gu(),supplyLayoutDefaults:Zu(),calc:Yu().calc,crossTraceCalc:Yu().crossTraceCalc,plot:Gp().plot,style:Vp().style,colorbar:fi(),meta:{}}}}),Wp=f({"lib/sunburst.js"(t,e){e.exports=Zp()}}),Yp=f({"src/traces/treemap/base_plot.js"(t){var e=Te();t.name="treemap",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),Xp=f({"src/traces/treemap/constants.js"(t,e){e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),$p=f({"src/traces/treemap/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=Le(),a=Ta().attributes,o=Iu(),s=qu(),l=Xp(),c=O().extendFlat,u=Pt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:s.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:c({},o.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}}),Jp=f({"src/traces/treemap/layout_attributes.js"(t,e){e.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Kp=f({"src/traces/treemap/defaults.js"(t,e){var r=se(),n=$p(),i=q(),a=Ta().defaults,o=Wa().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,f,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var x=-1!==e.textposition.indexOf("bottom");l(t,e,f,p),(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?h(t,e,f,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(e.marker.colors||[]).length);var _=2*e.textfont.size;p("marker.pad.t",x?_/4:_),p("marker.pad.l",_/4),p("marker.pad.r",_/4),p("marker.pad.b",x?_:_/4),p("marker.cornerradius"),e._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,f,p),e._length=null}else e.visible=!1}}}),Qp=f({"src/traces/treemap/layout_defaults.js"(t,e){var r=se(),n=Jp();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("treemapcolorway",e.colorway),i("extendtreemapcolors")}}}),td=f({"src/traces/treemap/calc.js"(t){var e=Yu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("treemap",t)}}}),ed=f({"src/traces/treemap/flip_tree.js"(t,e){e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o0)for(var b=0;b").join(" ")||"";var m=n.ensureSingle(p,"g","slicetext"),k=n.ensureSingle(m,"text","",(function(t){t.attr("data-notex",1)})),I=n.ensureUniformFontSize(t,c.determineTextFont(L,o,C.font,{onPathbar:!0}));k.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,I).call(a.convertToTspans,t),o.textBB=i.bBox(k.node()),o.transform=b(o,{fontSize:I.size,onPathbar:!0}),o.transform.fontSize=I.size,T?k.transition().attrTween("transform",(function(t){var e=M(t,h,S,[g,y]);return function(t){return w(e(t))}})):k.attr("transform",w(o))}))}}}),ad=f({"src/traces/treemap/plot_one.js"(t,e){var r=v(),n=(Np(),m(Rp)).interpolate,i=qp(),a=se(),o=qa().TEXTPAD,s=to().toMoveInsideBar,l=Ja().recordMinTextSize,c=Xp(),u=id();function h(t){return i.isHierarchyRoot(t)?"":i.getPtId(t)}e.exports=function(t,e,f,p,d){var m=t._fullLayout,g=e[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,_=i.findEntryWithLevel(x,y.level),b=r.select(f),w=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!_)return w.remove(),void T.remove();var k=i.isHierarchyRoot(_),A=!m.uniformtext.mode&&i.hasTransition(p),M=i.getMaxDepth(y),S=m._size,E=y.domain,C=S.w*(E.x[1]-E.x[0]),I=S.h*(E.y[1]-E.y[0]),L=C,P=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,D=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?I+z:-(P+z):0,O={x0:L,x1:L,y0:D,y1:D+P},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,j={},B={},N=null,U=function(t,e){return e?j[h(t)]:B[h(t)]},V=function(t,e,r,n){if(e)return j[h(x)]||O;var i=B[y.level]||r;return function(t){return t.data.depth-_.data.depth=(n-=(v?et:et.r)-o)){var p=(r+n)/2;r=p,n=p}var d;ot?i<(d=a-(v?et:et.b))&&d"===tt?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===tt?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),Q(l),Q(h),Q(o),Q(c),Q(u),Q(s),"M"+J(l.x,l.y)+"L"+J(c.x,c.y)+"L"+J(s.x,s.y)+"L"+J(u.x,u.y)+"L"+J(h.x,h.y)+"L"+J(o.x,o.y)+"Z"},toMoveInsideSlice:st,makeUpdateSliceInterpolator:ct,makeUpdateTextInterpolator:ut,handleSlicesExit:ht,hasTransition:A,strTransform:ft}):w.remove()}}}),od=f({"src/traces/treemap/draw.js"(t,e){var r=v(),n=qp(),i=Ja().clearMinTextSize,a=Qa().resizeText,o=ad();e.exports=function(t,e,s,l,c){var u,h,f=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+f+"layer"],g=!s;i(f,d),(u=m.selectAll("g.trace."+f).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(f,!0),u.order(),!d.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(e){o(t,e,this,s,p)}))}))):(u.each((function(e){o(t,e,this,s,p)})),d.uniformtext.mode&&a(t,m.selectAll(".trace"),f)),g&&u.exit().remove()}}}),sd=f({"src/traces/treemap/draw_descendants.js"(t,e){var r=v(),n=se(),i=Ke(),a=Me(),o=rd(),s=nd().styleOne,l=Xp(),c=qp(),u=Hp(),h=Gp().formatSliceLabel,f=!1;e.exports=function(t,e,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=!z&&!I.marker.pad.t||z&&!I.marker.pad.b,O=o(p,[g,y],{packing:I.tiling.packing,squarifyratio:I.tiling.squarifyratio,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}).descendants(),R=1/0,F=-1/0;O.forEach((function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(R=Math.min(R,e),F=Math.max(F,e))})),d=d.data(O,c.getPtId),I._maxVisibleLayers=isFinite(F)?F-R+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var j=null;if(T&&S){var B=c.getPtId(S);d.each((function(t){null===j&&c.getPtId(t)===B&&(j={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return j||{x0:0,x1:g,y0:0,y1:y}},U=d;return T&&(U=U.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var d=c.isHeader(o,I);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.marker.pad.r),o._hoverY=x(z?o.y1-I.marker.pad.b/2:o.y0+I.marker.pad.t/2);var m=r.select(this),k=n.ensureSingle(m,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?k.transition().attrTween("d",(function(t){var e=A(t,f,N(),[g,y]);return function(t){return _(e(t))}})):k.attr("d",_),m.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),k.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=d?D?"":c.getPtLabel(o)||"":h(o,p,I,e,C)||"";var S=n.ensureSingle(m,"g","slicetext"),O=n.ensureSingle(S,"text","",(function(t){t.attr("data-notex",1)})),R=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font)),F=o._text||" ",j=d&&-1===F.indexOf("
");O.text(F).classed("slicetext",!0).attr("text-anchor",P?"end":L||j?"start":"middle").call(i.font,R).call(a.convertToTspans,t),o.textBB=i.bBox(O.node()),o.transform=b(o,{fontSize:R.size,isHeader:d}),o.transform.fontSize=R.size,T?O.transition().attrTween("transform",(function(t){var e=M(t,f,N(),[g,y]);return function(t){return w(e(t))}})):O.attr("transform",w(o))})),j}}}),ld=f({"src/traces/treemap/plot.js"(t,e){var r=od(),n=sd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"treemap",drawDescendants:n})}}}),cd=f({"src/traces/treemap/index.js"(t,e){e.exports={moduleType:"trace",name:"treemap",basePlotModule:Yp(),categories:[],animatable:!0,attributes:$p(),layoutAttributes:Jp(),supplyDefaults:Kp(),supplyLayoutDefaults:Qp(),calc:td().calc,crossTraceCalc:td().crossTraceCalc,plot:ld(),style:nd().style,colorbar:fi(),meta:{}}}}),ud=f({"lib/treemap.js"(t,e){e.exports=cd()}}),hd=f({"src/traces/icicle/base_plot.js"(t){var e=Te();t.name="icicle",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),fd=f({"src/traces/icicle/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=Le(),a=Ta().attributes,o=Iu(),s=qu(),l=$p(),c=Xp(),u=O().extendFlat,h=Pt().pattern;e.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}}),pd=f({"src/traces/icicle/layout_attributes.js"(t,e){e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dd=f({"src/traces/icicle/defaults.js"(t,e){var r=se(),n=fd(),i=q(),a=Ta().defaults,o=Wa().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Ze(),u=c.hasColorscale,h=c.handleDefaults;e.exports=function(t,e,c,f){function p(i,a){return r.coerce(t,e,n,i,a)}var d=p("labels"),m=p("parents");if(d&&d.length&&m&&m.length){var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var y=p("text");p("texttemplate"),e.texttemplate||p("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),p("hovertext"),p("hovertemplate");var v=p("pathbar.visible");o(t,e,f,p,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),l(t,e,f,p);var x=e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;x&&h(t,e,f,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",x?1:.7),e._hovered={marker:{line:{width:2,color:i.contrast(f.paper_bgcolor)}}},v&&(p("pathbar.thickness",e.pathbar.textfont.size+2*s),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),a(e,f,p),e._length=null}else e.visible=!1}}}),md=f({"src/traces/icicle/layout_defaults.js"(t,e){var r=se(),n=pd();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("iciclecolorway",e.colorway),i("extendiciclecolors")}}}),gd=f({"src/traces/icicle/calc.js"(t){var e=Yu();t.calc=function(t,r){return e.calc(t,r)},t.crossTraceCalc=function(t){return e._runCrossTraceCalc("icicle",t)}}}),yd=f({"src/traces/icicle/partition.js"(t,e){var r=Wu(),n=ed();e.exports=function(t,e,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&n(h,e,{swapXY:s,flipX:a,flipY:o}),h}}}),vd=f({"src/traces/icicle/style.js"(t,e){var r=v(),n=q(),i=se(),a=Ja().resizeText,o=Up();function s(t,e,r,a){var s=e.data.data,l=!e.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;t.call(o,e,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");a(t,e,"icicle"),e.each((function(e){var n=r.select(this),i=e[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(e){r.select(this).call(s,e,i,t)}))}))},styleOne:s}}}),xd=f({"src/traces/icicle/draw_descendants.js"(t,e){var r=v(),n=se(),i=Ke(),a=Me(),o=yd(),s=vd().styleOne,l=Xp(),c=qp(),u=Hp(),h=Gp().formatSliceLabel,f=!1;e.exports=function(t,e,p,d,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,_=m.pathSlice,b=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,k=m.handleSlicesExit,A=m.makeUpdateSliceInterpolator,M=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,C=t._fullLayout,I=e[0].trace,L=-1!==I.textposition.indexOf("left"),P=-1!==I.textposition.indexOf("right"),z=-1!==I.textposition.indexOf("bottom"),D=o(p,[g,y],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}).descendants(),O=1/0,R=-1/0;D.forEach((function(t){var e=t.depth;e>=I._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,e),R=Math.max(R,e))})),d=d.data(D,c.getPtId),I._maxVisibleLayers=isFinite(R)?R-O+1:0,d.enter().append("g").classed("slice",!0),k(d,f,{},[g,y],_),d.order();var F=null;if(T&&S){var j=c.getPtId(S);d.each((function(t){null===F&&c.getPtId(t)===j&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return F||{x0:0,x1:g,y0:0,y1:y}},N=d;return T&&(N=N.transition().each("end",(function(){var e=r.select(this);c.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-I.tiling.pad),o._hoverY=x(z?o.y1-I.tiling.pad/2:o.y0+I.tiling.pad/2);var d=r.select(this),m=n.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",E?"none":"all")}));T?m.transition().attrTween("d",(function(t){var e=A(t,f,B(),[g,y],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(t){return _(e(t))}})):m.attr("d",_),d.call(u,p,t,e,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),m.call(s,o,I,t,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,p,I,e,C)||"";var k=n.ensureSingle(d,"g","slicetext"),S=n.ensureSingle(k,"text","",(function(t){t.attr("data-notex",1)})),D=n.ensureUniformFontSize(t,c.determineTextFont(I,o,C.font));S.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":L?"start":"middle").call(i.font,D).call(a.convertToTspans,t),o.textBB=i.bBox(S.node()),o.transform=b(o,{fontSize:D.size}),o.transform.fontSize=D.size,T?S.transition().attrTween("transform",(function(t){var e=M(t,f,B(),[g,y]);return function(t){return w(e(t))}})):S.attr("transform",w(o))})),F}}}),_d=f({"src/traces/icicle/plot.js"(t,e){var r=od(),n=xd();e.exports=function(t,e,i,a){return r(t,e,i,a,{type:"icicle",drawDescendants:n})}}}),bd=f({"src/traces/icicle/index.js"(t,e){e.exports={moduleType:"trace",name:"icicle",basePlotModule:hd(),categories:[],animatable:!0,attributes:fd(),layoutAttributes:pd(),supplyDefaults:dd(),supplyLayoutDefaults:md(),calc:gd().calc,crossTraceCalc:gd().crossTraceCalc,plot:_d(),style:vd().style,colorbar:fi(),meta:{}}}}),wd=f({"lib/icicle.js"(t,e){e.exports=bd()}}),Td=f({"src/traces/funnelarea/base_plot.js"(t){var e=Te();t.name="funnelarea",t.plot=function(r,n,i,a){e.plotBasePlot(t.name,r,n,i,a)},t.clean=function(r,n,i,a){e.cleanBasePlot(t.name,r,n,i,a)}}}),kd=f({"src/traces/funnelarea/attributes.js"(t,e){var r=Iu(),n=N(),i=Ta().attributes,a=Dt().hovertemplateAttrs,o=Dt().texttemplateAttrs,s=O().extendFlat;e.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),Ad=f({"src/traces/funnelarea/layout_attributes.js"(t,e){var r=Pu().hiddenlabels;e.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Md=f({"src/traces/funnelarea/defaults.js"(t,e){var r=se(),n=kd(),i=Ta().defaults,a=Wa().handleText,o=Lu().handleLabelsAndValues,s=Lu().handleMarkerDefaults;e.exports=function(t,e,l,c){function u(i,a){return r.coerce(t,e,n,i,a)}var h=u("labels"),f=u("values"),p=o(h,f),d=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(u("label0"),u("dlabel")),d){e._length=d,s(t,e,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(t,e,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(e,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else e.visible=!1}}}),Sd=f({"src/traces/funnelarea/layout_defaults.js"(t,e){var r=se(),n=Ad();e.exports=function(t,e){function i(i,a){return r.coerce(t,e,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",e.colorway),i("extendfunnelareacolors")}}}),Ed=f({"src/traces/funnelarea/calc.js"(t,e){var r=Du();e.exports={calc:function(t,e){return r.calc(t,e)},crossTraceCalc:function(t){r.crossTraceCalc(t,{type:"funnelarea"})}}}}),Cd=f({"src/traces/funnelarea/plot.js"(t,e){var r=v(),n=Ke(),i=se(),a=i.strScale,o=i.strTranslate,s=Me(),l=to().toMoveInsideBar,c=Ja(),u=c.recordMinTextSize,h=c.clearMinTextSize,f=_r(),p=Ru(),d=p.attachFxHandlers,m=p.determineInsideTextFont,g=p.layoutAreas,y=p.prerenderTitles,x=p.positionTitleOutside,_=p.formatSliceLabel;function b(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}function w(t,e){return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}e.exports=function(t,e){var c=t._context.staticPlot,p=t._fullLayout;h("funnelarea",p),y(e,t),g(e,p._size),i.makeTraceGroups(p._funnelarealayer,e,"trace").each((function(e){var h=r.select(this),g=e[0],y=g.trace;!function(t){if(t.length){var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=e.vTotal,u=c,h=c*l/(1-l)/c,f=[];for(f.push(E()),o=t.length-1;o>-1;o--)if(!(s=t[o]).hidden){var p=s.v/u;h+=p,f.push(E())}var d=1/0,m=-1/0;for(o=0;o-1;o--)if(!(s=t[o]).hidden){var A=f[k+=1][0],M=f[k][1];s.TL=[-A,M],s.TR=[A,M],s.BL=b,s.BR=T,s.pxmid=w(s.TR,s.BR),b=s.TL,T=s.TR}}function S(){var t=Math.sqrt(h);return{x:t,y:-t}}function E(){var t=S();return[t.x,t.y]}}(e),h.each((function(){var h=r.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),x.call(d,t,e);var T="M"+(h+a.TR[0])+","+(v+a.TR[1])+b(a.TR,a.BR)+b(a.BR,a.BL)+b(a.BL,a.TL)+"Z";w.attr("d",T),_(t,a,g);var k=f.castOption(y.textposition,a.pts),A=x.selectAll("g.slicetext").data(a.text&&"none"!==k?[0]:[]);A.enter().append("g").classed("slicetext",!0),A.exit().remove(),A.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),f=i.ensureUniformFontSize(t,m(y,a,p.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,f).call(s.convertToTspans,t);var d,g,x,_=n.bBox(c.node()),b=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(d=l(g,x,b,w,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,u(y.type,d,p),e[o].transform=d,i.setTransormAndDisplay(c,d)}))}}));var v=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=i.ensureSingle(r.select(this),"text","",(function(t){t.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),e.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,t);var c=x(g,p._size);e.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Id=f({"src/traces/funnelarea/style.js"(t,e){var r=v(),n=wr(),i=Ja().resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");i(t,e,"funnelarea"),e.each((function(e){var i=e[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(e){r.select(this).call(n,e,i,t)}))}))}}}),Ld=f({"src/traces/funnelarea/index.js"(t,e){e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:Td(),categories:["pie-like","funnelarea","showLegend"],attributes:kd(),layoutAttributes:Ad(),supplyDefaults:Md(),supplyLayoutDefaults:Sd(),calc:Ed().calc,crossTraceCalc:Ed().crossTraceCalc,plot:Cd(),style:Id(),styleOne:wr(),meta:{}}}}),Pd=f({"lib/funnelarea.js"(t,e){e.exports=Ld()}}),zd=f({"stackgl_modules/index.js"(t,e){!function(){var t={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){function n(t,e){for(var r=0;rp)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,m.prototype),e}function m(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return v(t)}return g(t,e,r)}function g(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!m.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|w(t,e),n=d(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(rt(t,Uint8Array)){var e=new Uint8Array(t);return _(e.buffer,e.byteOffset,e.byteLength)}return x(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(t));if(rt(t,ArrayBuffer)||t&&rt(t.buffer,ArrayBuffer))return _(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(rt(t,SharedArrayBuffer)||t&&rt(t.buffer,SharedArrayBuffer)))return _(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return m.from(n,e,r);var i=function(t){if(m.isBuffer(t)){var e=0|b(t.length),r=d(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||nt(t.length)?d(0):x(t):"Buffer"===t.type&&Array.isArray(t.data)?x(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return m.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(t))}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function v(t){return y(t),d(t<0?0:0|b(t))}function x(t){for(var e=t.length<0?0:0|b(t.length),r=d(e),n=0;n=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|t}function w(t,e){if(m.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||rt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tt(t).length;default:if(i)return n?-1:Q(t).length;e=(""+e).toLowerCase(),i=!0}}function T(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return z(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function k(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),nt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=m.from(e,n)),m.isBuffer(e))return 0===e.length?-1:M(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):M(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,f=0;fi&&(n=i):n=i;var a,o=e.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function z(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},m.byteLength=w,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},f&&(m.prototype[f]=m.prototype.inspect),m.prototype.compare=function(t,e,r,n,i){if(rt(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),s=Math.min(a,o),l=this.slice(n,i),u=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return C(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,a){if(!m.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function V(t,e,r,n,i){X(e,n,i,t,r,7);var a=Number(e&BigInt(4294967295));t[r+7]=a,a>>=8,t[r+6]=a,a>>=8,t[r+5]=a,a>>=8,t[r+4]=a;var o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function q(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,4),h.write(t,e,r,n,23,4),r+4}function G(t,e,r,n,i){return e=+e,r>>>=0,i||q(t,0,r,8),h.write(t,e,r,n,52,8),r+8}m.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},m.prototype.readBigUInt64LE=at((function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},m.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},m.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},m.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},m.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},m.prototype.readBigInt64LE=at((function(t){$(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||B(t,4,this.length),h.read(this,t,!0,23,4)},m.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),h.read(this,t,!1,23,4)},m.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),h.read(this,t,!0,52,8)},m.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),h.read(this,t,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigUInt64LE=at((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeBigUInt64BE=at((function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o|0)-s&255;return e+r},m.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},m.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},m.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},m.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},m.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},m.prototype.writeBigInt64LE=at((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeBigInt64BE=at((function(t){return V(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},m.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},m.prototype.writeDoubleLE=function(t,e,r){return G(this,t,e,!0,r)},m.prototype.writeDoubleBE=function(t,e,r){return G(this,t,e,!1,r)},m.prototype.copy=function(t,e,r,n){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function X(t,e,r,n,i,a){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new Z.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||J(e,t.length-(r+1))}(n,i,a)}function $(t,e){if("number"!=typeof t)throw new Z.ERR_INVALID_ARG_TYPE(e,"number",t)}function J(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new Z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new Z.ERR_BUFFER_OUT_OF_BOUNDS;throw new Z.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}W("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),W("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(c(e))}),TypeError),W("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i)}),RangeError);var K=/[^+/0-9A-Za-z-_]/g;function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function tt(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function et(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function rt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function nt(t){return t!=t}var it=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function at(t){return"undefined"==typeof BigInt?ot:t}function ot(){throw new Error("BigInt not supported")}},9216:function(t){t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var a=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!a&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(t,e,r){t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),f=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new o({turntable:u,orbit:h,matrix:f},c)};var n=r(7261),i=r(9977),a=r(1811);function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r0?o-4:o;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],o=16383,s=0,c=n-i;sc?c:s+o));return 1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var i,a,o=[],s=e;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},1318:function(t){t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},8697:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},7842:function(t,e,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);t.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,h=0;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=a(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(t,e,r){var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(t,e,r){r(6859),t.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},2651:function(t,e,r){var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},6768:function(t,e,r){var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(f=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):c*(f*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(t){function e(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function r(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,a){return o(t,r,n,i,a,e)},gt:function(t,e,n,i,a){return o(t,e,n,i,a,r)},lt:function(t,e,r,i,a){return o(t,e,r,i,a,n)},le:function(t,e,r,n,a){return o(t,e,r,n,a,i)},eq:function(t,e,r,n,i){return o(t,e,r,n,i,a)}}},8828:function(t,e){function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,f=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],p=f[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],_=8191&x,b=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],C=8191&E,I=E>>>13,L=0|o[7],P=8191&L,z=L>>>13,D=0|o[8],O=8191&D,R=D>>>13,F=0|o[9],j=8191&F,B=F>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,Z=0|s[2],W=8191&Z,Y=Z>>>13,X=0|s[3],$=8191&X,J=X>>>13,K=0|s[4],Q=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var yt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((a=a+Math.imul(f,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,V))+Math.imul(b,U)|0,a=Math.imul(b,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,Y)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Y)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,J)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,J)|0;var _t=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,Q)|0))<<13)|0;c=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,J)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,tt)|0;var bt=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,nt)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,V))+Math.imul(B,U)|0,a=Math.imul(B,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(z,W)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,ot)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,lt)|0,a=a+Math.imul(v,ct)|0,n=n+Math.imul(d,ht)|0,i=(i=i+Math.imul(d,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var At=(c+(n=n+Math.imul(h,dt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,dt)|0))<<13)|0;c=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,G))+Math.imul(B,H)|0,a=Math.imul(B,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(I,Q)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(b,lt)|0,a=a+Math.imul(b,ct)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(v,ht)|0,a=a+Math.imul(v,ft)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(j,W),i=(i=Math.imul(j,Y))+Math.imul(B,W)|0,a=Math.imul(B,Y),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(b,ht)|0,a=a+Math.imul(b,ft)|0;var St=(c+(n=n+Math.imul(y,dt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,dt)|0))<<13)|0;c=((a=a+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,J))+Math.imul(B,$)|0,a=Math.imul(B,J),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(c+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,mt)|0)+Math.imul(b,dt)|0))<<13)|0;c=((a=a+Math.imul(b,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(B,Q)|0,a=Math.imul(B,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Ct=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(B,rt)|0,a=Math.imul(B,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ct)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(I,ht)|0,a=a+Math.imul(I,ft)|0;var It=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,at),i=(i=Math.imul(j,ot))+Math.imul(B,at)|0,a=Math.imul(B,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(z,ht)|0,a=a+Math.imul(z,ft)|0;var Lt=(c+(n=n+Math.imul(C,dt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(I,dt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,lt),i=(i=Math.imul(j,ct))+Math.imul(B,lt)|0,a=Math.imul(B,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(R,ht)|0,a=a+Math.imul(R,ft)|0;var Pt=(c+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(z,dt)|0))<<13)|0;c=((a=a+Math.imul(z,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(B,ht)|0,a=Math.imul(B,ft);var zt=(c+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Dt=(c+(n=Math.imul(j,dt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(B,dt)|0))<<13)|0;return c=((a=Math.imul(B,mt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,l[0]=gt,l[1]=yt,l[2]=vt,l[3]=xt,l[4]=_t,l[5]=bt,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Ct,l[14]=It,l[15]=Lt,l[16]=Pt,l[17]=zt,l[18]=Dt,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=p),a.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?p(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):this.negative&t.negative?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,p=1;!(e.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;!(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;!(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,f=1;!(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(x,v),x.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,a=o}a>>>=22,t.words[i-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new _;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(!(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,T),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){t.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var h,f=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,f,p))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,f,p,0,s,f,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,f,p,0,c,d,m):o(u,r,n,s,f,p,c,d,m),i.free(d),i.free(m))}i.free(f),i.free(p)}return h}}}function u(t,e){n.push([t,e])}},2455:function(t,e){function r(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=n,p=h*n;fc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var h=2*t,f=n,p=h*n;f0;){var D=(P-=1)*_,O=w[D],R=w[D+1],F=w[D+2],j=w[D+3],B=w[D+4],N=w[D+5],U=P*b,V=T[U],q=T[U+1],H=1&N,G=!!(16&N),Z=u,W=S,Y=C,X=I;if(H&&(Z=C,W=I,Y=u,X=S),!(2&N&&R>=(F=g(t,O,R,F,Z,W,q))||4&N&&(R=y(t,O,R,F,Z,W,V))>=F)){var $=F-R,J=B-j;if(G){if(t*$*($+J)=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo>>1,f=2*t,p=h,d=s[f*h+e];c=x?(p=v,d=x):y>=b?(p=g,d=y):(p=_,d=b):x>=b?(p=v,d=x):b>=y?(p=g,d=y):(p=_,d=b);for(var w=f*(u-1),T=f*p,k=0;kr&&i[h+e]>c;--u,h-=o){for(var f=h,p=h+o,d=0;df;++f,l+=s)if(i[l+h]===o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lof;++f,l+=s)if(i[l+h]p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,f=r;n>f;++f,l+=s)if(i[l+h]<=o)if(u===f)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[f];a[f]=a[u],a[u++]=m}return u},"lop;++p,l+=s){var d=i[l+h],m=i[l+f];if(dg;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,h=e,f=t+e,p=r;n>p;++p,l+=s){var d=i[l+h],m=i[l+f];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[p];a[p]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,h=r,f=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+f],g=i[c+p];if(!(m>=o||s>=g))if(h===d)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[d];a[d]=a[h],a[h++]=x}}return h}}},4192:function(t){t.exports=function(t,n){n<=4*e?r(0,n-1,t):c(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function l(t,e,r,n){var i=n[t*=2];return i>1,g=m-f,y=m+f,v=p,x=g,_=m,b=y,w=d,T=t+1,k=u-1,A=0;s(v,x,h)&&(A=v,v=x,x=A),s(b,w,h)&&(A=b,b=w,w=A),s(v,_,h)&&(A=v,v=_,_=A),s(x,_,h)&&(A=x,x=_,_=A),s(v,b,h)&&(A=v,v=b,b=A),s(_,b,h)&&(A=_,_=b,b=A),s(x,w,h)&&(A=x,x=w,w=A),s(x,_,h)&&(A=x,x=_,_=A),s(b,w,h)&&(A=b,b=w,w=A);for(var M=h[2*x],S=h[2*x+1],E=h[2*b],C=h[2*b+1],I=2*v,L=2*_,P=2*w,z=2*p,D=2*m,O=2*d,R=0;R<2;++R){var F=h[I+R],j=h[L+R],B=h[P+R];h[z+R]=F,h[D+R]=j,h[O+R]=B}i(g,t,h),i(y,u,h);for(var N=T;N<=k;++N)if(l(N,M,S,h))N!==T&&n(N,T,h),++T;else if(!l(N,E,C,h))for(;;){if(l(k,E,C,h)){l(k,M,S,h)?(a(N,T,k,h),++T,--k):(n(N,k,h),--k);break}if(--k>>1;a(d,S);var E=0,C=0;for(T=0;T=o)m(u,h,C--,I=I-o|0);else if(I>=0)m(l,c,E--,I);else if(I<=-o){I=-I-o|0;for(var L=0;L>>1;a(d,E);var C=0,I=0,L=0;for(k=0;k>1==d[2*k+3]>>1&&(z=2,k+=1),P<0){for(var D=-(P>>1)-1,O=0;O>1)-1,0===z?m(l,c,C--,D):1===z?m(u,h,I--,D):2===z&&m(f,p,L--,D)}},scanBipartite:function(t,e,r,n,i,s,u,h,f,p,y,v){var x=0,_=2*t,b=e,w=e+t,T=1,k=1;n?k=o:T=o;for(var A=i;A>>1;a(d,C);var I=0;for(A=0;A=o?(P=!n,M-=o):(P=!!n,M-=1),P)g(l,c,I++,M);else{var z=v[M],D=_*M,O=y[D+e+1],R=y[D+e+1+t];t:for(var F=0;F>>1;a(d,T);var k=0;for(x=0;x=o)l[k++]=_-o;else{var M=p[_-=1],S=g*_,E=f[S+e+1],C=f[S+e+1+t];t:for(var I=0;I=0;--I)if(l[I]===_){for(D=I+1;D0;){for(var p=r.pop(),d=(u=-1,h=-1,l=o[s=r.pop()],1);d=0||(e.flip(s,p),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,p,u),i(t,e,r,p,u,h))}}},5023:function(t,e,r){var n=r(2478);function i(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-o){c[p]=o,u[p];for(var d=0;d<3;++d){var m=f[3*p+d];m>=0&&0===c[m]&&(h[3*p+d]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var y=function(t,e,r){for(var n=0,i=0;i1&&i(r[f[p-2]],r[f[p-1]],a)>0;)t.push([f[p-1],f[p-2],o]),p-=1;f.length=p,f.push(o);var d=h.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function y(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],_=x[0],b=x[1],w=t[_],T=t[b];if((w[0]-T[0]||w[1]-T[1])<0){var k=_;_=b,b=k}x[0]=_;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,A]):e.push([M,E]),M=E}i?e.push([M,b,A]):e.push([M,b])}return f}(t,e,f,g,r),x=d(t,v);return y(e,x,r),!!x||f.length>0||g.length>0}},3637:function(t,e,r){t.exports=function(t,e,r,n){var a=s(e,t),h=s(n,r),f=u(a,h);if(0===o(f))return null;var p=s(t,r),d=u(h,p),m=i(d,f),g=c(a,m);return l(t,g)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){var n=r(3642),i=r(395);function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,c,u,h,f,p,d,m;if(t||(t={}),p=(t.nshades||72)-1,f=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>p+1)throw new Error(h+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),y=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(t){t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,a=t.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var o=t[0]+t[1],s=n[0]+n[1];if(a=o+t[2]-(s+n[2]))return a;var l=e(t[0],t[1]),c=e(n[0],n[1]);return e(l,t[2])-e(c,n[2])||e(l+t[2],o)-e(c+n[2],s);case 4:var u=t[0],h=t[1],f=t[2],p=t[3],d=n[0],m=n[1],g=n[2],y=n[3];return u+h+f+p-(d+m+g+y)||e(u,h,f,p)-e(d,m,g,y,d)||e(u+h,u+f,u+p,h+f,h+p,f+p)-e(d+m,d+g,d+y,m+g,m+y,g+y)||e(u+h+f,u+h+p,u+f+p,h+f+p)-e(d+m+g,d+m+y,d+g+y,m+g+y);default:for(var v=t.slice().sort(r),x=n.slice().sort(r),_=0;_t[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},4750:function(t,e,r){t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){t.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+h*r[p]+f*n[p];return a}return c*t+u*e+h*r+f*n},t.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},7642:function(t,e,r){var n=r(8954),i=r(1682);function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0})):b.filter((function(t){for(var e=0;e<=s;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(u=0;u>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){function e(t,r,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){f=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var p=a(c[f-1],u[f-1],arguments[f]);n.push(p),i.push((p-n[o++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var p=arguments[f];n.push(a(l[f-1],c[f-1],n[o++]+p)),i.push(p*h)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(t){function e(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function a(t,e){this._compare=t,this.root=e}t.exports=function(t){return new a(t||p,null)};var o=a.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function u(t,e){this.tree=t,this._stack=e}Object.defineProperty(o,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(o,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(t,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(t,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new e(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new e(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var f=l[h-1];if(s=l[h],1===f._color||1===s._color)break;var p=l[h-2];if(p.left===f)if(f.left===s){if(!(d=p.right)||0!==d._color){p._color=0,p.left=f.right,f._color=1,f.right=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).left===p?m.left=f:m.right=f);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else{if(!(d=p.right)||0!==d._color){f.right=s.left,p._color=0,p.left=s.right,s._color=1,s.left=f,s.right=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).left===p?m.left=s:m.right=s);break}f._color=1,p.right=n(1,d),p._color=0,h-=1}else if(f.right===s){if(!(d=p.left)||0!==d._color){p._color=0,p.right=f.left,f._color=1,f.left=p,l[h-2]=f,l[h-1]=s,i(p),i(f),h>=3&&((m=l[h-3]).right===p?m.right=f:m.left=f);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;f.left=s.right,p._color=0,p.right=s.left,s._color=1,s.right=f,s.left=p,l[h-2]=s,l[h-1]=f,i(p),i(f),i(s),h>=3&&((m=l[h-3]).right===p?m.right=s:m.left=s);break}f._color=1,p.left=n(1,d),p._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new u(this,t)}}),Object.defineProperty(o,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),o.at=function(t){if(t<0)return new u(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new u(this,[])},o.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(t){var e=this.find(t);return e?e.remove():this},o.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var o=new Array(t.length),s=t[t.length-1];o[o.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?o[l]=new e(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new e(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new e(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((a=t[l-1]).left===e){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,e._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),void(t[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).left===a?c.left=s:c.right=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).left===a?c.left=o:c.right=o),t[l-1]=o,t[l]=a,l+11&&((c=t[l-2]).right===a?c.right=o:c.left=o),void(t[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,e._color=1,i(a),i(o),i(s),l>1&&((c=t[l-2]).right===a?c.right=s:c.left=s),void(t[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=t[l-2]).right===a?c.right=o:c.left=o),t[l-1]=o,t[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new e(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new e(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){t.exports=function(t,e){var r=new p(t);return r.update(e),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(t){return Array.isArray(t)||function(t){return c.isView(t)&&!(t instanceof u)}(t)}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function p(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var d=p.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(h(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,f=!1;if("bounds"in t)for(var p=t.bounds,d=0;d<2;++d)for(var m=0;m<3;++m)p[d][m]!==this.bounds[d][m]&&(f=!0),this.bounds[d][m]=p[d][m];if("ticks"in t)for(r=t.ticks,u=!0,this.autoTicks=!1,d=0;d<3;++d)this.tickSpacing[d]=0;else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(d=0;d<3;++d)r[d].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var h=a,f=s,p=o,d=l;c&1<0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var _=[0,0,0],b=[0,0,0],w=[0,0,0];d.draw=function(t){t=t||x;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,p=n[12],d=n[13],m=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*p+i[7]*d+i[11]*m+i[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=u[A],this.lastCubeProps.axis[A]=h[A];var M=g;for(A=0;A<3;++A)y(g[A],A,this.bounds,u,h);e=this.gl;var S,E,C,I,L,P,z,D,O,R,F,j,B=v;for(A=0;A<3;++A)this.backgroundEnable[A]?B[A]=h[A]:B[A]=0;for(this._background.draw(r,n,i,a,B,this.backgroundColor),this._lines.bind(r,n,i,this),A=0;A<3;++A){var N=[0,0,0];h[A]>0?N[A]=a[1][A]:N[A]=a[0][A];for(var U=0;U<2;++U){var V=(A+1+U)%3,q=(A+1+(1^U))%3;this.gridEnable[V]&&this._lines.drawGrid(V,q,this.bounds,N,this.gridColor[V],this.gridWidth[V]*this.pixelRatio)}for(U=0;U<2;++U)V=(A+1+U)%3,q=(A+1+(1^U))%3,this.zeroEnable[q]&&Math.min(a[0][q],a[1][q])<=0&&Math.max(a[0][q],a[1][q])>=0&&this._lines.drawZero(V,q,this.bounds,N,this.zeroLineColor[q],this.zeroLineWidth[q]*this.pixelRatio)}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var H=f(_,M[A].primalMinor),G=f(b,M[A].mirrorMinor),Z=this.lineTickLength;for(U=0;U<3;++U){var W=k/r[5*U];H[U]*=Z[U]*W,G[U]*=Z[U]*W}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,H,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,G,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}function Y(t){(C=[0,0,0])[t]=1}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),A=0;A<3;++A){var X=M[A].primalMinor,$=M[A].mirrorMinor,J=f(w,M[A].primalOffset);for(U=0;U<3;++U)this.lineTickEnable[A]&&(J[U]+=k*X[U]*Math.max(this.lineTickLength[U],0)/r[5*U]);var K=[0,0,0];if(K[A]=1,this.tickEnable[A]){for(-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,E=1,"auto"===(S=[this.tickAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),C=[0,0,0],P=$,z=void 0,D=void 0,O=void 0,R=void 0,F=void 0,j=void 0,D=((I=A)+2)%3,O=(L=X)[z=(I+1)%3],R=L[D],F=P[z],j=P[D],O>0&&j>0||O>0&&j<0||O<0&&j>0||O<0&&j<0?Y(z):(R>0&&F>0||R>0&&F<0||R<0&&F>0||R<0&&F<0)&&Y(D),U=0;U<3;++U)J[U]+=k*X[U]*this.tickPad[U]/r[5*U];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],J,this.tickColor[A],K,C,S)}if(this.labelEnable[A]){for(E=0,C=[0,0,0],this.labels[A].length>4&&(Y(A),E=1),"auto"===(S=[this.labelAlign[A],.5,E])[0]?S[0]=0:S[0]=parseInt(""+S[0]),U=0;U<3;++U)J[U]+=k*X[U]*this.labelPad[U]/r[5*U];J[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],J,this.labelColor[A],[0,0,0],C,S)}}this._text.unbind()},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=p,f[l]=p;for(var d=-1;d<=1;d+=2){h[c]=d;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=g}var y=n(t,new Float32Array(e)),v=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:y,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:t.FLOAT,size:3,offset:12,stride:24}],v),_=a(t);return _.attributes.position.location=0,_.attributes.normal.location=1,new o(t,y,x,_)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){t.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var _=0;_<2;++_){u[1]=a[_][1];for(var b=0;b<2;++b)u[0]=a[b][0],f(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x)(B=R^1<c[j][0]&&(j=B))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(F^R)]=R&F,N[n.log2(R^j)]=R&j;var U=7^j;U===w||U===O?(U=7^F,N[n.log2(j^U)]=U&j):N[n.log2(F^U)]=U&F;var V=g,q=w;for(A=0;A<3;++A)V[A]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){t.exports=function(t,e,r,a,s,l){var u=n(t),h=i(t,[{buffer:u,size:3}]),f=o(t);f.attributes.position.location=0;var p=new c(t,f,u,h);return p.update(e,r,a,s,l),p};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||process.global||{},l=s.__TEXT_CACHE||{};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var u=c.prototype,h=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[e];h||(h=u[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,p=h.positions,d=h.cells,m=0,g=d.length;m=0;--v){var x=p[y[v]];o.push(f*x[0],-f*x[1],t)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){h[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),f[d]=(o.length/3|0)-h[d],c[d]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:r(e[i],o)});n.push(a)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},6405:function(t,e,r){var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,f=-1/0,p=null,d=null,m=[],g=1/0,y=!1,v="raw"===t.coneSizemode,x=0;xo&&(o=n.length(b)),x&&!v){var w=2*n.distance(p,_)/(n.length(d)+n.length(b));w?(g=Math.min(g,w),y=!1):y=!0}y||(p=_,d=b),m.push(b)}var T=[s,c,h],k=[l,u,f];e&&(e[0]=T,e[1]=k),0===o&&(o=1);var A=1/o;isFinite(g)||(g=1),a.vectorScale=g;var M=t.coneSize||(v?1:.5);t.absoluteConeSize&&(M=t.absoluteConeSize*A),a.coneScale=M,x=0;for(var S=0;x=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var f=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),u=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),h=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=t.LINEAR_MIPMAP_LINEAR,h.magFilter=t.LINEAR;var p=i(t),d=i(t),m=i(t),g=i(t),y=i(t),v=new f(t,h,l,u,p,d,y,m,g,a(t,[{buffer:p,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:d,type:t.FLOAT,size:4}]),r.traceType||"cone");return v.update(e),v}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){t.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],a=0;a0&&((p=u.slice())[s]+=d[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,p[0],p[1],p[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,p),o+=2+h(i,p,m,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&h>0&&p&&(f=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new d(t,e,r,f,h,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?d?t.depth=f(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=f(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,a,o,null,l)},e.createPickShader=function(t){return i(t,a,s,null,l)}},5714:function(t,e,r){t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new y(e,r,o,s,l,d);return m.update(t),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,f=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function y(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],f=t.position||t.positions;if(f){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],_[r],b[r]),h[1][r]=Math.max(h[1][r],_[r],b[r])}Array.isArray(p[0])?(y=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],v=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):y=v=p,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(_,b),g){for(r=0;r<2;++r)i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(_[0],_[1],_[2],b[0],b[1],b[2],T,x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],T,-x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],s,-x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(f[f.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[f,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:f,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),f=r(7765),p=r(1888),d=r(840),m=r(7626),g=d.meshShader,y=d.wireShader,v=d.pointShader,x=d.pickShader,_=d.pointPickShader,b=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,T,k,A,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=b,this.pointUVs=T,this.pointSizes=k,this.pointIds=_,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=f(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;aMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),f=r(4040),p=r(799),d=r(9216)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d})),!r)throw new Error("webgl not supported");var v=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,_=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),b=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=i(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],C=[],I=[],L=[],P=!0,z=!0,D=new Array(16),O=new Array(16),R={view:null,projection:D,model:O,_ortho:!1},F=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),j=t.cameraObject||n(e,T),B={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:j,axes:A,axesPixels:null,spikes:S,bounds:v,objects:E,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,z=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},N=[r.drawingBufferWidth/B.pixelRatio|0,r.drawingBufferHeight/B.pixelRatio|0];function U(){if(!B._stopped&&B.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*B.pixelRatio),a=0|Math.ceil(n*B.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",P=!0}}}function V(){for(var t=E.length,e=L.length,n=0;n0&&0===I[e-1];)I.pop(),L.pop().dispose()}function q(){if(B.contextLost)return!0;r.isContextLost()&&(B.contextLost=!0,B.mouseListener.enabled=!1,B.selection.object=null,B.oncontextloss&&B.oncontextloss())}B.autoResize&&U(),window.addEventListener("resize",U),B.update=function(t){B._stopped||(t=t||{},P=!0,z=!0)},B.add=function(t){B._stopped||(t.axes=A,E.push(t),C.push(-1),P=!0,z=!0,V())},B.remove=function(t){if(!B._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),C.pop(),P=!0,z=!0,V())}},B.dispose=function(){if(!B._stopped&&(B._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",q),B.mouseListener.enabled=!1,!B.contextLost)){A.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*h+l*m,t[3]=s*f+l*g,t}},5964:function(t){t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){var n=r(4359);t.exports=function(t,e,r){var a=[e.style,e.weight,e.variant,e.family].join("_"),o=i[a];if(o||(o=i[a]={}),t in o)return o[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var c,u,h=n(t,s);if(r&&1!==r){for(c=0;c max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},f={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return y(t,h)},e.createOrtho=function(t){return y(t,f)},e.createProject=function(t){return y(t,p)},e.createPickPerspective=function(t){return y(t,d)},e.createPickOrtho=function(t){return y(t,m)},e.createPickProject=function(t){return y(t,g)}},8418:function(t,e,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=ArrayBuffer,p=DataView;function d(t){return Array.isArray(t)||function(t){return f.isView(t)&&!(t instanceof p)}(t)}function m(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function g(t,e,r,n){return m(n,n),m(n,n),m(n,n)}function y(t,e){this.index=t,this.dataCoordinate=this.position=e}function v(t){return!0===t||t>1?1:t}function x(t,e,r,n,i,a,o,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),f=i(e),p=i(e),d=i(e),m=a(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:f,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),g=new x(e,r,n,o,h,f,p,d,m,s,c,u);return g.update(t),g};var _=x.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},_.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var b=[0,0],w=[0,0,0],T=[0,0,0],k=[0,0,0,1],A=[0,0,0,1],M=h.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]];function C(t){return t[0]=t[1]=t[2]=0,t}function I(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function L(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function P(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,f=r.projection||h,p=e.axesBounds,d=function(t){for(var e=E,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=f,l.screenSize=b,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=d,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var y=M,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=p[0][m]:y[12+m]=p[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,_=(m+2)%3,P=C(w),z=C(T);P[x]=1,z[_]=1;var D=g(0,0,0,I(k,P)),O=g(0,0,0,I(A,z));if(Math.abs(D[1])>Math.abs(O[1])){var R=D;D=O,O=R,R=P,P=z,z=R;var F=x;x=_,_=F}D[0]<0&&(P[x]=-1),O[1]>0&&(z[_]=-1);var j=0,B=0;for(v=0;v<4;++v)j+=Math.pow(c[4*x+v],2),B+=Math.pow(c[4*_+v],2);P[x]/=Math.sqrt(j),z[_]/=Math.sqrt(B),l.axes[0]=P,l.axes[1]=z,l.fragClipBounds[0]=L(S,d[0],m,-1e8),l.fragClipBounds[1]=L(S,d[1],m,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var z=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&P(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,b[0]=2/s.drawingBufferWidth,b[1]=2/s.drawingBufferHeight,l.screenSize=b,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=z,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function O(t,e,r,i){var a;a=d(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(d(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(d(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){d(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=v(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n0){var z=0,D=_,R=[0,0,0,1],F=[0,0,0,1],j=d(p)&&d(p[0]),B=d(y)&&d(y[0]);t:for(n=0;n0?1-S[0][0]:W<0?1+S[1][0]:1,Y*=Y>0?1-S[0][1]:Y<0?1+S[1][1]:1],$=A.cells||[],J=A.positions||[];for(k=0;k<$.length;++k)for(var K=$[k],Q=0;Q<3;++Q){for(var tt=0;tt<3;++tt)C[3*z+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*z+tt]=R[tt];P[z]=x;var et=J[K[Q]];L[2*z]=q*(G*et[0]-Z*et[1]+X[0]),L[2*z+1]=q*(Z*et[0]+G*et[1]+X[1]),z+=1}for($=M.edges,J=M.positions,k=0;k<$.length;++k)for(K=$[k],Q=0;Q<2;++Q){for(tt=0;tt<3;++tt)C[3*D+tt]=T[tt];for(tt=0;tt<4;++tt)I[4*D+tt]=F[tt];P[D]=x,et=J[K[Q]],L[2*D]=q*(G*et[0]-Z*et[1]+X[0]),L[2*D+1]=q*(Z*et[0]+G*et[1]+X[1]),D+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=_,this.lineVertexCount=b,this.pointBuffer.update(C),this.colorBuffer.update(I),this.glyphBuffer.update(L),this.idBuffer.update(P),o.free(C),o.free(I),o.free(L),o.free(P)},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(t,e,r){t.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A=0;)M+=1;b[v]=M}var S=new Array(r.length);function E(){f.program=o.program(p,f._vref,f._fref,_,b);for(var t=0;t=0){if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);s(t,e,p[0],i,d,a,h)}else{if(!(f.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+f);var d;if((d=f.charCodeAt(f.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+h+": "+f);l(t,e,p,i,d,a,h)}}}return a};var n=r(8866);function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+y+"fv"](s[h],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](s[h],f);break;case"v":t["uniform"+y+"fv"](s[h],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(t,e,n){if("object"==typeof n){var c=h(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(u=n,function(t,e,r){return t.getUniform(e.program,r[u])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var u}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(f[T],p[T],p[k],p[k],f[k],f[T]),h.push(v,y,y,y,v,v),d.push(m,g,g,g,m,m);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=f;f=p,p=M;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:d}}(t,r,a,o)})),h=[],f=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nh-1||v>f-1||x>p-1)return n.create();var _,b,w,T,k,A,M=a[0][d],S=a[0][y],E=a[1][m],C=a[1][v],I=a[2][g],L=(o-M)/(S-M),P=(c-E)/(C-E),z=(u-I)/(a[2][x]-I);switch(isFinite(L)||(L=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(d=h-1-d,y=h-1-y),r.reversedY&&(m=f-1-m,v=f-1-v),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,A=x,w=m*p,T=v*p,_=d*p*f,b=y*p*f;break;case 4:k=g,A=x,_=d*p,b=y*p,w=m*p*h,T=v*p*h;break;case 3:w=m,T=v,k=g*f,A=x*f,_=d*f*p,b=y*f*p;break;case 2:w=m,T=v,_=d*f,b=y*f,k=g*f*h,A=x*f*h;break;case 1:_=d,b=y,k=g*h,A=x*h,w=m*h*p,T=v*h*p;break;default:_=d,b=y,w=m*h,T=v*h,k=g*h*f,A=x*h*f}var D=i[_+w+k],O=i[_+w+A],R=i[_+T+k],F=i[_+T+A],j=i[b+w+k],B=i[b+w+A],N=i[b+T+k],U=i[b+T+A],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,D,j,L),n.lerp(q,O,B,L),n.lerp(H,R,N,L),n.lerp(G,F,U,L);var Z=n.create(),W=n.create();n.lerp(Z,V,H,P),n.lerp(W,q,G,P);var Y=n.create();return n.lerp(Y,Z,W,z),Y}(e,t,p)},x=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=v(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=v(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=v(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},_=[],b=e[0][0],w=e[0][1],T=e[0][2],k=e[1][0],A=e[1][1],M=e[1][2],S=10*n.distance(e[0],e[1])/i,E=S*S,C=1,I=0,L=r.length;L>1&&(C=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lI&&(I=N),j.push(N),_.push({points:D,velocities:O,divergences:j});for(var U=0;U<100*i&&D.lengthk||gA||yM));){U++;var V=n.clone(R),q=n.squaredLength(V);if(0===q)break;q>E&&n.scale(V,V,S/Math.sqrt(q)),n.add(V,V,z),R=v(V),n.squaredDistance(F,V)-E>-1e-4*E&&(D.push(V),F=V,O.push(R),B=x(V,R),N=n.length(B),isFinite(N)&&N>I&&(I=N),j.push(N)),z=V}}var H=o(_,t.colormap,I,C);return h?H.tubeScale=h:(0===I&&(I=1),H.tubeScale=.5*u*C/I),H};var u=r(6740),h=r(6405).createMesh;t.exports.createTubeMesh=function(t,e){return h(t,e,{shaders:u,traceType:"streamtube"})}},990:function(t,e,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){t.exports=function(t){var e=t.gl,r=v(e),n=_(e),s=x(e),l=b(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(e),f=a(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,S,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new E(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,f,p,d,[0,0,0]),y={levels:[[],[],[]]};for(var T in t)y[T]=t[T];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),f=r(3711),p=r(6760),d=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,_=y.createPickShader,b=y.createPickContourShader,w=40,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function M(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=A[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function E(t,e,r,n,i,a,o,l,c,u,f,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new M([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:S,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(t){this.pickId=t};var I=[0,0,0],L={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function P(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||I,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},D=T.slice(),O=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=t.model||T,n.view=t.view||T,n.projection=t.projection||T,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=O,n.vertexColor=this.vertexColor;var s=D;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=P(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var f=this._contourVAO;for(f.bind(),i=0;i<3;++i)for(h.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var p=i+u,d=s+f,g=h*(f?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(p,d)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]Math.abs(b-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},C.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=j(t.contourWidth,Number)),"showContour"in t&&(this.showContour=j(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=j(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=N(t.contourColor)),"contourProject"in t&&(this.contourProject=j(t.contourProject,(function(t){return j(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=N(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=j(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=j(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=h(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=h(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)K.pop();U-=1}continue t}K.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var _t=s.mallocFloat(K.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=d(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var h,p,g=0;if(2===o.length)g=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=t.ALPHA;else if(2===o[2])g=t.LUMINANCE_ALPHA;else if(3===o[2])g=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var y=e.size;if(l)h=0===e.offset&&e.data.length===y?e.data:e.data.subarray(e.offset,e.offset+y);else{var v=[o[2],o[2]*o[0],1];p=a.malloc(y,r);var x=n(p,o,v,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):u(x,e),h=p.subarray(0,y)}var _=m(t);return t.texImage2D(t.TEXTURE_2D,0,g,o[0],o[1],0,g,c,h),l||a.free(p),new f(t,_,o[0],o[1],g,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function f(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=f.prototype;function d(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new f(t,o,e,r,n,i)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,h){var f=h.dtype,p=h.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=d(p,h.stride.slice());if("float32"===f?m=t.FLOAT:"float64"===f?(m=t.FLOAT,y=!1,f="float32"):"uint8"===f?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,y=!1,f="uint8"),2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],h=n(h.data,p,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var _;_=l===t.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var b=n(_,p,[p[2],p[2]*p[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(b,h):i.assign(b,h),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,_.subarray(0,v)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,_.subarray(0,v)),l===t.FLOAT?a.freeFloat32(_):a.freeUint8(_)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},1433:function(t){t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,a,o){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+h*-l-f*-s,t[1]=h*c+p*-s+f*-o-u*-l,t[2]=f*c+p*-l+u*-s-h*-o,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return B(r),L+=r.length,(S=S.slice(r.length)).length}}function W(){return/[^a-fA-F0-9]/.test(e)?(B(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function Y(){return"."===e||/[eE]/.test(e)?(S.push(e),M=m,r=e,k+1):"x"===e&&1===S.length&&"0"===S[0]?(M=b,S.push(e),r=e,k+1):/[^\d]/.test(e)?(B(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function X(){return"f"===e&&(S.push(e),r=e,k+=1),/[eE]/.test(e)?(S.push(e),r=e,k+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(B(S.join("")),M=l,k):(S.push(e),r=e,k+1)}function $(){if(/[^\d\w_]/.test(e)){var t=S.join("");return M=j[t]?v:F[t]?y:g,B(S.join("")),M=l,k}return S.push(e),r=e,k+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,f=2,p=3,d=4,m=5,g=6,y=7,v=8,x=9,_=10,b=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}},8954:function(t,e,r){t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),f=h.adjacent,p=new Array(i+2);for(u=0;u<=i;++u){for(var d=l.slice(),m=0;m<=i;++m)m===u&&(d[m]=-1);var g=d[0];d[0]=d[1],d[1]=g;var y=new a(d,new Array(i+1),!0);f[u]=y,p[u]=y}for(p[i+1]=h,u=0;u<=i;++u){d=f[u].vertices;var v=f[u].adjacent;for(m=0;m<=i;++m){var x=d[m];if(x<0)v[m]=h;else for(var _=0;_<=i;++_)f[_].vertices.indexOf(x)<0&&(v[m]=f[_])}}var b=new c(i,o,p),w=!!e;for(u=i+1;u0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var p=this.orient();if(a[u]=f,p<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var p=(e=h.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=d[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,_=0;_<=n;++_)v[_]<0?(x=_,l[_]=t):l[_]=i[v[_]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var b=y.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var A=b.indexOf(e);if(!(A<0))for(b[A]=k,T[m]=y,w[g]=-1,T[g]=e,d[g]=k,k.flip(),_=0;_<=n;++_){var M=w[_];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,C=0;C<=n;++C){var I=w[C];I<0||C===_||(S[E++]=I)}f.push(new o(S,k,_))}}}}}for(f.sort(s),g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},3352:function(t,e,r){var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new y(g(t)):new y(null)};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function f(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):f(this.leftPoints,e);var r},a.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?h(this.rightPoints,t,r):f(this.leftPoints,r)};var v=y.prototype;v.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},v.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},v.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},v.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(t){t.exports=!0},7163:function(t){function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},5219:function(t){t.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0];function m(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,y){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,t))return!1;if(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var v,x,_,b,w,T,k,A=u[3],M=u[7],S=u[11],E=u[12],C=u[13],I=u[14],L=u[15];if(0!==A||0!==M||0!==S){if(f[0]=A,f[1]=M,f[2]=S,f[3]=L,!s(h,h))return!1;l(h,h),v=g,_=h,b=(x=f)[0],w=x[1],T=x[2],k=x[3],v[0]=_[0]*b+_[4]*w+_[8]*T+_[12]*k,v[1]=_[1]*b+_[5]*w+_[9]*T+_[13]*k,v[2]=_[2]*b+_[6]*w+_[10]*T+_[14]*k,v[3]=_[3]*b+_[7]*w+_[11]*T+_[15]*k}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=E,e[1]=C,e[2]=I,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(p,u),r[0]=c.length(p[0]),c.normalize(p[0],p[0]),i[0]=c.dot(p[0],p[1]),m(p[1],p[1],p[0],1,-i[0]),r[1]=c.length(p[1]),c.normalize(p[1],p[1]),i[0]/=r[1],i[1]=c.dot(p[0],p[2]),m(p[2],p[2],p[0],1,-i[1]),i[2]=c.dot(p[1],p[2]),m(p[2],p[2],p[1],1,-i[2]),r[2]=c.length(p[2]),c.normalize(p[2],p[2]),i[1]/=r[2],i[2]/=r[2],c.cross(d,p[1],p[2]),c.dot(p[0],d)<0)for(var P=0;P<3;P++)r[P]*=-1,p[P][0]*=-1,p[P][1]*=-1,p[P][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(y[0]=-y[0]),p[0][2]>p[2][0]&&(y[1]=-y[1]),p[1][0]>p[0][1]&&(y[2]=-y[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,h){if(0===o(e)||0===o(r))return!1;var f=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),p=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!f||!p||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());t.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},1811:function(t,e,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),f=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var d=p.prototype;d.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),p=!0;for(c=0;c<16;++c)f[c]=s[l++];var d=this.nextMatrix;for(c=0;c<16;++c)d[c]=s[l++],p=p&&f[c]===d[c];if(u<1e-6||p)for(c=0;c<16;++c)o[c]=f[c];else i(o,f,d,(t-e[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,_=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*_}},d.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i0;--p)r[h++]=s[p];return r};var n=r(3250)[3]},351:function(t,e,r){t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==a||l(s))&&(r=0|t,i=c||0,a=u||0,e&&e(r,i,a,o))}function u(t){c(0,t)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function f(t){l(t)&&e&&e(r,i,a,o)}function p(t){0===n.buttons(t)?c(0,t):c(r,t)}function d(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",d),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",f),t.addEventListener("keydown",f),t.addEventListener("keypress",f),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}g();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",d),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",f),t.removeEventListener("keydown",f),t.removeEventListener("keypress",f),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=t.clientX||0,o=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(t,e){function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var s=t.getters||[],l=new Array(a),c=0;c=0?l[c]=!0:l[c]=!1;return function(t,e,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,l)};var i={"false,0,1":function(t,e,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],f=a.data,p=0|a.offset,d=0|a.stride[0],m=0|a.stride[1],g=p,y=0|-d,v=0,x=0|-m,_=0,b=-d-m|0,w=0,T=0|d,k=m-d*u|0,A=0,M=0,S=0,E=2*u|0,C=n(E),I=n(E),L=0,P=0,z=-1,D=-1,O=0,R=0|-u,F=0|u,j=0,B=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(A=0;A0){if(M=1,C[L++]=r(f[g],o,s,l),g+=T,u>0)for(A=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],j=C[L+R],U=C[L+B],P===O&&P===j&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,O,j,U,o,s,l),V=I[L]=S++),L+=1,g+=T,A=2;A0)for(A=1,c=f[g],P=C[L]=r(c,o,s,l),O=C[L+z],j=C[L+R],U=C[L+B],P===O&&P===j&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,O,j,U,o,s,l),V=I[L]=S++,U!==j&&e(I[L+R],V,_,w,j,U,o,s,l)),L+=1,g+=T,A=2;A0){if(A=1,C[L++]=r(f[g],o,s,l),g+=T,h>0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),j=C[L+R],O=C[L+z],U=C[L+B],P===j&&P===O&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,j,O,U,o,s,l),V=I[L]=S++),L+=1,g+=T,M=2;M0)for(M=1,c=f[g],P=C[L]=r(c,o,s,l),j=C[L+R],O=C[L+z],U=C[L+B],P===j&&P===O&&P===U||(v=f[g+y],_=f[g+x],w=f[g+b],t(A,M,c,v,_,w,P,j,O,U,o,s,l),V=I[L]=S++,U!==j&&e(I[L+R],V,w,v,U,j,o,s,l)),L+=1,g+=T,M=2;M2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),t.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),t.pick(0,-1,1).lo(1).hi(a[1]-2)),e(t.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),t.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),e(t.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),t.pick(-1,0,0).lo(1).hi(a[0]-2)),e(t.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),t.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),e(t.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(a[0]-1,0,0,0),t.set(a[0]-1,0,1,0),t.set(0,a[1]-1,0,0),t.set(0,a[1]-1,1,0),t.set(a[0]-1,a[1]-1,0,0),t.set(a[0]-1,a[1]-1,1,0),t}}t.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(a=u[e])return a;for(var r=t.length,n=[h,f],i=1;i<=r;++i)n.push(p(i));var a=d.apply(void 0,n);return u[e]=a,a}(r)(t,e)}},4317:function(t){function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var _=0|t[1];_>0;){_<64?(c=_,_=0):(c=64,_-=64),n=y+x*h+_*f,o=v+x*d+_*m;var b=0,w=0,T=0,k=p,A=h-u*p,M=f-l*h,S=g,E=d-u*g,C=m-l*d;for(T=0;T0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=p+m*u+g*c,o=d+m*f+g*h;var y=0,v=0,x=u,_=c-l*u,b=f,w=h-l*f;for(v=0;v0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|t[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var _=0|t[1];_>0;){_<64?(l=_,_=0):(l=64,_-=64),n=g+v*f+x*u+_*h,o=y+v*m+x*p+_*d;var b=0,w=0,T=0,k=f,A=u-c*f,M=h-s*u,S=m,E=p-c*m,C=d-s*p;for(T=0;Tr;){y=0,v=m-o;e:for(g=0;g_)break e;v+=h,y+=f}for(y=m,v=m-o,g=0;g>1,H=q-N,G=q+N,Z=U,W=H,Y=q,X=G,$=V,J=i+1,K=a-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),at=e(nt);A=l*Z,M=l*W,B=s;t:for(k=0;k0){g=Z,Z=W,W=g;break t}if(rt<0)break t;B+=p}A=l*X,M=l*$,B=s;t:for(k=0;k0){g=X,X=$,$=g;break t}if(rt<0)break t;B+=p}A=l*Z,M=l*Y,B=s;t:for(k=0;k0){g=Z,Z=Y,Y=g;break t}if(rt<0)break t;B+=p}A=l*W,M=l*Y,B=s;t:for(k=0;k0){g=W,W=Y,Y=g;break t}if(rt<0)break t;B+=p}A=l*Z,M=l*X,B=s;t:for(k=0;k0){g=Z,Z=X,X=g;break t}if(rt<0)break t;B+=p}A=l*Y,M=l*X,B=s;t:for(k=0;k0){g=Y,Y=X,X=g;break t}if(rt<0)break t;B+=p}A=l*W,M=l*$,B=s;t:for(k=0;k0){g=W,W=$,$=g;break t}if(rt<0)break t;B+=p}A=l*W,M=l*Y,B=s;t:for(k=0;k0){g=W,W=Y,Y=g;break t}if(rt<0)break t;B+=p}A=l*X,M=l*$,B=s;t:for(k=0;k0){g=X,X=$,$=g;break t}if(rt<0)break t;B+=p}for(A=l*Z,M=l*W,S=l*Y,E=l*X,C=l*$,I=l*U,L=l*q,P=l*V,j=0,B=s,k=0;k0)){if(rt<0){for(A=l*_,M=l*J,S=l*K,B=s,k=0;k0)for(;;){for(b=s+K*l,j=0,k=0;k0)){for(b=s+K*l,j=0,k=0;kV){t:for(;;){for(b=s+J*l,j=0,B=s,k=0;k1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},446:function(t,e,r){var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},9618:function(t,e,r){var n=r(7163),i="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function o(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=a*(r=0|t),i-=r),new n(this.data,i,a,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"==typeof t&&((a=0|t)<0?(i+=r*(e-1),e=o(-e/a)):e=o(e/a),r*=a),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,a){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),a-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"==typeof e&&((l=0|e)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,a)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,a,o,s){this.data=t,this.shape=[e,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(a=0|t),o-=a),"number"==typeof e&&e>=0&&(i+=u*(a=0|e),s-=a),"number"==typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(t,e,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,f=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(u+=s*(i-1),i=f(-i/h)):i=f(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(u+=l*(a-1),a=f(-a/h)):a=f(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(o-1),o=f(-o/h)):o=f(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[e],i[r],a[t],a[e],a[r],this.offset)},i.pick=function(t,r,n){var i=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,e[i.length+1])(this.data,i,a,o)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3];return"number"==typeof t&&t>=0&&(a+=h*(o=0|t),s-=o),"number"==typeof e&&e>=0&&(a+=f*(o=0|e),l-=o),"number"==typeof r&&r>=0&&(a+=p*(o=0|r),c-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,f,p,d,a)},i.step=function(t,e,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],f=this.stride[3],p=this.offset,d=0,m=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(p+=c*(a-1),a=m(-a/d)):a=m(a/d),c*=d),"number"==typeof e&&((d=0|e)<0?(p+=u*(o-1),o=m(-o/d)):o=m(o/d),u*=d),"number"==typeof r&&((d=0|r)<0?(p+=h*(s-1),s=m(-s/d)):s=m(s/d),h*=d),"number"==typeof i&&((d=0|i)<0?(p+=f*(l-1),l=m(-l/d)):l=m(l/d),f*=d),new n(this.data,a,o,s,l,c,u,h,f,p)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],o[t],o[e],o[r],o[i],this.offset)},i.pick=function(t,r,n,i){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,e[a.length+1])(this.data,a,o,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,a,o,s,l,c,u,h){this.data=t,this.shape=[e,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(e,r,n,i,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],f=this.shape[4],p=this.stride[0],d=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof t&&t>=0&&(o+=p*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(o+=d*(s=0|e),c-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),f-=s),new n(this.data,l,c,u,h,f,p,d,m,g,y,o)},i.step=function(t,e,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],f=this.stride[1],p=this.stride[2],d=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof t&&((y=0|t)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"==typeof e&&((y=0|e)<0?(g+=f*(s-1),s=v(-s/y)):s=v(s/y),f*=y),"number"==typeof r&&((y=0|r)<0?(g+=p*(l-1),l=v(-l/y)):l=v(l/y),p*=y),"number"==typeof i&&((y=0|i)<0?(g+=d*(c-1),c=v(-c/y)):c=v(c/y),d*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,f,p,d,m,g)},i.transpose=function(t,e,r,i,a){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],o[a],s[t],s[e],s[r],s[i],s[a],this.offset)},i.pick=function(t,r,n,i,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,e[o.length+1])(this.data,o,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===a)for(a=0,s=0;s>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var _=i[c],b=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;_[x]+=b*(y[w]*m[T]-y[T]*m[w])}}}for(o=0;oa)for(b=1/Math.sqrt(k),x=0;x<3;++x)_[x]*=b;else for(x=0;x<3;++x)_[x]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(p):0,c=0;c<3;++c)f[c]*=p;i[o]=f}return i}},4081:function(t){t.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,c);h=Math.sqrt(2*f-u+1),e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},9977:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=c(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var f=h.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=l(u-=a*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*f,_=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*f);m/=_,g/=_,y/=_;var b=u*e+a*r,w=h*e+o*r,T=f*e+s*r;this.center.move(t,b,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],f=i[9],p=i[2],d=i[6],m=i[10],g=e*a+r*u,y=e*o+r*h,v=e*s+r*f,x=-(d*v-m*y),_=-(m*g-p*v),b=-(p*y-d*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(_,2)-Math.pow(b,2))),T=c(x,_,b,w);T>1e-6?(x/=T,_/=T,b/=T,w/=T):(x=_=b=0,w=1);var k=this.computedRotation,A=k[0],M=k[1],S=k[2],E=k[3],C=A*w+E*x+M*b-S*_,I=M*w+E*_+S*x-A*b,L=S*w+E*b+A*_-M*x,P=E*w-A*x-M*_-S*b;if(n){x=p,_=d,b=m;var z=Math.sin(n)/l(x,_,b);x*=z,_*=z,b*=z,P=P*(w=Math.cos(e))-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_-(L=L*w+P*b+C*_-I*x)*b}var D=c(C,I,L,P);D>1e-6?(C/=D,I/=D,L/=D,P/=D):(C=I=L=0,P=1),this.rotation.set(t,C,I,L,P)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},f.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){var n=r(3233);t.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){t.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=a[h][r],p=0;p0&&(o=d,s=m,l=h)}return i||o&&u(o,l),s}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],c=t,f=o[1],p=h(l,c,!0);if(n(e[l],e[c],e[f],e[p])<0)break;o.push(t),s=h(l,c)}return o}for(o=0;o0;){a[0][o].length;var m=f(o,p);(l=m)[1]===l[l.length-1]?d.push.apply(d,m):(d.length>0&&c.push(d),d=m)}d.length>0&&c.push(d)}return c};var n=r(3140)},5609:function(t,e,r){t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[p=o.pop()]=!1;var c=r[p];for(s=0;s0}))).length,g=new Array(m),y=new Array(m);for(p=0;p0;){var j=R.pop(),B=E[j];l(B,(function(t,e){return t-e}));var N,U=B.length,V=F[j];for(0===V&&(N=[q=d[j]]),p=0;p=0||(F[H]=1^V,R.push(H),0===V&&(O(q=d[H])||(q.reverse(),N.push(q))))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),v)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r=c?(k=1,v=c+2*f+d):v=f*(k=-f/c)+d):(k=0,p>=0?(A=0,v=d):-p>=h?(A=1,v=h+2*p+d):v=p*(A=-p/h)+d);else if(A<0)A=0,f>=0?(k=0,v=d):-f>=c?(k=1,v=c+2*f+d):v=f*(k=-f/c)+d;else{var M=1/T;v=(k*=M)*(c*k+u*(A*=M)+2*f)+A*(u*k+h*A+2*p)+d}else k<0?(_=h+p)>(x=u+f)?(b=_-x)>=(w=c-2*u+h)?(k=1,A=0,v=c+2*f+d):v=(k=b/w)*(c*k+u*(A=1-k)+2*f)+A*(u*k+h*A+2*p)+d:(k=0,_<=0?(A=1,v=h+2*p+d):p>=0?(A=0,v=d):v=p*(A=-p/h)+d):A<0?(_=c+f)>(x=u+p)?(b=_-x)>=(w=c-2*u+h)?(A=1,k=0,v=h+2*p+d):v=(k=1-(A=b/w))*(c*k+u*A+2*f)+A*(u*k+h*A+2*p)+d:(A=0,_<=0?(k=1,v=c+2*f+d):f>=0?(k=0,v=d):v=f*(k=-f/c)+d):(b=h+p-u-f)<=0?(k=0,A=1,v=h+2*p+d):b>=(w=c-2*u+h)?(k=1,A=0,v=c+2*f+d):v=(k=b/w)*(c*k+u*(A=1-k)+2*f)+A*(u*k+h*A+2*p)+d;var S=1-k-A;for(l=0;l0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||void 0===e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],p=r[2]-n[2],d=a*c,m=o*l,g=o*s,y=i*c,v=i*l,x=a*s,_=u*(d-m)+h*(g-y)+p*(v-x),b=7771561172376103e-31*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(v)+Math.abs(x))*Math.abs(p));return _>b||-_>b?_:f(t,e,r,n)}];function d(t){var e=p[t.length];return e||(e=p[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,a,o){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return a(e,r,s,l);case 5:return o(e,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(l+=1)=n?(i=h,(l+=1)>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a>1,c=e[2*l+1];if(c===a)return l;a0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){var n=r(3105),i=r(4623);function a(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var a=t[0]+t[1],o=e[0]+e[1];if(s=a+t[2]-(o+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],a)-i(c+e[2],o);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var f=0;f>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},e.skeleton=h,e.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function x(t){for(var e=y(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=v(t);if(!(r>=0&&e0){var t=k[0];return g(0,M-1),M-=1,x(0),t}return-1}function w(t,e){var r=k[t];return c[r]===e?t:(c[r]=-1/0,_(t),b(),c[r]=e,_((M+=1)-1))}function T(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),A[e]>=0&&w(A[e],m(e)),A[r]>=0&&w(A[r],m(r))}}var k=[],A=new Array(a);for(h=0;h>1;h>=0;--h)x(h);for(;;){var S=b();if(S<0||c[S]>r)break;T(S)}var E=[];for(h=0;h=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&I.push([n,i])}})),i.unique(i.normalize(I)),{positions:E,edges:I}};var n=r(3250),i=r(2014)},1303:function(t,e,r){t.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var f=n.ge(h,t[1],l);if(f=h.length)return i;p=h[f]}}if(p.start)if(s){var d=a(s[0],s[1],[t[0],p.y]);s[0][0]>s[1][0]&&(d=-d),d>0&&(i=p.index)}else i=p.index;else p.y!==t[1]&&(i=p.index)}}}return i}},5202:function(t,e,r){var n=r(1944),i=r(8210);function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},t.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(t,e,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,c,u,h,f,p=1,d=t.length,m="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?f="":(f=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(f+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?f+r+l:"0"===c?f+l+r:l+f+r)}return m}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],a=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()},3711:function(t,e,r){t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*f)/(r-n),e-.25-.25*(i+r-2*f)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*f)/(n-r),e-.25-.25*(a+n-2*f)/(n-a)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+a+n-4*f)/(r-i+n-a)]);break;case 4:u.push([t-.25-.25*(a+i-2*f)/(i-a),e-.75-.25*(-i-r+2*f)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+a+i-4*f)/(r-n+i-a),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+a+i)/(n-r+i-a),e-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([t-.75-.25*(a+i-2*f)/(i-a),e-.75-.25*(a+n-2*f)/(n-a)]);break;case 8:u.push([t-.75-.25*(-a-i+2*f)/(a-i),e-.75-.25*(-a-n+2*f)/(a-n)]);break;case 9:u.push([t-.5-.25*(n+r+-a-i)/(r-n+a-i),e-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([t-.5-.5*(-n-r-a-i+4*f)/(n-r+a-i),e-.5]);break;case 11:u.push([t-.25-.25*(-a-i+2*f)/(a-i),e-.75-.25*(i+r-2*f)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-a-n+4*f)/(i-r+a-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*f)/(r-n),e-.25-.25*(-a-n+2*f)/(a-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*f)/(n-r),e-.25-.25*(-i-r+2*f)/(i-r)])}},cell:function(t,e,r,n,i,a,o,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},o={}},665:function(t,e,r){var n=r(3202);t.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},7261:function(t,e,r){t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],n=t.right||h(r),i=t.radius||1,a=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in t){var p=t.eye,d=[p[0]-e[0],p[1]-e[1],p[2]-e[2]];o(n,d,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(d[0],d[1],d[2]);var m=l(r,d)/i,g=l(n,d)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new f(t.zoomMin,t.zoomMax,e,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t){return Math.min(1,Math.max(-1,t))}function h(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function f(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,u+=r[a]*r[a],e[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var f=this.computedToward;o(f,e,r),s(f,f);var p=Math.exp(this.computedRadius[0]),d=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(d),y=Math.sin(d),v=Math.cos(m),x=Math.sin(m),_=this.computedCenter,b=g*v,w=y*v,T=x,k=-g*x,A=-y*x,M=v,S=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=b*r[a]+w*f[a]+T*e[a];E[4*a+1]=k*r[a]+A*f[a]+M*e[a],E[4*a+2]=C,E[4*a+3]=0}var I=E[1],L=E[5],P=E[9],z=E[2],D=E[6],O=E[10],R=L*O-P*D,F=P*z-I*O,j=I*D-L*z,B=c(R,F,j);for(R/=B,F/=B,j/=B,E[0]=R,E[4]=F,E[8]=j,a=0;a<3;++a)S[a]=_[a]+E[2+4*a]*p;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*S[N];E[12+a]=-u}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var d=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;d[0]=i[2],d[1]=i[6],d[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,d),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},p.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],f=i[8],p=u*a+h*o+f*s,d=c(u-=a*p,h-=o*p,f-=s*p),m=(u/=d)*e+a*r,g=(h/=d)*e+o*r,y=(f/=d)*e+s*r;this.center.move(t,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(t,Math.log(v))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],h=e[a+8];if(n){var f=Math.abs(s),p=Math.abs(l),d=Math.abs(h),m=Math.max(f,p,d);f===m?(s=s<0?-1:1,l=h=0):d===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=e[o],_=e[o+4],b=e[o+8],w=x*s+_*l+b*h,T=c(x-=s*w,_-=l*w,b-=h*w),k=l*(b/=T)-h*(_/=T),A=h*(x/=T)-s*b,M=s*_-l*x,S=c(k,A,M);if(k/=S,A/=S,M/=S,this.center.jump(t,H,G,Z),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,x,_,b),2===a){var E=e[1],C=e[5],I=e[9],L=E*x+C*_+I*b,P=E*k+C*A+I*M;y=R<0?-Math.PI/2:Math.PI/2,v=Math.atan2(P,L)}else{var z=e[2],D=e[6],O=e[10],R=z*s+D*l+O*h,F=z*x+D*_+O*b,j=z*k+D*A+O*M;y=Math.asin(u(R)),v=Math.atan2(j,F)}this.angle.jump(t,v,y),this.recalcMatrix(t);var B=e[2],N=e[6],U=e[10],V=this.computedMatrix;i(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Z=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-B*W,G-N*W,Z-U*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],p=c(l,h,f);if(!(p<1e-6)){l/=p,h/=p,f/=p;var d=this.computedRight,m=d[0],g=d[1],y=d[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(x=c(m=a*f-o*h,g=o*l-i*f,y=i*h-a*l))<1e-6)){m/=x,g/=x,y/=x,this.up.set(t,i,a,o),this.right.set(t,m,g,y),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(p));var _=a*y-o*g,b=o*m-i*y,w=i*g-a*m,T=c(_,b,w),k=i*l+a*h+o*f,A=m*l+g*h+y*f,M=(_/=T)*l+(b/=T)*h+(w/=T)*f,S=Math.asin(u(k)),E=Math.atan2(M,A),C=this.angle._state,I=C[C.length-1],L=C[C.length-2];I%=2*Math.PI;var P=Math.abs(I+2*Math.PI-E),z=Math.abs(I-E),D=Math.abs(I-2*Math.PI-E);P0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function y(t){return new Int8Array(p(t),0,t)}function v(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function _(t){return new Float32Array(p(4*t),0,t)}function b(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new a(t)}e.free=function(t){if(a.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){f(t.buffer)},e.freeArrayBuffer=f,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return x(t);case"float":case"float32":return _(t);case"double":case"float64":return b(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=d,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=y,e.mallocInt16=v,e.mallocInt32=x,e.mallocFloat32=e.mallocFloat=_,e.mallocFloat64=e.mallocDouble=b,e.mallocUint8Clamped=w,e.mallocBigUint64=T,e.mallocBigInt64=k,e.mallocDataView=A,e.mallocBuffer=M,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}},1755:function(t){function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",b(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(T=0;T-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,l-s),n=n.replace("?px ",F())),A+=.25*C*(l-s)}if(!0===o.superscripts){var c=t.indexOf(d),h=r.indexOf(d),p=c>-1?parseInt(t[1+c]):0,m=h>-1?parseInt(r[1+h]):0;p!==m&&(n=n.replace(F(),"?px "),M*=Math.pow(.75,m-p),n=n.replace("?px ",F())),A-=.25*C*(m-p)}if(!0===o.bolds){var g=t.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=t.indexOf(f)>-1,_=r.indexOf(f)>-1;!x&&_&&(n="italic "+n),x&&!_&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===d||e[0]===y,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var f=n[h].indexOf(e[0]);-1===f?n[h]+=e:l&&(n[h]=n[h].substr(0,f+1)+(1+parseInt(n[h][f+1]))+n[h].substr(f+2))}var p=c+o,m=r.substr(p,u-p).indexOf(i);c=-1!==m?m:u+s}return n}function _(t,e,r,i){var c=function(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,i),u=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i}))},has___:{value:x((function(e){var n=v(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof m||_();var t,n=new r,i=void 0,a=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:x((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:x((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:x(t)},delete___:{value:x((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:x((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function y(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function v(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function x(t){return t.prototype=null,Object.freeze(t)}function _(){p||"undefined"==typeof console||(p=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){var e,r,n,i=function(){return function(t,e,r,n,i,a){var o=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u=0!=p>=0&&i.push(l[0]+.5+.5*(f+p)/(f-p)),n+=h,++l[0]}}};t.exports=(e={funcName:"zeroCrossings"},r=i.bind(void 0,e),n={},function(t,e,i){var a=t.dtype,o=t.order,s=[a,o.join()].join(),l=n[s];return l||(n[s]=l=r([a,o])),l(t.shape.slice(0),t.data,t.stride,0|t.offset,e,i)})},781:function(t,e,r){t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var i=n(1964);e.exports=i}()}}),Dd=f({"node_modules/color-name/index.js"(t,e){e.exports={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]}}}),Od=f({"node_modules/color-normalize/node_modules/color-parse/index.js"(t,e){var r=Dd();e.exports=function(t){var e,i,a=[],o=1;if("string"==typeof t)if(t=t.toLowerCase(),r[t])a=r[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==n[t])return n[t]}return parseFloat(t)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(a=[t[0],t[1],t[2]],i="rgb",o=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(i="rgb",a=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",a=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),o=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(o/=100)):(i="rgb",a=[t>>>16,(65280&t)>>>8,255&t]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Rd=f({"node_modules/color-normalize/node_modules/color-rgba/index.js"(t,e){var r=Od();e.exports=function(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw.apply(null,arguments));var n=r(t);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(e=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),e[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),e[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(e=function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c++]=255*a;return i}(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}}}),Fd=f({"node_modules/clamp/index.js"(t,e){e.exports=function(t,e,r){return er?r:t:te?e:t}}}),jd=f({"node_modules/dtype/index.js"(t,e){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),Bd=f({"node_modules/color-normalize/index.js"(t,e){var r=Rd(),n=Fd(),i=jd();e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var a=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=r(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=null!=t[3]?t[3]:255,o&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(o?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=null!=t[3]?t[3]:1):(a[0]=n(Math.floor(255*t[0]),0,255),a[1]=n(Math.floor(255*t[1]),0,255),a[2]=n(Math.floor(255*t[2]),0,255),a[3]=null==t[3]?255:n(Math.floor(255*t[3]),0,255)),a)}}}),Nd=f({"src/lib/str2rgbarray.js"(t,e){var r=Bd();e.exports=function(t){return t?r(t):[0,0,0,1]}}}),Ud=f({"src/lib/gl_format_color.js"(t,e){var r=T(),n=D(),i=Bd(),a=Ze(),o=V().defaultLine,s=S().isArrayOrTypedArray,l=i(o);function c(t,e){var r=t;return r[3]*=e,r}function u(t){if(r(t))return l;var e=i(t);return e.length?e:l}function h(t){return r(t)?t:1}e.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var o,f,p,d,m,g=s(n),y=s(e),v=a.extractOpts(t),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(t):u,f=g?function(t,e){return void 0===t[e]?l:i(o(t[e]))}:u,p=y?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||y)for(var _=0;_0){var f=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=f),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,f)}}else o[s]=[-l[0]*n,l[1]*n]}return o}e.exports=function(t,e,r){var i=[n(t.x,t.error_x,e[0],r.xaxis),n(t.y,t.error_y,e[1],r.yaxis),n(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function b(t){return f[t]}function w(t,e,r,n,i){var a=null;if(s.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n=0&&h("surfacecolor",p||d);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(t,e,p||d||c,{axis:"z"}),v(t,e,p||d||c,{axis:"y",inherit:"z"}),v(t,e,p||d||c,{axis:"x",inherit:"z"})}else e.visible=!1}}}),Yd=f({"src/traces/scatter3d/calc.js"(t,e){var r=ni(),n=ri();e.exports=function(t,e){var i=[{x:!1,y:!1,trace:e,t:{}}];return r(i,e),n(t,e),i}}}),Xd=f({"node_modules/get-canvas-context/index.js"(t,e){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o/g," "));l[c]=p,u.tickmode=h}}for(e.ticks=l,c=0;c<3;++c)for(a[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!l&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},T.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),h=null,d=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(k.valueLabel=f.hoverLabelText(e._mockAxis,e._mockAxis.d2l(d.traceCoordinate[3]),t.valuehoverformat),E.push("value: "+k.valueLabel),d.textLabel&&E.push(d.textLabel),_=E.join("
")):_=d.textLabel;var C={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:T};p.appendArrayPointValue(C,w,T),t._module.eventData&&(C=w._module.eventData(C,d,w,{},T));var I={points:[C]};if(e.fullSceneLayout.hovermode){var L=[];p.loneHover({trace:w,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:k.xLabel,yLabel:k.yLabel,zLabel:k.zLabel,text:_,name:h.name,color:p.castHoverOption(w,T,"bgcolor")||h.color,borderColor:p.castHoverOption(w,T,"bordercolor"),fontFamily:p.castHoverOption(w,T,"font.family"),fontSize:p.castHoverOption(w,T,"font.size"),fontColor:p.castHoverOption(w,T,"font.color"),nameLength:p.castHoverOption(w,T,"namelength"),textAlign:p.castHoverOption(w,T,"align"),hovertemplate:u.castOption(w,T,"hovertemplate"),hovertemplateLabels:u.extendFlat({},C,k),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}d.distance<5&&(d.buttons||b)?r.emit("plotly_click",I):r.emit("plotly_hover",I),this.oldEventData=I}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},T.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var A=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=A[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],h=e["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var f,p=0;p<(h||l.length);p++)if(u.isArrayOrTypedArray(l[p]))for(var d=0;dy[1][o])y[0][o]=-1,y[1][o]=1;else{var P=y[1][o]-y[0][o];y[0][o]-=P/32,y[1][o]+=P/32}if(b=[y[0][o],y[1][o]],b=_(b,l),y[0][o]=b[0],y[1][o]=b[1],l.isReversed()){var z=y[0][o];y[0][o]=y[1][o],y[1][o]=z}}else b=l.range,y[0][o]=l.r2l(b[0]),y[1][o]=l.r2l(b[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),v[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var D=u.aspectmode;if("cube"===D)g=[1,1,1];else if("manual"===D){var O=u.aspectratio;g=[O.x,O.y,O.z]}else{if("auto"!==D&&"data"!==D)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(o=0;o<3;++o){var F=x[c=(l=u[A[o]]).type];R[o]=Math.pow(F.acc,1/F.count)/p[o]}g="data"===D||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=g[0],u.aspectratio.y=h.aspectratio.y=g[1],u.aspectratio.z=h.aspectratio.z=g[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var j=u.domain||null,B=e._size||null;if(j&&B){var N=n.container.style;N.position="absolute",N.left=B.l+j.x[0]*B.w+"px",N.top=B.t+(1-j.y[1])*B.h+"px",N.width=B.w*(j.x[1]-j.x[0])+"px",N.height=B.h*(j.y[1]-j.y[0])+"px"}n.glplot.redraw()}},T.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},T.getCamera=function(){var t,e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),{up:{x:(t=e.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},T.setViewport=function(t){var e,r=this,n=t.camera;r.camera.lookAt.apply(this,[[(e=n).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),r.glplot.setAspectratio(t.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},T.isCameraChanged=function(t){var e,r,n,i,a,o,s=this.getCamera(),l=u.nestedProperty(t,this.id+".camera").get(),c=!1;if(void 0===l)c=!0;else{for(var h=0;h<3;h++)for(var f=0;f<3;f++)if(e=s,i=f,a=void 0,o=void 0,o=["x","y","z"],!(r=l)[(a=["up","center","eye"])[n=h]]||e[a[n]][o[i]]!==r[a[n]][o[i]]){c=!0;break}(!l.projection||s.projection&&s.projection.type!==l.projection.type)&&(c=!0)}return c},T.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=u.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},T.saveLayout=function(t){var e,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(t),f=s.isAspectChanged(t),p=h||f;if(p){var d={};h&&(e=s.getCamera(),n=(r=u.nestedProperty(t,s.id+".camera")).get(),d[s.id+".camera"]=n),f&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(t,s.id+".aspectratio")).get(),d[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",t,l._preGUI,d),h&&(r.set(e),u.nestedProperty(l,s.id+".camera").set(e)),f&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return p},T.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var f=r.id+".camera.up",p={x:0,y:0,z:1},d={};d[f]=p;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,d),o.up=p,u.nestedProperty(m,f).set(p)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},T.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(r),e.glplot.redraw();var n=e.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(r),l},T.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[A[t]];f.setConvert(e,this.fullLayout),e.setScale=u.noop}},T.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(t._mockAxis,e)},e.exports=w}}),rm=f({"src/plots/gl3d/layout/attributes.js"(t,e){e.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),nm=f({"src/plots/gl3d/layout/axis_attributes.js"(t,e){var r=q(),n=Ce(),i=O().extendFlat,a=Lt().overrideAll;e.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),im=f({"src/plots/gl3d/layout/layout_attributes.js"(t,e){var r=nm(),n=Ta().attributes,i=O().extendFlat,a=se().counterRegex;function o(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),am=f({"src/plots/gl3d/layout/axis_defaults.js"(t,e){var r=D().mix,n=se(),i=ge(),a=nm(),o=xi(),s=wi(),l=["xaxis","yaxis","zaxis"],c=13600/187;e.exports=function(t,e,u){var h,f;function p(t,e){return n.coerce(h,f,a,t,e)}for(var d=0;d.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}e.exports=function(t,e,n){var i=e._basePlotModules.length>1;a(t,e,n,{type:c,attributes:s,handleDefaults:u,fullLayout:e,font:e.font,fullData:n,getDfltFromLayout:function(e){if(!i)return r.validate(t[e],s[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}}}),sm=f({"src/plots/gl3d/index.js"(t){var e=Lt().overrideAll,r=j(),n=em(),i=be().getSubplotData,a=se(),o=ke(),s="gl3d",l="scene";t.name=s,t.attr=l,t.idRoot=l,t.idRegex=t.attrRegex=a.counterRegex("scene"),t.attributes=rm(),t.layoutAttributes=im(),t.baseLayoutAttrOverrides=e({hoverlabel:r.hoverlabel},"plot","nested"),t.supplyLayoutDefaults=om(),t.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=e._subplots[s],o=0;o0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=m(t),n=m(e),i=1,a=0;a_;)r--,r/=g(r),++r1?n:1},f.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,i=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/e,0,0,0,1/r,0,0,0,1],f=0;f0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];es&&(this.minValues[e]=s),this.maxValues[e]l&&(e.isomin=null,e.isomax=null);var c=o("x"),u=o("y"),h=o("z"),f=o("value");c&&c.length&&u&&u.length&&h&&h.length&&f&&f.length?(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach((function(t){o(t+"hoverformat");var e="caps."+t;o(e+".show")&&o(e+".fill");var r="slices."+t;o(r+".show")&&(o(r+".fill"),o(r+".locations"))})),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){o(t)})),a(t,e,i,o,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,n,a){o(t,e,0,a,(function(n,a){return r.coerce(t,e,i,n,a)}))},supplyIsoDefaults:o}}}),xm=f({"src/traces/streamtube/calc.js"(t,e){var r=se(),n=Ge();function i(t){var e,n,i,o,s,l,c,u,h,f,p,d,m=t._x,g=t._y,y=t._z,v=t._len,x=-1/0,_=1/0,b=-1/0,w=1/0,T=-1/0,k=1/0,A="";for(v&&(c=m[0],h=g[0],p=y[0]),v>1&&(u=m[v-1],f=g[v-1],d=y[v-1]),e=0;eu?"-":"+")+"x")).replace("y",(h>f?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var C=function(){v=0,M=[],S=[],E=[]};(!v||v0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){I();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:C(d,m,y);f[p]=x>-1?x:P(d,m,y,R(e,v))}i=f[0],a=f[1],o=f[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function j(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function N(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return N(e[0][3])&&N(e[1][3])&&N(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=j(f,u,n,i),d=j(f,h,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,h,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],h=e[a[1]],f=e[a[2]],p=j(h,u,n,i),d=j(f,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(t,e,r,n){var i=!1,a=U(e),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]];if(m)i=F(t,[c,u,h],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=j(f,c,r,n),d=j(f,u,r,n),g=j(f,h,r,n);i=F(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(h,c,r,n),d=j(h,u,r,n),g=j(f,u,r,n),y=j(f,c,r,n);m?(i=F(t,[c,y,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],f=a[l[3]],p=j(u,c,r,n),d=j(h,c,r,n),g=j(f,c,r,n);m?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,g],[-1,-1,-1])||i,s=!0}}))),i}function H(t,e,r,n,i,a,o,s,l,c,u){var h=!1;return d&&(O(t,"A")&&(h=q(null,[e,r,n,a],c,u)||h),O(t,"B")&&(h=q(null,[r,n,i,l],c,u)||h),O(t,"C")&&(h=q(null,[r,a,o,l],c,u)||h),O(t,"D")&&(h=q(null,[n,a,s,l],c,u)||h),O(t,"E")&&(h=q(null,[r,n,a,l],c,u)||h)),m&&(h=q(t,[r,n,a,l],c,u)||h),h}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Z(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,h=!1,f=function(){h=V(t,[s,l,c],[-1,-1,-1],i,a)||h,h=V(t,[c,u,s],[-1,-1,-1],i,a)||h},p=o[0],d=o[1],m=o[2];return p&&(s=z(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=z(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=z(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=z(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),f()),d&&(s=z(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=z(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=z(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=z(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),f()),m&&(s=z(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],m),l=z(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],m),c=z(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],m),u=z(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],m),f()),h}function Y(t,e,r,n,i,a,o,s,l,c,u,h){var f=t;return h?(d&&"even"===t&&(f=null),H(f,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(f=null),H(f,l,s,o,a,i,n,r,e,c,u))}function X(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(T-M)?[A,T]:[T,M];Q(r,C[0],C[1])}}var I=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(h.push(d.id),"x"===r?f.push([d.distRatio,0,0]):"y"===r?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else u=nt(1,"x"===r?_-1:"y"===r?b-1:w-1);h.length>0&&(n[a]="x"===r?tt(e,h,o,s,f,n[a]):"y"===r?et(e,h,o,s,f,n[a]):rt(e,h,o,s,f,n[a]),a++),u.length>0&&(n[a]="x"===r?X(e,u,o,s,n[a]):"y"===r?$(e,u,o,s,n[a]):J(e,u,o,s,n[a]),a++)}var m=t.caps[r];m.show&&m.fill&&(D(m.fill),n[a]="x"===r?X(e,[0,_-1],o,s,n[a]):"y"===r?$(e,[0,b-1],o,s,n[a]):J(e,[0,w-1],o,s,n[a]),a++)}})),0===g&&L(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:f,createIsosurfaceTrace:function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}}),Tm=f({"src/traces/isosurface/index.js"(t,e){e.exports={attributes:ym(),supplyDefaults:vm().supplyDefaults,calc:_m(),colorbar:{min:"cmin",max:"cmax"},plot:wm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),km=f({"lib/isosurface.js"(t,e){e.exports=Tm()}}),Am=f({"src/traces/volume/attributes.js"(t,e){var r=Le(),n=ym(),i=um(),a=N(),o=O().extendFlat,s=Lt().overrideAll,l=e.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),Mm=f({"src/traces/volume/defaults.js"(t,e){var r=se(),n=Am(),i=vm().supplyIsoDefaults,a=hm().opacityscaleDefaults;e.exports=function(t,e,o,s){function l(i,a){return r.coerce(t,e,n,i,a)}i(t,e,o,s,l),a(t,e,s,l)}}}),Sm=f({"src/traces/volume/convert.js"(t,e){var r=zd().gl_mesh3d,n=Ud().parseColorScale,i=se().isArrayOrTypedArray,a=Nd(),o=Ze().extractOpts,s=bm(),l=wm().findNearestOnAxis,c=wm().generateIsoMeshes;function u(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(t){if(t.object===this.mesh){var e=t.data.index,r=this.data._meshX[e],n=this.data._meshY[e],a=this.data._meshZ[e],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,f=t.index=h+s*u+s*o*c;t.traceCoordinate=[this.data._meshX[f],this.data._meshY[f],this.data._meshZ[f],this.data._value[f]];var p=this.data.hovertext||this.data.text;return i(p)&&void 0!==p[f]?t.textLabel=p[f]:p&&(t.textLabel=p),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;function i(t,e,r,n){return e.map((function(e){return t.d2l(e,0,n)*r}))}this.data=c(t);var l={positions:s(i(r.xaxis,t._meshX,e.dataScale[0],t.xcalendar),i(r.yaxis,t._meshY,e.dataScale[1],t.ycalendar),i(r.zaxis,t._meshZ,e.dataScale[2],t.zcalendar)),cells:s(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:a(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},u=o(t);l.vertexIntensity=t._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(t),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var n=t.glplot.gl,i=r({gl:n}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}}),Em=f({"src/traces/volume/index.js"(t,e){e.exports={attributes:Am(),supplyDefaults:Mm(),calc:_m(),colorbar:{min:"cmin",max:"cmax"},plot:Sm(),moduleType:"trace",name:"volume",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Cm=f({"lib/volume.js"(t,e){e.exports=Em()}}),Im=f({"src/traces/mesh3d/defaults.js"(t,e){var r=Vt(),n=se(),i=Ve(),a=gm();e.exports=function(t,e,o,s){function l(r,i){return n.coerce(t,e,a,r,i)}function c(t){var e=t.map((function(t){var e=l(t);return e&&n.isArrayOrTypedArray(e)?e:null}));return e.every((function(t){return t&&t.length===e[0].length}))&&e}c(["x","y","z"])?(c(["i","j","k"]),(!e.i||e.j&&e.k)&&(!e.j||e.k&&e.i)&&(!e.k||e.i&&e.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach((function(t){l(t)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in t?(l("intensity"),l("intensitymode"),i(t,e,s,l,{prefix:"",cLetter:"c"})):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),e._length=null):e.visible=!1):e.visible=!1}}}),Lm=f({"src/traces/mesh3d/calc.js"(t,e){var r=Ge();e.exports=function(t,e){e.intensity&&r(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}}}),Pm=f({"src/traces/mesh3d/convert.js"(t,e){var r=zd().gl_mesh3d,n=zd().delaunay_triangulate,i=zd().alpha_shape,a=zd().convex_hull,o=Ud().parseColorScale,s=se().isArrayOrTypedArray,l=Nd(),c=Ze().extractOpts,u=bm();function h(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=h.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var s,h=t.x.length,f=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,h)||!g(t.j,h)||!g(t.k,h))return;s=u(m(t.i),m(t.j),m(t.k))}else s=0===t.alphahull?a(f):t.alphahull>0?i(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),i=[],a=e.length,o=0;o2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function f(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var n=t.fullSceneLayout,c=t.dataScale,u=e._len,p={};function d(t,e){var r=n[e],a=c[l[e]];return i.simpleMap(t,(function(t){return r.d2l(t)*a}))}if(p.vectors=s(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(p.meshgrid=[m,g,y],p.gridFill=e._gridFill,e._slen)p.startingPositions=s(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),_=h(y),b=new Array(x.length*_.length),w=0,T=0;To&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=function(t,e,r){var n,i=[],a=[];function o(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:n})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}function c(t){t.forEach(l)}function u(t){switch(n=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":c(t.arcs)}}return u(e),a.forEach(null==r?function(t){i.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function c(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be ≥2");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(e),f=t.objects,p={};function d(t){return h(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in f)p[c]=m(f[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=h(t[0],0);++r0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},t.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},t.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r0?t>180?t-360:t:t<-180?t+360:t},t.bearingToAzimuth=function(t){let e=t%360;return e<0&&(e+=360),e},t.convertArea=function(t,e="meters",r="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");const i=n[e];if(!i)throw new Error("invalid original units");const a=n[r];if(!a)throw new Error("invalid final units");return t/i*a},t.convertLength=function(t,e="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return f(p(t,e),r)},t.degreesToRadians=function(t){return t%360*Math.PI/180},t.earthRadius=e,t.factors=r,t.feature=i,t.featureCollection=l,t.geometry=function(t,e,r={}){switch(t){case"Point":return a(e).geometry;case"LineString":return s(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return c(e).geometry;case"MultiPolygon":return h(e).geometry;default:throw new Error(t+" is invalid")}},t.geometryCollection=function(t,e,r={}){return i({type:"GeometryCollection",geometries:t},e,r)},t.isNumber=m,t.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},t.lengthToDegrees=function(t,e){return d(p(t,e))},t.lengthToRadians=p,t.lineString=s,t.lineStrings=function(t,e,r={}){return l(t.map((t=>s(t,e))),r)},t.multiLineString=c,t.multiPoint=u,t.multiPolygon=h,t.point=a,t.points=function(t,e,r={}){return l(t.map((t=>a(t,e))),r)},t.polygon=o,t.polygons=function(t,e,r={}){return l(t.map((t=>o(t,e))),r)},t.radiansToDegrees=d,t.radiansToLength=f,t.round=function(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const r=Math.pow(10,e||0);return Math.round(t*r)/r},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((t=>{if(!m(t))throw new Error("bbox must only contain numbers")}))},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}}),rg=f({"node_modules/@turf/meta/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=eg();function r(t,e,n){if(null!==t)for(var i,a,o,s,l,c,u,h,f=0,p=0,d=t.type,m="FeatureCollection"===d,g="Feature"===d,y=m?t.features.length:1,v=0;vc||p>u||d>h)return l=r,c=i,u=p,h=d,void(o=0);var m=e.lineString.call(void 0,[l,r],t.properties);if(!1===n(m,i,a,d,o))return!1;o++,l=r}))&&void 0}}}))}function l(t,r){if(!t)throw new Error("geojson is required");o(t,(function(t,n,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===r(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;st+function(t){let e,r=0;switch(t.type){case"Polygon":return i(t.coordinates);case"MultiPolygon":for(e=0;e0){e+=Math.abs(s(t[0]));for(let r=1;r=e?(n+2)%e:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;t.area=n,t.default=l}}),ig=f({"node_modules/@turf/centroid/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=eg(),r=rg();function n(t,n={}){let i=0,a=0,o=0;return r.coordEach.call(void 0,t,(function(t){i+=t[0],a+=t[1],o++}),!0),e.point.call(void 0,[i/o,a/o],n.properties)}var i=n;t.centroid=n,t.default=i}}),ag=f({"node_modules/@turf/bbox/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=rg();function r(t,r={}){if(null!=t.bbox&&!0!==r.recompute)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return e.coordEach.call(void 0,t,(t=>{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r0?h.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;so&&(o=c,e=l)}else e=r;return a(e).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=t,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var f=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o")}function p(t){return t+"°"}}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}}}),ug=f({"src/traces/scattergeo/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.lon=e.lon,t.lat=e.lat,t.location=e.loc?e.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t}}}),hg=f({"src/traces/scattergeo/select.js"(t,e){var r=We(),n=k().BADNUM;e.exports=function(t,e){var i,a,o,s,l,c=t.cd,u=t.xaxis,h=t.yaxis,f=[],p=c[0].trace;if(!r.hasMarkers(p)&&!r.hasText(p))return[];if(!1===e)for(l=0;le?1:t>=e?0:NaN}function r(t){var r;return 1===t.length&&(r=t,t=function(t,n){return e(r(t),n)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}var n=r(e),i=n.right,a=n.left;function o(t,e){return[t,e]}function s(t){return null===t?NaN:+t}function l(t,e){var r,n,i=t.length,a=0,o=-1,l=0,c=0;if(null==e)for(;++o1)return c/(a-1)}function c(t,e){var r=l(t,e);return r?Math.sqrt(r):r}function u(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function b(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}}function k(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function A(t){if(!(i=t.length))return[];for(var e=-1,r=k(t,M),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=c,t.extent=u,t.histogram=function(){var t=m,e=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;ah;)f.pop(),--p;var d,m=new Array(p+1);for(a=0;a<=p;++a)(d=m[a]=[]).x0=a>0?f[a-1]:u,d.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=k,t.pairs=function(t,e){null==e&&(e=o);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r0)return[t];if((n=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s0?1:t<0?-1:0},k=Math.sqrt,A=Math.tan;function M(t){return t>1?0:t<-1?l:Math.acos(t)}function S(t){return t>1?c:t<-1?-c:Math.asin(t)}function E(t){return(t=w(t/2))*t}function C(){}function I(t,e){t&&P.hasOwnProperty(t.type)&&P[t.type](t,e)}var L={Feature:function(t,e){I(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=y(e=(e*=p)/2+u),o=w(e),s=N*o,l=B*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),j=t,B=a,N=o}function Y(t){return[g(t[1],t[0]),S(t[2])]}function X(t){var e=t[0],r=t[1],n=y(r);return[n*y(e),n*w(e),w(r)]}function $(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function J(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function K(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Q(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tt(t){var e=k(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var et,rt,nt,it,at,ot,st,lt,ct,ut,ht,ft,pt,dt,mt,gt,yt,vt,xt,_t,bt,wt,Tt,kt,At,Mt,St=r(),Et={point:Ct,lineStart:Lt,lineEnd:Pt,polygonStart:function(){Et.point=zt,Et.lineStart=Dt,Et.lineEnd=Ot,St.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),Et.point=Ct,Et.lineStart=Lt,Et.lineEnd=Pt,U<0?(et=-(nt=180),rt=-(it=90)):St>o?it=90:St<-o&&(rt=-90),ut[0]=et,ut[1]=nt},sphere:function(){et=-(nt=180),rt=-(it=90)}};function Ct(t,e){ct.push(ut=[et=t,nt=t]),eit&&(it=e)}function It(t,e){var r=X([t*p,e*p]);if(lt){var n=J(lt,r),i=J([n[1],-n[0],0],n);tt(i),i=Y(i);var a,o=t-at,s=o>0?1:-1,l=i[0]*f*s,c=d(o)>180;c^(s*atit&&(it=a):c^(s*at<(l=(l+360)%360-180)&&lit&&(it=e)),c?tRt(et,nt)&&(nt=t):Rt(t,nt)>Rt(et,nt)&&(et=t):nt>=et?(tnt&&(nt=t)):t>at?Rt(et,t)>Rt(et,nt)&&(nt=t):Rt(t,nt)>Rt(et,nt)&&(et=t)}else ct.push(ut=[et=t,nt=t]);eit&&(it=e),lt=r,at=t}function Lt(){Et.point=It}function Pt(){ut[0]=et,ut[1]=nt,Et.point=Ct,lt=null}function zt(t,e){if(lt){var r=t-at;St.add(d(r)>180?r+(r>0?360:-360):r)}else ot=t,st=e;q.point(t,e),It(t,e)}function Dt(){q.lineStart()}function Ot(){zt(ot,st),q.lineEnd(),d(St)>o&&(et=-(nt=180)),ut[0]=et,ut[1]=nt,lt=null}function Rt(t,e){return(e-=t)<0?e+360:e}function Ft(t,e){return t[0]-e[0]}function jt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:el?t+Math.round(-t/h)*h:t,e]}function Qt(t,e,r){return(t%=h)?e||r?Jt(ee(t),re(e,r)):ee(t):e||r?re(e,r):Kt}function te(t){return function(e,r){return[(e+=t)>l?e-h:e<-l?e+h:e,r]}}function ee(t){var e=te(t);return e.invert=te(-t),e}function re(t,e){var r=y(t),n=w(t),i=y(e),a=w(e);function o(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),S(u*i+l*a)]}return o.invert=function(t,e){var o=y(e),s=y(t)*o,l=w(t)*o,c=w(e),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),S(u*r-s*n)]},o}function ne(t){function e(e){return(e=t(e[0]*p,e[1]*p))[0]*=f,e[1]*=f,e}return t=Qt(t[0]*p,t[1]*p,t.length>2?t[2]*p:0),e.invert=function(e){return(e=t.invert(e[0]*p,e[1]*p))[0]*=f,e[1]*=f,e},e}function ie(t,e,r,n,i,a){if(r){var o=y(e),s=w(e),l=n*r;null==i?(i=e+n*h,a=e-l/2):(i=ae(o,i),a=ae(o,a),(n>0?ia)&&(i+=n*h));for(var c,u=i;n>0?u>a:u1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function se(t,e){return d(t[0]-e[0])=0;--a)i.point((u=c[a])[0],u[1]);else n(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function ue(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,D=z*P,O=D>l,R=T*I;if(he.add(g(R*z*w(D),k*L+R*y(D))),s+=O?P+z*h:P,O^_>=r^E>=r){var F=J(X(x),X(M));tt(F);var j=J(a,F);tt(j);var B=(O^P>=0?-1:1)*S(j[2]);(n>B||n===B&&(F[0]||F[1]))&&(f+=O^P>=0?1:-1)}}return(s<-o||s0){for(f||(a.polygonStart(),f=!0),a.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(me))}return p}}function me(t){return t.length>1}function ge(t,e){return((t=t.x)[0]<0?t[1]-c-o:c-t[1])-((e=e.x)[0]<0?e[1]-c-o:c-e[1])}var ye=de((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,s){var u=a>0?l:-l,h=d(a-r);d(h-l)0?c:-c),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(a,n),e=0):i!==u&&h>=l&&(d(r-i)o?m((w(e)*(a=y(n))*w(r)-w(n)*(i=y(e))*w(t))/(i*a*s)):(e+n)/2}(r,n,a,s),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=a,n=s),i=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(d(t[0]-e[0])>o){var a=t[0]0,i=d(e)>o;function a(t,r){return y(t)*y(r)>e}function s(t,r,n){var i=[1,0,0],a=J(X(t),X(r)),s=$(a,a),c=a[0],u=s-c*c;if(!u)return!n&&t;var h=e*s/u,f=-e*c/u,p=J(i,a),m=Q(i,h);K(m,Q(a,f));var g=p,y=$(m,g),v=$(g,g),x=y*y-v*($(m,m)-1);if(!(x<0)){var _=k(x),b=Q(g,(-y-_)/v);if(K(b,m),b=Y(b),!n)return b;var w,T=t[0],A=r[0],M=t[1],S=r[1];A0^b[1]<(d(b[0]-T)l^(T<=b[0]&&b[0]<=A)){var I=Q(g,(-y+_)/v);return K(I,m),[b,Y(I)]}}}function c(e,r){var i=n?t:l-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return de(a,(function(t){var e,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(f,p){var d,m=[f,p],g=a(f,p),y=n?g?0:c(f,p):g?c(f+(f<0?l:-l),p):0;if(!e&&(u=o=g)&&t.lineStart(),g!==o&&(!(d=s(e,m))||se(e,d)||se(m,d))&&(m[2]=1),g!==o)h=0,g?(t.lineStart(),d=s(m,e),t.point(d[0],d[1])):(d=s(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&n^g){var v;y&r||!(v=s(m,e,!0))||(h=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&se(e,m)||t.point(m[0],m[1]),e=m,o=g,r=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return h|(u&&o)<<1}}}),(function(e,n,i,a){ie(a,t,r,i,e,n)}),n?[0,-t]:[-l,t-l])}var xe=1e9,_e=-xe;function be(t,r,n,i){function a(e,a){return t<=e&&e<=n&&r<=a&&a<=i}function s(e,a,o,s){var c=0,h=0;if(null==e||(c=l(e,o))!==(h=l(a,o))||u(e,a)<0^o>0)do{s.point(0===c||3===c?t:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(e,i){return d(e[0]-t)0?0:3:d(e[0]-n)0?2:1:d(e[1]-r)0?1:0:i>0?3:2}function c(t,e){return u(t.x,e.x)}function u(t,e){var r=l(t,1),n=l(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(o){var l,u,h,f,p,d,m,g,y,v,x,_=o,b=oe(),w={point:T,lineStart:function(){w.point=k,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(k(f,p),d&&y&&b.rejoin(),l.push(b.result())),w.point=T,y&&_.lineEnd()},polygonStart:function(){_=b,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var e=0,r=0,n=u.length;ri&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=x&&r,a=(l=e.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ce(l,c,r,s,o),o.polygonEnd()),_=o,l=u=h=null}};function T(t,e){a(t,e)&&_.point(t,e)}function k(e,o){var s=a(e,o);if(u&&h.push([e,o]),v)f=e,p=o,d=s,v=!1,s&&(_.lineStart(),_.point(e,o));else if(s&&y)_.point(e,o);else{var l=[m=Math.max(_e,Math.min(xe,m)),g=Math.max(_e,Math.min(xe,g))],c=[e=Math.max(_e,Math.min(xe,e)),o=Math.max(_e,Math.min(xe,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,c,t,r,n,i)?s&&(_.lineStart(),_.point(e,o),x=!1):(y||(_.lineStart(),_.point(l[0],l[1])),_.point(c[0],c[1]),s||_.lineEnd(),x=!1)}m=e,g=o,y=s}return w}}var we,Te,ke,Ae=r(),Me={sphere:C,point:C,lineStart:function(){Me.point=Ee,Me.lineEnd=Se},lineEnd:C,polygonStart:C,polygonEnd:C};function Se(){Me.point=Me.lineEnd=C}function Ee(t,e){we=t*=p,Te=w(e*=p),ke=y(e),Me.point=Ce}function Ce(t,e){t*=p;var r=w(e*=p),n=y(e),i=d(t-we),a=y(i),o=n*w(i),s=ke*r-Te*n*a,l=Te*r+ke*n*a;Ae.add(g(k(o*o+s*s),l)),we=t,Te=r,ke=n}function Ie(t){return Ae.reset(),O(t,Me),+Ae}var Le=[null,null],Pe={type:"LineString",coordinates:Le};function ze(t,e){return Le[0]=t,Le[1]=e,Ie(Pe)}var De={Feature:function(t,e){return Re(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=ze(t[a],t[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))o})).map(u)).concat(e.range(v(s/g)*g,a,g).filter((function(t){return d(t%x)>o})).map(h))}return b.lines=function(){return w().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(p(l).slice(1),f(n).reverse().slice(1),p(c).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],c=+t[0][1],l=+t[1][1],i>n&&(t=i,i=n,n=t),c>l&&(t=c,c=l,l=t),b.precision(_)):[[i,c],[n,l]]},b.extentMinor=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],s=+e[0][1],a=+e[1][1],r>t&&(e=r,r=t,t=e),s>a&&(e=s,s=a,a=e),b.precision(_)):[[r,s],[t,a]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(y=+t[0],x=+t[1],b):[y,x]},b.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],b):[m,g]},b.precision=function(e){return arguments.length?(_=+e,u=Ve(s,a,90),h=qe(r,t,_),f=Ve(c,l,90),p=qe(i,n,_),b):_},b.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Ge(t){return t}var Ze,We,Ye,Xe,$e=r(),Je=r(),Ke={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Ke.lineStart=Qe,Ke.lineEnd=rr},polygonEnd:function(){Ke.lineStart=Ke.lineEnd=Ke.point=C,$e.add(d(Je)),Je.reset()},result:function(){var t=$e/2;return $e.reset(),t}};function Qe(){Ke.point=tr}function tr(t,e){Ke.point=er,Ze=Ye=t,We=Xe=e}function er(t,e){Je.add(Xe*t-Ye*e),Ye=t,Xe=e}function rr(){er(Ze,We)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(t,e){tcr&&(cr=t),eur&&(ur=e)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var t=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),t}},fr=0,pr=0,dr=0,mr=0,gr=0,yr=0,vr=0,xr=0,_r=0,br={point:wr,lineStart:Tr,lineEnd:Mr,polygonStart:function(){br.lineStart=Sr,br.lineEnd=Er},polygonEnd:function(){br.point=wr,br.lineStart=Tr,br.lineEnd=Mr},result:function(){var t=_r?[vr/_r,xr/_r]:yr?[mr/yr,gr/yr]:dr?[fr/dr,pr/dr]:[NaN,NaN];return fr=pr=dr=mr=gr=yr=vr=xr=_r=0,t}};function wr(t,e){fr+=t,pr+=e,++dr}function Tr(){br.point=kr}function kr(t,e){br.point=Ar,wr(ar=t,or=e)}function Ar(t,e){var r=t-ar,n=e-or,i=k(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,wr(ar=t,or=e)}function Mr(){br.point=wr}function Sr(){br.point=Cr}function Er(){Ir(nr,ir)}function Cr(t,e){br.point=Ir,wr(nr=ar=t,ir=or=e)}function Ir(t,e){var r=t-ar,n=e-or,i=k(r*r+n*n);mr+=i*(ar+t)/2,gr+=i*(or+e)/2,yr+=i,vr+=(i=or*t-ar*e)*(ar+t),xr+=i*(or+e),_r+=3*i,wr(ar=t,or=e)}function Lr(t){this._context=t}Lr.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,h)}},result:C};var Pr,zr,Dr,Or,Rr,Fr=r(),jr={point:C,lineStart:function(){jr.point=Br},lineEnd:function(){Pr&&Nr(zr,Dr),jr.point=C},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var t=+Fr;return Fr.reset(),t}};function Br(t,e){jr.point=Nr,zr=Or=t,Dr=Rr=e}function Nr(t,e){Or-=t,Rr-=e,Fr.add(k(Or*Or+Rr*Rr)),Or=t,Rr=e}function Ur(){this._string=[]}function Vr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function qr(t){return function(e){var r=new Hr;for(var n in t)r[n]=t[n];return r.stream=e,r}}function Hr(){}function Gr(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),O(r,t.stream(hr)),e(hr.result()),null!=n&&t.clipExtent(n),t}function Zr(t,e,r){return Gr(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function Wr(t,e,r){return Zr(t,[[0,0],e],r)}function Yr(t,e,r){return Gr(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function Xr(t,e,r){return Gr(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Hr.prototype={constructor:Hr,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var $r=y(30*p);function Jr(t,e){return+e?function(t,e){function r(n,i,a,s,l,c,u,h,f,p,m,y,v,x){var _=u-n,b=h-i,w=_*_+b*b;if(w>4*e&&v--){var T=s+p,A=l+m,M=c+y,E=k(T*T+A*A+M*M),C=S(M/=E),I=d(d(M)-1)e||d((_*D+b*O)/w-.5)>.3||s*p+l*m+c*y<$r)&&(r(n,i,a,s,l,c,P,z,I,T/=E,A/=E,M,v,x),x.point(P,z),r(P,z,I,T,A,M,u,h,f,p,m,y,v,x))}}return function(e){var n,i,a,o,s,l,c,u,h,f,p,d,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){u=NaN,m.point=v,e.lineStart()}function v(n,i){var a=X([n,i]),o=t(n,i);r(u,h,c,f,p,d,u=o[0],h=o[1],c=n,f=a[0],p=a[1],d=a[2],16,e),e.point(u,h)}function x(){m.point=g,e.lineEnd()}function _(){y(),m.point=b,m.lineEnd=w}function b(t,e){v(n=t,e),i=u,a=h,o=f,s=p,l=d,m.point=v}function w(){r(u,h,c,f,p,d,i,a,n,o,s,l,16,e),m.lineEnd=x,x()}return m}}(t,e):function(t){return qr({point:function(e,r){e=t(e,r),this.stream.point(e[0],e[1])}})}(t)}var Kr=qr({point:function(t,e){this.stream.point(t*p,e*p)}});function Qr(t,e,r,n,i){function a(a,o){return[e+t*(a*=n),r-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*n,(r-o)/t*i]},a}function tn(t,e,r,n,i,a){var o=y(a),s=w(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*r-o*e)/t,p=(s*e+o*r)/t;function d(t,a){return[l*(t*=n)-c*(a*=i)+e,r-c*t-l*a]}return d.invert=function(t,e){return[n*(u*t-h*e+f),i*(p-h*t-u*e)]},d}function en(t){return rn((function(){return t}))()}function rn(t){var e,r,n,i,a,o,s,l,c,u,h=150,d=480,m=250,g=0,y=0,v=0,x=0,_=0,b=0,w=1,T=1,A=null,M=ye,S=null,E=Ge,C=.5;function I(t){return l(t[0]*p,t[1]*p)}function L(t){return(t=l.invert(t[0],t[1]))&&[t[0]*f,t[1]*f]}function P(){var t=tn(h,0,0,w,T,b).apply(null,e(g,y)),n=(b?tn:Qr)(h,d-t[0],m-t[1],w,T,b);return r=Qt(v,x,_),s=Jt(e,n),l=Jt(r,s),o=Jr(s,C),z()}function z(){return c=u=null,I}return I.stream=function(t){return c&&u===t?c:c=Kr(function(t){return qr({point:function(e,r){var n=t(e,r);return this.stream.point(n[0],n[1])}})}(r)(M(o(E(u=t)))))},I.preclip=function(t){return arguments.length?(M=t,A=void 0,z()):M},I.postclip=function(t){return arguments.length?(E=t,S=n=i=a=null,z()):E},I.clipAngle=function(t){return arguments.length?(M=+t?ve(A=t*p):(A=null,ye),z()):A*f},I.clipExtent=function(t){return arguments.length?(E=null==t?(S=n=i=a=null,Ge):be(S=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),z()):null==S?null:[[S,n],[i,a]]},I.scale=function(t){return arguments.length?(h=+t,P()):h},I.translate=function(t){return arguments.length?(d=+t[0],m=+t[1],P()):[d,m]},I.center=function(t){return arguments.length?(g=t[0]%360*p,y=t[1]%360*p,P()):[g*f,y*f]},I.rotate=function(t){return arguments.length?(v=t[0]%360*p,x=t[1]%360*p,_=t.length>2?t[2]%360*p:0,P()):[v*f,x*f,_*f]},I.angle=function(t){return arguments.length?(b=t%360*p,P()):b*f},I.reflectX=function(t){return arguments.length?(w=t?-1:1,P()):w<0},I.reflectY=function(t){return arguments.length?(T=t?-1:1,P()):T<0},I.precision=function(t){return arguments.length?(o=Jr(s,C=t*t),z()):k(C)},I.fitExtent=function(t,e){return Zr(I,t,e)},I.fitSize=function(t,e){return Wr(I,t,e)},I.fitWidth=function(t,e){return Yr(I,t,e)},I.fitHeight=function(t,e){return Xr(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&L,P()}}function nn(t){var e=0,r=l/3,n=rn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*p,r=t[1]*p):[e*f,r*f]},i}function an(t,e){var r=w(t),n=(r+w(e))/2;if(d(n)0?e<-c+o&&(e=-c+o):e>c-o&&(e=c-o);var r=i/b(dn(e),n);return[r*w(n*t),i-r*y(n*t)]}return a.invert=function(t,e){var r=i-e,a=T(n)*k(t*t+r*r),o=g(t,d(r))*T(r);return r*n<0&&(o-=l*T(t)*T(r)),[o/n,2*m(b(i/a,1/n))-c]},a}function gn(t,e){return[t,e]}function yn(t,e){var r=y(t),n=t===e?w(t):(r-y(e))/(e-t),i=r/n+t;if(d(n)o&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},Mn.invert=cn(S),Sn.invert=cn((function(t){return 2*m(t)})),En.invert=function(t,e){return[-e,2*m(x(t))-c]},t.geoAlbers=sn,t.geoAlbersUsa=function(){var t,e,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function h(t){var e=t[0],o=t[1];return a=null,r.point(e,o),a||(n.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,h}return h.invert=function(t){var e=s.scale(),r=s.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},h.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++rRt(n[0],n[1])&&(n[1]=i[1]),Rt(i[0],n[1])>Rt(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Rt(n[1],i[0]))>o&&(o=s,et=i[0],nt=n[1])}return ct=ut=null,et===1/0||rt===1/0?[[NaN,NaN],[NaN,NaN]]:[[et,rt],[nt,it]]},t.geoCentroid=function(t){ht=ft=pt=dt=mt=gt=yt=vt=xt=_t=bt=0,O(t,Bt);var e=xt,r=_t,n=bt,i=e*e+r*r+n*n;return i2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=En,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,fg()):n((r=r||self).d3=r.d3||{},r.d3)}}),dg=f({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(t,e){var r,n;r=t,n=function(t,e,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,f=Math.pow,p=Math.round,d=Math.sign||function(t){return t>0?1:t<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,_=x/2,b=x/4,w=Math.SQRT1_2,T=I(2),k=I(x),A=2*x,M=180/x,S=x/180;function E(t){return t>1?_:t<-1?-_:Math.asin(t)}function C(t){return t>1?0:t<-1?x:Math.acos(t)}function I(t){return t>0?Math.sqrt(t):0}function L(t){return(s(t)-s(-t))/2}function P(t){return(s(t)+s(-t))/2}function z(t){var e=g(t/2),r=2*c(o(t/2))/(e*e);function i(t,e){var n=o(t),i=o(e),a=m(e),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(t),l*a]}return i.invert=function(e,i){var s,l=I(e*e+i*i),u=-t/2,h=50;if(!l)return[0,0];do{var f=u/2,p=o(f),d=m(f),g=d/p,v=-c(n(p));u-=s=(2/g*v-r*g-l)/(-v/(d*d)+1-r/(2*p*p))*(p<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(e*x,l*o(u)),E(i*x/l)]},i}function D(t,e){var r=o(e),n=function(t){return t?t/Math.sin(t):1}(C(r*o(t/=2)));return[2*r*m(t)*n,m(e)*n]}function O(t){var e=m(t),r=o(t),i=t>=0?1:-1,s=g(i*t),l=(1+e-r)/2;function c(t,n){var c=o(n),u=o(t/=2);return[(1+c)*m(t),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*e*u]}return c.invert=function(t,c){var u=0,h=0,f=50;do{var p=o(u),d=m(u),g=o(h),v=m(h),x=1+g,_=x*d-t,b=l+v*r-x*e*p-c,w=x*p/2,T=-d*v,k=e*x*d/2,A=r*g+e*p*v,M=T*k-A*w,S=(b*T-_*A)/M/2,E=(_*k-b*w)/M;n(E)>2&&(E/=2),u-=S,h-=E}while((n(S)>y||n(E)>y)&&--f>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function R(t,e){var r=g(e/2),n=I(1-r*r),i=1+n*o(t/=2),a=m(t)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}D.invert=function(t,e){if(!(t*t+4*e*e>x*x+y)){var r=t,i=e,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),f=o(i),p=m(2*i),d=h*h,g=f*f,v=c*c,_=1-g*u*u,b=_?C(f*u)*I(s=1/_):s=0,w=2*b*f*c-t,T=b*h-e,k=s*(g*v+b*f*u*d),A=s*(.5*l*p-2*b*h*c),M=.25*s*(p*c-b*h*g*l),S=s*(d*u+b*v*f),E=A*M-S*k;if(!E)break;var L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]}},R.invert=function(t,e){if(e*=3/8,!(t*=3/8)&&n(e)>1)return null;var r=1+t*t+e*e,i=I((r-I(r*r-4*e*e))/2),s=E(i)/3,l=i?function(t){return c(t+I(t*t-1))}(n(e/i))/3:function(t){return c(t+I(t*t+1))}(n(t))/3,u=o(s),h=P(l),f=h*h-u*u;return[2*d(t)*a(L(l)*u,.25-f),2*d(e)*a(h*m(s),.25+f)]};var F=I(8),j=c(1+T);function B(t,e){var r=n(e);return r_){var l=a(s[1],s[0]),c=I(s[0]*s[0]+s[1]*s[1]),u=r*p((l-_)/r)+_,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(t,n){var s=I(t*t+n*n);if(s>_){var l=a(n,t),c=r*p((l-_)/r)+_,u=l>c?-1:1,h=s*o(c-l),f=1/g(u*C((h-x)/I(x*(x-2*h)+s*s)));l=c+2*i((f+u*I(f*f-3))/3),t=s*o(l),n=s*m(l)}return e.geoAzimuthalEquidistantRaw.invert(t,n)},s}function U(t,r){if(arguments.length<2&&(r=t),1===r)return e.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=e.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=t,a}return n.invert=function(n,i){var a=e.geoAzimuthalEqualAreaRaw.invert(n/t,i);return a[0]*=r,a},n}function V(t,e){return[t*o(e)/o(e/=2),2*m(e)]}function q(t,e,r){var i,a,o,s=100;r=void 0===r?0:+r,e=+e;do{(a=t(r))===(o=t(r+y))&&(o=a+y),r-=i=-1e-6*(a-e)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(t,e,r){return void 0===e&&(e=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;hl)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=t(o+g,s),x=t(o,s+y),_=(v[0]-f[0])/g,b=(v[1]-f[1])/g,w=(x[0]-f[0])/y,T=(x[1]-f[1])/y,k=T*_-b*w,A=(n(k)<.5?.5:1)/k;if(o+=c=(d*w-p*T)*A,s+=u=(p*b-d*_)*A,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return e.invert=H(e),e}function Z(t,e){var r,i=t*m(e),a=30;do{e-=r=(e+m(e)-i)/(1+o(e))}while(n(r)>y&&--a>0);return e/2}function W(t,e,r){function n(n,i){return[t*n*o(i=Z(r,i)),e*m(i)]}return n.invert=function(n,i){return i=E(i/e),[n/(t*o(i)),E((2*i+m(2*i))/r)]},n}B.invert=function(t,e){if((a=n(e))v&&--u>0);return[t/(o(l)*(F-1/m(l))),d(e)*l]},V.invert=function(t,e){var r=2*E(e/2);return[t*o(r/2)/o(r),r]};var Y=W(T/_,T,x),X=2.00276,$=1.11072;function J(t,e){var r=Z(x,e);return[X*t/(1/o(e)+$/o(r)),(e+T*m(r))/X]}function K(t){var r=0,n=e.geoProjectionMutator(t),i=n(r);return i.parallel=function(t){return arguments.length?n(r=t*S):r*M},i}function Q(t,e){return[t*o(e),e]}function tt(t){if(!t)return Q;var e=1/g(t);function r(r,n){var i=e+t-n,a=i?r*o(n)/i:i;return[i*m(a),e-i*o(a)]}return r.invert=function(r,n){var i=I(r*r+(n=e-n)*n),s=e+t-i;return[i/o(s)*a(r,n),s]},r}function et(t){function e(e,r){var n=_-r,i=n?e*t*m(n)/n:n;return[n*m(i)/t,_-n*o(i)]}return e.invert=function(e,r){var n=e*t,i=_-r,o=I(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/t,_-o]},e}J.invert=function(t,e){var r,i,a=X*e,s=e<0?-b:b,l=25;do{i=a-T*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*T*o(s))}while(n(r)>y&&--l>0);return i=a-T*m(s),[t*(1/o(i)+$/o(s))/X,i]},Q.invert=function(t,e){return[t/o(e),e]};var rt=W(1,4/x,x);function nt(t,e,r,i,s,l){var c,u=o(l);if(n(t)>1||n(l)>1)c=C(r*s+e*i*u);else{var h=m(t/2),f=m(l/2);c=2*E(I(h*h+e*i*f*f))}return n(c)>y?[c,a(i*m(l),e*s-r*i*u)]:[0,0]}function it(t,e,r){return C((t*t+e*e-r*r)/(2*t*e))}function at(t){return t-2*x*l((t+x)/(2*x))}function ot(t,e,r){for(var n,i=[[t[0],t[1],m(t[1]),o(t[1])],[e[0],e[1],m(e[1]),o(e[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=nt(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=it(i[0].v[0],i[2].v[0],i[1].v[0]),c=it(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(t,e){var r,n=m(e),a=o(e),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=nt(e-l[1],l[3],l[2],a,n,t-l[0]),!s[r][0])return l.point;s[r][1]=at(s[r][1]-l.v[1])}var f=h.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,d=it(i[r].v[0],s[r][0],s[p][0]);s[r][1]<0&&(d=-d),r?1==r?(d=c-d,f[0]-=s[r][0]*o(d),f[1]-=s[r][0]*m(d)):(d=u-d,f[0]+=s[r][0]*o(d),f[1]+=s[r][0]*m(d)):(f[0]+=s[r][0]*o(d),f[1]-=s[r][0]*m(d))}return f[0]/=3,f[1]/=3,f}}function st(t){return t[0]*=S,t[1]*=S,t}function lt(t,r,n){var i=e.geoCentroid({type:"MultiPoint",coordinates:[t,r,n]}),a=[-i[0],-i[1]],o=e.geoRotation(a),s=ot(st(o(t)),st(o(r)),st(o(n)));s.invert=H(s);var l=e.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(t){return arguments.length?c(o(t)):o.invert(c())},l.clipAngle(90)}function ct(t,e){var r=I(1-m(e));return[2/k*t*r,k*(1-r)]}function ut(t){var e=g(t);function r(t,r){return[t,(t?t/m(t):1)*(m(r)*o(t)-e*o(r))]}return r.invert=e?function(t,r){t&&(r*=m(t)/t);var n=o(t);return[t,2*a(I(n*n+e*e-r*r)-n,e-r)]}:function(t,e){return[t,E(t?e*g(t)/t:e)]},r}ct.invert=function(t,e){var r=(r=e/k-1)*r;return[r>0?t*I(x/r)/2:0,E(1-r)]};var ht=I(3);function ft(t,e){return[ht*t*(2*o(2*e/3)-1)/k,ht*k*m(e/3)]}function pt(t){var e=o(t);function r(t,r){return[t*e,m(r)/e]}return r.invert=function(t,r){return[t/e,E(r*e)]},r}function dt(t){var e=o(t);function r(t,r){return[t*e,(1+e)*g(r/2)]}return r.invert=function(t,r){return[t/e,2*i(r/(1+e))]},r}function mt(t,e){var r=I(8/(3*x));return[r*t*(1-n(e)/x),r*e]}function gt(t,e){var r=I(4-3*m(n(e)));return[2/I(6*x)*t*r,d(e)*I(2*x/3)*(2-r)]}function yt(t,e){var r=I(x*(4+x));return[2/r*t*(1+I(1-4*e*e/(x*x))),4/r*e]}function vt(t,e){var r=(2+_)*m(e);e/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(e);e-=a=(e+m(e)*(s+2)-r)/(2*s*(1+s))}return[2/I(x*(4+x))*t*(1+o(e)),2*I(x/(4+x))*m(e)]}function xt(t,e){return[t*(1+o(e))/I(2+x),2*e/I(2+x)]}function _t(t,e){for(var r=(1+_)*m(e),i=0,a=1/0;i<10&&n(a)>y;i++)e-=a=(e+m(e)-r)/(1+o(e));return r=I(2+x),[t*(1+o(e))/r,2*e/r]}ft.invert=function(t,e){var r=3*E(e/(ht*k));return[k*t/(ht*(2*o(2*r/3)-1)),r]},mt.invert=function(t,e){var r=I(8/(3*x)),i=e/r;return[t/(r*(1-n(i)/x)),i]},gt.invert=function(t,e){var r=2-n(e)/I(2*x/3);return[t*I(6*x)/(2*r),d(e)*E((4-r*r)/3)]},yt.invert=function(t,e){var r=I(x*(4+x))/2;return[t*r/(1+I(1-e*e*(4+x)/(4*x))),e*r/2]},vt.invert=function(t,e){var r=e*I((4+x)/x)/2,n=E(r),i=o(n);return[t/(2/I(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+_))]},xt.invert=function(t,e){var r=I(2+x),n=e*r/2;return[r*t/(1+o(n)),n]},_t.invert=function(t,e){var r=1+_,n=I(r/2);return[2*t*n/(1+o(e*=n)),E((e+m(e))/r)]};var bt=3+2*T;function wt(t,e){var r=m(t/=2),n=o(t),a=I(o(e)),s=o(e/=2),l=m(e)/(s+T*n*a),u=I(2/(1+l*l)),h=I((T*s+(n+r)*a)/(T*s+(n-r)*a));return[bt*(u*(h-1/h)-2*c(h)),bt*(u*l*(h+1/h)-2*i(l))]}wt.invert=function(t,e){if(!(r=R.invert(t/1.2,1.065*e)))return null;var r,a=r[0],s=r[1],l=20;t/=bt,e/=bt;do{var f=a/2,p=s/2,d=m(f),g=o(f),v=m(p),x=o(p),b=o(s),k=I(b),A=v/(x+T*g*k),M=A*A,S=I(2/(1+M)),E=(T*x+(g+d)*k)/(T*x+(g-d)*k),C=I(E),L=C-1/C,P=C+1/C,z=S*L-2*c(C)-t,D=S*A*P-2*i(A)-e,O=v&&w*k*d*M/v,F=(T*g*x+k)/(2*(x+T*g*k)*(x+T*g*k)*k),j=-.5*A*S*S*S,B=j*O,N=j*F,U=(U=2*x+T*k*(g-d))*U*C,V=(T*g*x*k+b)/U,q=-T*d*v/(k*U),H=L*B-2*V/C+S*(V+V/E),G=L*N-2*q/C+S*(q+q/E),Z=A*P*B-2*O/(1+M)+S*P*O+S*A*(V-V/E),W=A*P*N-2*F/(1+M)+S*P*F+S*A*(q-q/E),Y=G*Z-W*H;if(!Y)break;var X=(D*G-z*W)/Y,$=(z*Z-D*H)/Y;a-=X,s=u(-_,h(_,s-$))}while((n(X)>y||n($)>y)&&--l>0);return n(n(s)-_)s){var d=I(f),g=a(h,u),v=i*p(g/i),b=g-v,w=t*o(b),T=(t*m(b)-b*m(w))/(_-w),k=It(b,T),A=(x-t)/Lt(k,w,x);u=d;var M,S=50;do{u-=M=(t+Lt(k,w,u)*A-d)/(k(u)*A)}while(n(M)>y&&--S>0);h=b*m(u),u<_&&(h-=T*(u-_));var E=m(v),C=o(v);c[0]=u*C-h*E,c[1]=u*E+h*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=I(c),h=a(l,r),f=i*p(h/i),d=h-f;r=u*o(d),l=u*m(d);for(var g=r-_,y=m(r),b=l/y,w=r<_?1/0:0,T=10;;){var k=t*m(b),A=t*o(b),M=m(A),S=_-A,E=(k-b*M)/S,C=It(b,E);if(n(w)y||n(p)>y)&&--v>0);return[d,g]},u}kt.invert=function(t,e){var r=e/(1+Tt);return[t&&t/(Tt*I(1-r*r)),2*i(r)]},At.invert=function(t,e){var r=i(e/k),n=o(r),a=2*r;return[t*k/2/(o(a)*n*n),a]};var zt=Pt(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Dt=Pt(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ot=Pt(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Rt(t,e){var r=t*t,n=e*e;return[t*(1-.162388*n)*(.87-952426e-9*r*r),e*(1+n/12)]}Rt.invert=function(t,e){var r,i=t,a=e,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-e)/(1+s/4)}while(n(r)>y&&--o>0);o=50,t/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-t)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var Ft=Pt(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function jt(t){var e=t(_,0)[0]-t(-_,0)[0];function r(r,n){var i=r>0?-.5:.5,a=t(r+i*x,n);return a[0]-=i*e,a}return t.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=t.invert(r+i*e,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function Bt(t,e){var r=d(t),i=d(e),s=o(e),l=o(t)*s,c=m(t)*s,u=m(i*e);t=n(a(c,u)),e=E(l),n(t-_)>y&&(t%=_);var h=function(t,e){if(e===_)return[0,0];var r,i,a=m(e),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,f=E(1/I(c)),p=h+s*c*f,d=(1-a)/p,g=I(d),v=d*c,b=I(v),w=g*h;if(0===t)return[0,-(w+s*b)];var T,k=o(e),A=1/k,M=2*a*k,S=(-3*s+f*u)*M,C=(-p*k-(1-a)*S)/(p*p),L=-A*M,P=-A*(s*c*C+d*u*M),z=-2*A*(h*(.5*C/g)-2*s*g*M),D=4*t/x;if(t>.222*x||e.175*x){if(r=(w+s*I(v*(1+l)-w*w))/(1+l),t>x/4)return[r,r];var O=r,R=.5*r;r=.5*(R+O),i=50;do{var F=r*(z+L*I(v-r*r))+P*E(r/b)-D;if(!F)break;F<0?R=r:O=r,r=.5*(R+O)}while(n(O-R)>y&&--i>0)}else{r=y,i=25;do{var j=r*r,B=I(v-j),N=z+L*B,U=r*N+P*E(r/b)-D;r-=T=B?U/(N+(P-L*j)/B):0}while(n(T)>y&&--i>0)}return[r,-w-s*I(v-r*r)]}(t>x/4?_-t:t,e);return t>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Nt(t,e){var r,a,l,c,u,h;if(e=.999999)return r=(1-e)/4,l=1/(a=P(t)),[(c=((h=s(2*(h=t)))-1)/(h+1))+r*((u=a*L(t))-t)/(a*a),l-r*c*l*(u-t),l+r*c*l*(u+t),2*i(s(t))-_+r*(u-t)/a];var f=[1,0,0,0,0,0,0,0,0],p=[I(e),0,0,0,0,0,0,0,0],d=0;for(a=I(1-e),u=1;n(p[d]/f[d])>y&&d<8;)r=f[d++],p[d]=(r-a)/2,f[d]=(r+a)/2,a=I(r*a),u*=2;l=u*f[d]*t;do{l=(E(c=p[d]*m(a=l)/f[d])+l)/2}while(--d);return[m(l),c=o(l),c/o(l-a),l]}function Ut(t,e){if(!e)return t;if(1===e)return c(g(t/2+b));for(var r=1,a=I(1-e),o=I(e),s=0;n(o)>y;s++){if(t%x){var l=i(a*g(t)/r);l<0&&(l+=x),t+=l+~~(t/x)*x}else t+=t;o=(r+a)/2,a=I(r*a),o=((r=o)-a)/2}return t/(f(2,s)*r)}function Vt(t,e){var r=(T-1)/(T+1),l=I(1-r*r),u=Ut(_,l*l),h=c(g(x/4+n(e)/2)),f=s(-1*h)/I(r),p=function(t,e){var r=t*t,n=e+1,i=1-r-e*e;return[.5*((t>=0?_:-_)-a(i,2*t)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(f*o(-1*t),f*m(-1*t)),y=function(t,e,r){var a=n(t),o=L(n(e));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+I(c*c-(r-1)*l*4))/2;return[Ut(i(1/I(u)),r)*d(t),Ut(i(I((u/l-1)/r)),1-r)*d(e)]}return[0,Ut(i(o),1-r)*d(e)]}(p[0],p[1],l*l);return[-y[1],(e>=0?1:-1)*(.5*u-y[0])]}function qt(t){var e=m(t),r=o(t),i=Ht(t);function s(t,a){var s=i(t,a);t=s[0],a=s[1];var l=m(a),c=o(a),u=o(t),h=C(e*l+r*c*u),f=m(h),p=n(f)>y?h/f:1;return[p*r*m(t),(n(t)>_?p:-p)*(e*c-r*l*u)]}return i.invert=Ht(-t),s.invert=function(t,r){var n=I(t*t+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*e,f=I(c*c+u*u-h*h),p=a(c*h+u*f,u*h-c*f),d=(n>_?-1:1)*a(t*s,n*o(p)*l+r*m(p)*s);return i.invert(d,p)},s}function Ht(t){var e=m(t),r=o(t);return function(t,n){var i=o(n),s=o(t)*i,l=m(t)*i,c=m(n);return[a(l,s*r-c*e),E(c*r+s*e)]}}Bt.invert=function(t,e){n(t)>1&&(t=2*d(t)-t),n(e)>1&&(e=2*d(e)-e);var r=d(t),i=d(e),s=-r*t,l=-i*e,c=l/s<1,u=function(t,e){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=I(a),u=E(1/I(1+l)),h=1-l+a*(1+l)*u,f=(1-c)/h,p=I(f),d=f*(1+l),m=p*(1-l),g=I(d-t*t),y=e+m+a*g;if(n(i-r)0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var _=E(c),b=o(_),w=1/b,T=2*c*b,k=(-h*b-(-3*a+u*(1+3*l))*T*(1-c))/(h*h),A=.5*k/p,M=(1-l)*A-2*a*p*T;return[x/4*(t*(-2*w*M+-w*T*g)+-w*(a*(1+l)*k+f*(1+3*l)*T)*E(t/I(d))),_]}(c?l:s,c?s:l),h=u[0],f=u[1],p=o(f);return c&&(h=-_-h),[r*(a(m(h)*p,-m(f))+x),i*E(o(h)*p)]},Vt.invert=function(t,e){var r,n,o,l,u,h,f=(T-1)/(T+1),p=I(1-f*f),d=Ut(_,p*p),m=(n=-t,o=p*p,(r=.5*d-e)?(l=Nt(r,o),n?(h=(u=Nt(n,1-o))[1]*u[1]+o*l[0]*l[0]*u[0]*u[0],[[l[0]*u[2]/h,l[1]*l[2]*u[0]*u[1]/h],[l[1]*u[1]/h,-l[0]*l[2]*u[0]*u[2]/h],[l[2]*u[1]*u[2]/h,-o*l[0]*l[1]*u[0]/h]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(u=Nt(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),g=function(t,e){var r=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/r,(t[1]*e[0]-t[0]*e[1])/r]}(m[0],m[1]);return[a(g[1],g[0])/-1,2*i(s(-.5*c(f*g[0]*g[0]+f*g[1]*g[1])))-_]};var Gt=E(1-1/3)*M,Zt=pt(0);function Wt(t){var e=Gt*S,r=ct(x,e)[0]-ct(-x,e)[0],i=Zt(0,e)[1],a=ct(0,e)[1],o=k-a,s=A/t,c=4/A,f=i+o*o*4/A;function p(p,d){var m,g=n(d);if(g>e){var y=h(t-1,u(0,l((p+x)/s)));(m=ct(p+=x*(t-1)/t-y*s,g))[0]=m[0]*A/r-A*(t-1)/(2*t)+y*A/t,m[1]=i+4*(m[1]-a)*o/A,d<0&&(m[1]=-m[1])}else m=Zt(p,d);return m[0]*=c,m[1]/=f,m}return p.invert=function(e,p){e/=c;var d=n(p*=f);if(d>i){var m=h(t-1,u(0,l((e+x)/s)));e=(e+x*(t-1)/t-m*s)*r/A;var g=ct.invert(e,.25*(d-i)*A/o+a);return g[0]-=x*(t-1)/t-m*s,p<0&&(g[1]=-g[1]),g}return Zt.invert(e,p)},p}function Yt(t,e){return[t,1&e?89.999999:Gt]}function Xt(t,e){return[t,1&e?-89.999999:-Gt]}function $t(t){return[.999999*t[0],t[1]]}function Jt(t){var e,r=1+t,i=E(m(1/r)),s=2*I(x/(e=x+4*i*r)),l=.5*s*(r+I(t*(2+t))),c=t*t,u=r*r;function h(h,f){var p,d,g=1-m(f);if(g&&g<2){var y,b=_-f,w=25;do{var T=m(b),k=o(b),A=i+a(T,r-k),M=1+u-2*r*k;b-=y=(b-c*i-r*T+M*A-.5*g*e)/(2*r*T*A)}while(n(y)>v&&--w>0);p=s*I(M),d=h*A/x}else p=s*(t+g),d=h*i/x;return[p*m(d),l-p*o(d)]}return h.invert=function(t,n){var o=t*t+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),f=C(h),p=m(f),d=i+a(p,r-h);return[E(t/I(o))*x/d,E(1-2*(f-c*i-r*p+(1+u-2*r*h)*d)/e)]},h}var Kt=.7109889596207567,Qt=.0528035274542;function te(t,e){return e>-Kt?((t=Y(t,e))[1]+=Qt,t):Q(t,e)}function ee(t,e){return n(e)>Kt?((t=Y(t,e))[1]-=e>0?Qt:-Qt,t):Q(t,e)}function re(t,e,r,n){var i=I(4*x/(2*r+(1+t-e/2)*m(2*r)+(t+e)/2*m(4*r)+e/2*m(6*r))),a=I(n*m(r)*I((1+t*o(2*r)+e*o(4*r))/(1+t+e))),s=r*c(1);function l(r){return I(1+t*o(2*r)+e*o(4*r))}function c(n){var i=n*r;return(2*i+(1+t-e/2)*m(2*i)+(t+e)/2*m(4*i)+e/2*m(6*i))/r}function u(t){return l(t)*m(t)}var h=function(t,e){var n=r*q(c,s*m(e)/r,e/x);isNaN(n)&&(n=r*d(e));var u=i*l(n);return[u*a*t/x*o(n),u/a*m(n)]};return h.invert=function(t,e){var n=q(u,e*a/i);return[t*x/(o(n)*i*a*l(n)),E(r*c(n/r)/s)]},0===r&&(i=I(n/x),(h=function(t,e){return[t*i,m(e)/i]}).invert=function(t,e){return[t/i,E(e*i)]}),h}function ne(t,e,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,f,p,d,m,g,y,v,x,_;if(f=t(e+.25*(h=r-e)),p=t(r-.25*h),isNaN(f))u.nanEncountered=!0;else{if(!isNaN(p))return _=((g=(d=h*(n+4*f+i)/12)+(m=h*(i+4*p+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+_):Math.abs(_)t?r=n:e=n,n=e+r>>1}while(n>e);var i=c[n+1]-c[n];return i&&(i=(t-c[n+1])/i),(n+1+i)/s}var p=2*h(1)/x*o/r,g=function(t,e){var r=h(n(m(e))),a=i(r)*t;return r/=p,[a,e>=0?r:-r]};return g.invert=function(t,e){var r;return n(e*=p)<1&&(r=d(e)*E(a(n(e))*o)),[t/i(n(e)),r]},g}function oe(t,e){return n(t[0]-e[0])a[o][2][0];++o);var l=t(e-a[o][1][0],r);return l[0]+=t(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):t.invert&&(s.invert=function(e,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l=0;--l)n=(e=t[1][l])[0][0],i=e[0][1],a=e[1][1],o=e[2][0],s=e[2][1],c.push(se([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(e),n=e.map((function(t){return t.map((function(t){return[[t[0][0]*S,t[0][1]*S],[t[1][0]*S,t[1][1]*S],[t[2][0]*S,t[2][1]*S]]}))})),o=n.map((function(e){return e.map((function(e){var r,n=t(e[0][0],e[0][1])[0],i=t(e[2][0],e[2][1])[0],a=t(e[1][0],e[0][1])[1],o=t(e[1][0],e[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(t){return t.map((function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]}))}))},null!=n&&l.lobes(n),l}te.invert=function(t,e){return e>-Kt?Y.invert(t,e-Qt):Q.invert(t,e)},ee.invert=function(t,e){return n(e)>Kt?Y.invert(t,e+(e>0?Qt:-Qt)):Q.invert(t,e)};var ce=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ue=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],he=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],pe=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],de=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function me(t,e){return[3/A*t*I(x*x/3-e*e),e]}function ge(t){function e(e,r){if(n(n(r)-_)2)return null;var o=(e/=2)*e,s=(r/=2)*r,l=2*r/(1+o+s);return l=f((1+l)/(1-l),1/t),[a(2*e,1-o-s)/t,E((l-1)/(l+1))]},e}me.invert=function(t,e){return[A/3*t/I(x*x/3-e*e),e]};var ye=x/T;function ve(t,e){return[t*(1+I(o(e)))/2,e/(o(e/2)*o(t/6))]}function xe(t,e){var r=t*t,n=e*e;return[t*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),e*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function _e(t,e){return[m(t)/o(e),g(e)*o(t)]}function be(t){var e=o(t),r=g(b+t/2);function i(i,a){var o=a-t,s=n(o)=0;)f=(h=t[u])[0]+l*(i=f)-c*p,p=h[1]+l*p+c*i;return[f=l*(i=f)-c*p,p=l*p+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,f=e,p=t[f],d=p[0],g=p[1],y=0,v=0;--f>=0;)y=d+c*(h=y)-u*v,v=g+c*v+u*h,d=(p=t[f])[0]+c*(h=d)-u*g,g=p[1]+c*g+u*h;var x,_,b=(y=d+c*(h=y)-u*v)*y+(v=g+c*v+u*h)*v;c-=x=((d=c*(h=d)-u*g-r)*y+(g=c*g+u*h-s)*v)/b,u-=_=(g*y-d*v)/b}while(n(x)+n(_)>1e-12&&--l>0);if(l){var w=I(c*c+u*u),T=2*i(.5*w),k=m(T);return[a(c*k,w*o(T)),w?E(u*k/w):0]}},r}ve.invert=function(t,e){var r=n(t),i=n(e),a=y,s=_;iy||n(_)>y)&&--a>0);return a&&[r,i]},_e.invert=function(t,e){var r=t*t,n=e*e+1,i=r+n,a=t?w*I((i-I(i*i-4*r))/r):1/I(n);return[E(t*a),d(e)*C(a)]},we.invert=function(t,e){return[t,2.5*i(s(.8*e))-.625*x]};var ke=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Ae=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Me=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Se=[[.9245,0],[0,0],[.01943,0]],Ee=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ce(t,r){var n=e.geoProjection(Te(t)).rotate(r).clipAngle(90),i=e.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(t){return arguments.length?a(i(t)):i.invert(a())},n}var Ie=I(6),Le=I(7);function Pe(t,e){var r=E(7*m(e)/(3*Ie));return[Ie*t*(2*o(2*r/3)-1)/Le,9*m(r/3)/Le]}function ze(t,e){for(var r,i=(1+w)*m(e),a=e,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)v&&--l>0);return[t/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Re.invert=function(t,e){for(var r=e/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(e/2);e-=a=(e-g(e/2)-r)/(1-.5/(s*s))}return[2*t/(1+o(e)),e]};var Fe=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function je(t,e){var r=m(e),i=o(e),a=d(t);if(0===t||n(e)===_)return[0,e];if(0===e)return[t,0];if(n(t)===_)return[t*i,_*r];var s=x/(2*t)-2*t/x,l=2*e/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,f=1+u/h,p=1+h/u,g=(s*r/c-s/2)/f,y=(h*r/u+c/2)/p,v=y*y-(h*r*r/u+c*r-1)/p;return[_*(g+I(g*g+i*i/f)*a),_*(y+I(v<0?0:v)*d(-e*s)*a)]}je.invert=function(t,e){var r=(t/=_)*t,n=r+(e/=_)*e,i=x*x;return[t?(n-1+I((1-n)*(1-n)+4*r))/(2*t)*_:0,q((function(t){return n*(x*m(t)-2*t)*x+4*t*t*(e-m(t))+2*x*t-i*e}),0)]};var Be=1.0148,Ne=.23185,Ue=-.14499,Ve=.02406,qe=Be,He=5*Ne,Ge=1.790857183;function Ze(t,e){var r=e*e;return[t,e*(Be+r*r*(Ne+r*(Ue+Ve*r)))]}function We(t,e){if(n(e)=0;)if(n=e[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(e.face,r.face),i=Ye(n.map(r.project),n.map(e.project));e.transform=r.transform?Xe(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;oGe?e=Ge:e<-1.790857183&&(e=-1.790857183);var r,i=e;do{var a=i*i;i-=r=(i*(Be+a*a*(Ne+a*(Ue+Ve*a)))-e)/(qe+a*a*(He+a*(.21654*a-1.01493)))}while(n(r)>y);return[t,i]},We.invert=function(t,e){if(n(e)y&&--s>0);return l=g(a),[(n(e)n^p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0}))||t.push([e])})),dr=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function vr(t){var r=t(_,0)[0]-t(-_,0)[0];function i(e,i){var a=n(e)<_,o=t(a?e:e>0?e-x:e+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-d(l)*c,u*l-d(s)*c]}return t.invert&&(i.invert=function(e,i){var a=(e+i)*w,o=(i-e)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*e+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var f=t.invert(a,o);return s||(f[0]+=a>0?x:-x),f}),e.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function xr(){return vr(Vt).scale(111.48)}function _r(t){var e=m(t);function r(r,n){var a=e?g(r*e/2)/e:r/2;if(!n)return[2*a,-t];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-t]}return r.invert=function(r,a){if(n(a+=t)y&&--u>0);var d=r*(h=g(c)),v=g(n(a)0?_:-_)*(f+o*(d-c)/2+o*o*(d-2*f+c)/2)]}function Tr(t,e){var r=function(t){function e(e,r){var n=o(r),i=(t-1)/(t-n*o(e));return[i*n*m(e),i*m(r)]}return e.invert=function(e,r){var n=e*e+r*r,i=I(n),o=(t-I(1-n*(t+1)/(t-1)))/((t-1)/i+i/(t-1));return[a(e*o,i*I(1-o*o)),i?E(r*o/i):0]},e}(t);if(!e)return r;var n=o(e),i=m(e);function s(e,a){var o=r(e,a),s=o[1],l=s*i/(t-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(e,a){var o=(t-1)/(t-1-a*i);return r.invert(o*e,o*a*n)},s}br.forEach((function(t){t[1]*=1.0144})),wr.invert=function(t,e){var r=e/_,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=br[o][1],c=br[o+1][1],f=br[h(19,o+2)][1],p=f-s,d=f-2*c+s,m=2*(n(r)-c)/p,g=d/p,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(e>=0?5:-5)*(y+a);var x,b=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=br[o][1],c=br[o+1][1],f=br[h(19,o+2)][1],i-=(x=(e>=0?_:-_)*(c+y*(f-s)/2+y*y*(f-2*c+s)/2)-e)*M}while(n(x)>v&&--b>0);break}}while(--o>=0);var w=br[o][0],T=br[o+1][0],k=br[h(19,o+2)][0];return[t/(T+y*(k-w)/2+y*y*(k-2*T+w)/2),i*S]};var kr=-180,Ar=-179.9999,Mr=179.9999,Sr=-89.9999,Er=89.9999;function Cr(t){return t.length>0}function Ir(t){return-90===t||90===t?[0,t]:[kr,(e=t,Math.floor(1e4*e)/1e4)];var e}function Lr(t){var e=t[0],r=t[1],n=!1;return e<=Ar?(e=kr,n=!0):e>=Mr&&(e=180,n=!0),r<=Sr?(r=-90,n=!0):r>=Er&&(r=90,n=!0),n?[e,r]:t}function Pr(t){return t.map(Lr)}function zr(t,e,r){for(var n=0,i=t.length;n=Mr||u<=Sr||u>=Er){a[o]=Lr(l);for(var h=o+1;hAr&&pSr&&d=s)break;r.push({index:-1,polygon:e,ring:a=a.slice(h-1)}),a[0]=Ir(a[0][1]),o=-1,s=a.length}}}}function Dr(t){var e,r,n,i,a,o,s=t.length,l={},c={};for(e=0;e0?x-l:l)*M],u=e.geoProjection(t(s)).rotate(c),h=e.geoRotation(c),f=u.center;return delete u.rotate,u.center=function(t){return arguments.length?f(h(t)):h.invert(f())},u.clipAngle(90)}function Br(t){var r=o(t);function n(t,n){var i=e.geoGnomonicRaw(t,n);return i[0]*=r,i}return n.invert=function(t,n){return e.geoGnomonicRaw.invert(t/r,n)},n}function Nr(t,e){return jr(Br,t,e)}function Ur(t){if(!(t*=2))return e.geoAzimuthalEquidistantRaw;var r=-t/2,n=-r,i=t*t,s=g(n),l=.5/m(n);function c(e,a){var s=C(o(a)*o(e-r)),l=C(o(a)*o(e-n));return[((s*=s)-(l*=l))/(2*t),(a<0?-1:1)*I(4*i*l-(i-s+l)*(i-s+l))/(2*t)]}return c.invert=function(t,e){var i,c,u=e*e,h=o(I(u+(i=t+r)*i)),f=o(I(u+(i=t+n)*i));return[a(c=h-f,i=(h+f)*s),(e<0?-1:1)*C(I(i*i+c*c)*l)]},c}function Vr(t,e){return jr(Ur,t,e)}function qr(t,e){if(n(e)y&&--l>0);return[d(t)*(I(a*a+4)+a)*x/4,_*s]};var Xr=4*x+3*I(3),$r=2*I(2*x*I(3)/Xr),Jr=W($r*I(3)/x,$r,Xr/6);function Kr(t,e){return[t*I(1-3*e*e/(x*x)),e]}function Qr(t,e){var r=o(e),n=o(t)*r,i=1-n,s=o(t=a(m(t)*r,-m(e))),l=m(t);return[l*(r=I(1-n*n))-s*i,-s*r-l*i]}function tn(t,e){var r=D(t,e);return[(r[0]+t/_)/2,(r[1]+e)/2]}Kr.invert=function(t,e){return[t/I(1-3*e*e/(x*x)),e]},Qr.invert=function(t,e){var r=(t*t+e*e)/-2,n=I(-r*(2+r)),i=e*r+t*n,o=t*r-e*n,s=I(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},tn.invert=function(t,e){var r=t,i=e,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,f=l*l,p=m(r),d=o(r/2),g=m(r/2),v=g*g,x=1-f*d*d,b=x?C(l*d)*I(s=1/x):s=0,w=.5*(2*b*l*g+r/_)-t,T=.5*(b*c+i)-e,k=.5*s*(f*v+b*l*d*h)+.5/_,A=s*(p*u/4-b*c*g),M=.125*s*(u*g-b*c*f*p),S=.5*s*(h*d+b*v*l)+.5,E=A*M-S*k,L=(T*A-w*S)/E,P=(w*M-T*k)/E;r-=L,i-=P}while((n(L)>y||n(P)>y)&&--a>0);return[r,i]},t.geoNaturalEarth=e.geoNaturalEarth1,t.geoNaturalEarthRaw=e.geoNaturalEarth1Raw,t.geoAiry=function(){var t=_,r=e.geoProjectionMutator(z),n=r(t);return n.radius=function(e){return arguments.length?r(t=e*S):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=z,t.geoAitoff=function(){return e.geoProjection(D).scale(152.63)},t.geoAitoffRaw=D,t.geoArmadillo=function(){var t=20*S,r=t>=0?1:-1,n=g(r*t),i=e.geoProjectionMutator(O),s=i(t),l=s.stream;return s.parallel=function(e){return arguments.length?(n=g((r=(t=e*S)>=0?1:-1)*t),i(t)):t*M},s.stream=function(e){var i=s.rotate(),c=l(e),u=(s.rotate([0,0]),l(e)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var e=-180*r;r*e<180;e+=90*r)u.point(e,90*r);if(t)for(;r*(e-=3*r*h)>=-180;)u.point(e,r*-a(o(e*S/2),n)*M);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=O,t.geoAugust=function(){return e.geoProjection(R).scale(66.1603)},t.geoAugustRaw=R,t.geoBaker=function(){return e.geoProjection(B).scale(112.314)},t.geoBakerRaw=B,t.geoBerghaus=function(){var t=5,r=e.geoProjectionMutator(N),n=r(t),i=n.stream,s=.01,l=-o(s*S),c=m(s*S);return n.lobes=function(e){return arguments.length?r(t=+e):t},n.stream=function(e){var r=n.rotate(),u=i(e),h=(n.rotate([0,0]),i(e));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var e=0,r=360/t,n=2*x/t,i=90-180/t,u=_;e=0;)t.point((e=r[i])[0],e[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=qt,t.geoHealpix=function(){var t=4,n=e.geoProjectionMutator(Wt),i=n(t),a=i.stream;return i.lobes=function(e){return arguments.length?n(t=+e):t},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){var n,i;e.geoStream((n=180/t,i=[].concat(r.range(-180,180+n/2,n).map(Yt),r.range(180,-180-n/2,-n).map(Xt)),{type:"Polygon",coordinates:[180===n?i.map($t):i]}),l)},s},i.scale(239.75)},t.geoHealpixRaw=Wt,t.geoHill=function(){var t=1,r=e.geoProjectionMutator(Jt),n=r(t);return n.ratio=function(e){return arguments.length?r(t=+e):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=Jt,t.geoHomolosine=function(){return e.geoProjection(ee).scale(152.63)},t.geoHomolosineRaw=ee,t.geoHufnagel=function(){var t=1,r=0,n=45*S,i=2,a=e.geoProjectionMutator(re),o=a(t,r,n,i);return o.a=function(e){return arguments.length?a(t=+e,r,n,i):t},o.b=function(e){return arguments.length?a(t,r=+e,n,i):r},o.psiMax=function(e){return arguments.length?a(t,r,n=+e*S,i):n*M},o.ratio=function(e){return arguments.length?a(t,r,n,i=+e):i},o.scale(180.739)},t.geoHufnagelRaw=re,t.geoHyperelliptical=function(){var t=0,r=2.5,n=1.183136,i=e.geoProjectionMutator(ae),a=i(t,r,n);return a.alpha=function(e){return arguments.length?i(t=+e,r,n):t},a.k=function(e){return arguments.length?i(t,r=+e,n):r},a.gamma=function(e){return arguments.length?i(t,r,n=+e):n},a.scale(152.63)},t.geoHyperellipticalRaw=ae,t.geoInterrupt=le,t.geoInterruptedBoggs=function(){return le(J,ce).scale(160.857)},t.geoInterruptedHomolosine=function(){return le(ee,ue).scale(152.63)},t.geoInterruptedMollweide=function(){return le(Y,he).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return le(Y,fe).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return le(te,pe,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return le(Q,de).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return e.geoProjection(me).scale(158.837)},t.geoKavrayskiy7Raw=me,t.geoLagrange=function(){var t=.5,r=e.geoProjectionMutator(ge),n=r(t);return n.spacing=function(e){return arguments.length?r(t=+e):t},n.scale(124.75)},t.geoLagrangeRaw=ge,t.geoLarrivee=function(){return e.geoProjection(ve).scale(97.2672)},t.geoLarriveeRaw=ve,t.geoLaskowski=function(){return e.geoProjection(xe).scale(139.98)},t.geoLaskowskiRaw=xe,t.geoLittrow=function(){return e.geoProjection(_e).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=_e,t.geoLoximuthal=function(){return K(be).parallel(40).scale(158.837)},t.geoLoximuthalRaw=be,t.geoMiller=function(){return e.geoProjection(we).scale(108.318)},t.geoMillerRaw=we,t.geoModifiedStereographic=Ce,t.geoModifiedStereographicRaw=Te,t.geoModifiedStereographicAlaska=function(){return Ce(ke,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return Ce(Ae,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return Ce(Me,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return Ce(Se,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return Ce(Ee,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return e.geoProjection(Y).scale(169.529)},t.geoMollweideRaw=Y,t.geoMtFlatPolarParabolic=function(){return e.geoProjection(Pe).scale(164.859)},t.geoMtFlatPolarParabolicRaw=Pe,t.geoMtFlatPolarQuartic=function(){return e.geoProjection(ze).scale(188.209)},t.geoMtFlatPolarQuarticRaw=ze,t.geoMtFlatPolarSinusoidal=function(){return e.geoProjection(De).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=De,t.geoNaturalEarth2=function(){return e.geoProjection(Oe).scale(175.295)},t.geoNaturalEarth2Raw=Oe,t.geoNellHammer=function(){return e.geoProjection(Re).scale(152.63)},t.geoNellHammerRaw=Re,t.geoInterruptedQuarticAuthalic=function(){return le(U(1/0),Fe).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return e.geoProjection(je).scale(127.267)},t.geoNicolosiRaw=je,t.geoPatterson=function(){return e.geoProjection(Ze).scale(139.319)},t.geoPattersonRaw=Ze,t.geoPolyconic=function(){return e.geoProjection(We).scale(103.74)},t.geoPolyconicRaw=We,t.geoPolyhedral=Ke,t.geoPolyhedralButterfly=function(t){t=t||function(t){var r=e.geoCentroid({type:"MultiPoint",coordinates:t});return e.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ke(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(e){return{face:e,project:t(e)}}));return[-1,0,0,1,0,1,4,5].forEach((function(t,e){var n=r[t];n&&(n.children||(n.children=[])).push(r[e])})),Ke(r[0],(function(t,e){return r[t<-x/2?e<0?6:4:t<0?e<0?2:0:t2||a[0]!=e[0]||a[1]!=e[1])&&(n.push(a),e=a)}return 1===n.length&&t.length>1&&n.push(r(t[t.length-1])),n}function a(t){return t.map(i)}function o(t){if(null==t)return t;var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":e={type:"Point",coordinates:r(t.coordinates)};break;case"MultiPoint":e={type:t.type,coordinates:n(t.coordinates)};break;case"LineString":e={type:t.type,coordinates:i(t.coordinates)};break;case"MultiLineString":case"Polygon":e={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":e={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(e.bbox=t.bbox),e}function s(t){var e={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),e}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=vr,t.geoRectangularPolyconic=function(){return K(_r).scale(131.215)},t.geoRectangularPolyconicRaw=_r,t.geoRobinson=function(){return e.geoProjection(wr).scale(152.63)},t.geoRobinsonRaw=wr,t.geoSatellite=function(){var t=2,r=0,n=e.geoProjectionMutator(Tr),i=n(t,r);return i.distance=function(e){return arguments.length?n(t=+e,r):t},i.tilt=function(e){return arguments.length?n(t,r=e*S):r*M},i.scale(432.147).clipAngle(C(1/t)*M-1e-6)},t.geoSatelliteRaw=Tr,t.geoSinuMollweide=function(){return e.geoProjection(te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=te,t.geoSinusoidal=function(){return e.geoProjection(Q).scale(152.63)},t.geoSinusoidalRaw=Q,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return Or(t);case"FeatureCollection":var e={type:"FeatureCollection",features:t.features.map(Or)};return null!=t.bbox&&(e.bbox=t.bbox),e;default:return Rr(t)}},t.geoTimes=function(){return e.geoProjection(Fr).scale(146.153)},t.geoTimesRaw=Fr,t.geoTwoPointAzimuthal=Nr,t.geoTwoPointAzimuthalRaw=Br,t.geoTwoPointAzimuthalUsa=function(){return Nr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=Vr,t.geoTwoPointEquidistantRaw=Ur,t.geoTwoPointEquidistantUsa=function(){return Vr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return e.geoProjection(qr).scale(79.4183)},t.geoVanDerGrintenRaw=qr,t.geoVanDerGrinten2=function(){return e.geoProjection(Hr).scale(79.4183)},t.geoVanDerGrinten2Raw=Hr,t.geoVanDerGrinten3=function(){return e.geoProjection(Gr).scale(79.4183)},t.geoVanDerGrinten3Raw=Gr,t.geoVanDerGrinten4=function(){return e.geoProjection(Zr).scale(127.16)},t.geoVanDerGrinten4Raw=Zr,t.geoWagner=Yr,t.geoWagner7=function(){return Yr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=Wr,t.geoWagner4=function(){return e.geoProjection(Jr).scale(176.84)},t.geoWagner4Raw=Jr,t.geoWagner6=function(){return e.geoProjection(Kr).scale(152.63)},t.geoWagner6Raw=Kr,t.geoWiechel=function(){return e.geoProjection(Qr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=Qr,t.geoWinkel3=function(){return e.geoProjection(tn).scale(158.837)},t.geoWinkel3Raw=tn,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,pg(),fg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),mg=f({"src/plots/geo/zoom.js"(t,e){var r=v(),n=se(),i=Vt(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(t,e){return r.behavior.zoom().translate(e.translate()).scale(e.scale())}function u(t,e,r){var a=t.id,o=t.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},f={};function p(t,e){h[a+"."+t]=n.nestedProperty(l,t).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,t);r.get()!==e&&(r.set(e),n.nestedProperty(l,t).set(e),f[a+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",f)}function h(t,e){var n=c(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){e.scale(r.event.scale).translate(r.event.translate),t.render(!0);var n=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(t,e,i)})),n}function f(t,e){var n,i,a,o,h,f,p,d,m,g=c(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=e.rotate(),a=e.translate(),o=i,h=y(n)})).on("zoom",(function(){if(f=r.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(n))return g.scale(e.scale()),void g.translate(e.translate());e.scale(r.event.scale),e.translate([a[0],r.event.translate[1]]),h?y(f)&&(d=y(f),p=[o[0]+(d[0]-h[0]),i[1],i[2]],e.rotate(p),o=p):h=y(n=f),m=!0,t.render(!0);var s=e.rotate(),l=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(t,e,v)})),g}function p(t,e){var n,i={r:e.rotate(),k:e.scale()},h=c(0,e),f=function(t){for(var e=0,n=arguments.length,i=[];++ed?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/d)*o-p,i=Math.sqrt(d*d-h*h));var g=180-a-2*p,v=(Math.atan2(f,u)-Math.atan2(c,i))*o,x=(Math.atan2(f,u)-Math.atan2(c,-i))*o,_=m(r[0],r[1],a,v),b=m(r[0],r[1],g,x);return _<=b?[a,v,r[2]]:[g,x,r[2]]}(T,n,E);isFinite(k[0])&&isFinite(k[1])&&isFinite(k[2])||(k=E),e.rotate(k),E=k}}else n=d(e,M=_);f.of(this,arguments)({type:"zoom"})})),A=f.of(this,arguments),p++||A({type:"zoomstart"})})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=f.of(this,arguments),--p||n({type:"zoomend"}),u(t,e,v)})).on("zoom.redraw",(function(){t.render(!0);var r=e.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,f,"on")}function d(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*a,r=t[1]*a,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function m(t,e,r,n){var i=g(r-t),a=g(n-e);return Math.sqrt(i*i+a*a)}function g(t){return(t%360+540)%360-180}function y(t,e,r){var n=r*a,i=t.slice(),o=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=t[o]*l-t[s]*c,i[s]=t[s]*l+t[o]*c,i}function x(t,e){for(var r=0,n=0,i=t.length;n0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),p.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,s=e[this.id],c=e._size,u=s.domain,h=s.projection,f=s.lonaxis,p=s.lataxis,d=f._ax,g=p._ax,y=this.projection=function(t){var e=t.projection,r=e.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],f=function(t){return t?c:[]},p=0;pu*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(t){return c.getPath().bounds(t)},c.precision(w.precision),t._isSatellite&&c.tilt(e.tilt).distance(e.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},_=h.rotation||{},b=f.range||[],T=p.range||[];if(s.fitbounds){d._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],d.range=m(r,d),g.range=m(r,g);var k=(d.range[0]+d.range[1])/2,A=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:k,lat:A};else if(s._isClipped){x={lon:k,lat:A},_={lon:k,lat:A,roll:_.roll};var M=h.type,S=w.lonaxisSpan[M]/2||180,C=w.lataxisSpan[M]/2||90;b=[k-S,k+S],T=[A-C,A+C]}else x={lon:k,lat:A},_={lon:k,lat:_.lat,roll:_.roll}}y.center([x.lon-_.lon,x.lat-_.lat]).rotate([-_.lon,-_.lat,_.roll]).parallels(h.parallels);var I=E(b,T);y.fitExtent(v,I);var L=this.bounds=y.getBounds(I),P=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var D=y.getBounds(E(d.range,g.range)),O=Math.min((L[1][0]-L[0][0])/(D[1][0]-D[0][0]),(L[1][1]-L[0][1])/(D[1][1]-D[0][1]));isFinite(O)?y.scale(O*P):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*P);var R=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(R[0]-z[0]),z[1]+(R[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var F=y([x.lon,x.lat]),j=y.translate();y.translate([j[0]-(F[0]-j[0]),j[1]-(F[1]-j[1])])}},S.updateBaseLayers=function(t,e){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var f=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=n.framework.selectAll(".layer").data(f,String);p.exit().each((function(t){delete a[t],delete o[t],r.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=r.select(this);"bg"===t?n.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=1e-6,s=2.5,l=e[t],c=w.scopeDefaults[e.scope];"lonaxis"===t?(n=c.lonaxisRange,i=c.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=c.lataxisRange,i=c.lonaxisRange,a=function(t,e){return[e,t]});var u={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};d.setConvert(u,r);var h=d.calcTicks(u);e.isScoped||"lonaxis"!==t||h.pop();for(var f=h.length,p=new Array(f),m=0;m-1&&_(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&f.click(i,r.event))}))}function h(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,n=e._fullLayout,i="clip"+n._uid+t.id;t.clipDef=n._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=r.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(t.mockAxis,n)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?c(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}}}),yg=f({"src/plots/geo/layout_attributes.js"(t,e){var r=V(),n=Ta().attributes,i=Pt().dash,a=$m(),o=Lt().overrideAll,s=Zt(),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(e.exports=o({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),vg=f({"src/plots/geo/layout_defaults.js"(t,e){var r=se(),n=qs(),i=be().getSubplotData,a=$m(),o=yg(),s=a.axesNames;function l(t,e,n,o){var l=i(o.fullData,"geo",o.id).map((function(t){return t.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],f=n("projection.type",h.projType),p=e._isAlbersUsa="albers usa"===f;p&&(u=e.scope="usa");var d=e._isScoped="world"!==u,m=e._isSatellite="satellite"===f,g=e._isConic=-1!==f.indexOf("conic")||"albers"===f,y=e._isClipped=!!a.lonaxisSpan[f];if(!1===t.visible){var v=r.extendDeep({},e._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),e._template=v}for(var x=n("visible"),_=0;_0&&L<0&&(L+=360);var P,z,D,O=(I+L)/2;if(!p){var R=d?h.projRotate:[O,0,0];P=n("projection.rotation.lon",R[0]),n("projection.rotation.lat",R[1]),n("projection.rotation.roll",R[2]),n("showcoastlines",!d&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}p?(z=-96.6,D=38.7):(z=d?O:P,D=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",D),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",d&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),d||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){n(t,e,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),xg=f({"src/plots/geo/index.js"(t,e){var r=be().getSubplotCalcData,n=se().counterRegex,i=gg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},e.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:yg(),supplyLayoutDefaults:vg(),plot:function(t){for(var e=t._fullLayout,n=t.calcdata,o=e._subplots[a],s=0;s")}}(t,h,o),[t]}}}),Eg=f({"src/traces/choropleth/event_data.js"(t,e){e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}}}),Cg=f({"src/traces/choropleth/select.js"(t,e){e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[];if(!1===e)for(r=0;r=Math.min(P,z)&&w<=Math.max(P,z)?0:1/0}if(h=Math.min(D,O)&&T<=Math.max(D,O)?0:1/0}d=Math.sqrt(h*h+f*f),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=_[o=i[u]],c=b[o],h=v.c2p(l)-w,f=x.c2p(c)-T,(p=Math.sqrt(h*h+f*f))100},t.isDotSymbol=function(t){return"string"==typeof t?e.DOT_RE.test(t):t>200}}}),Rg=f({"src/traces/scattergl/defaults.js"(t,e){var r=se(),n=Vt(),i=Og(),a=Dg(),o=_n(),s=We(),l=qn(),c=Hn(),u=Zn(),h=Wn(),f=$n(),p=Xn();e.exports=function(t,e,d,m){function g(n,i){return r.coerce(t,e,a,n,i)}var y=!!t.marker&&i.isOpenSymbol(t.marker.symbol),v=s.isBubble(t),x=l(t,e,m,g);if(x){c(t,e,m,g),g("xhoverformat"),g("yhoverformat");var _=x>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,n,i,a){return s(t,e,n,i,a,r)},gt:function(t,e,r,i,a){return s(t,e,r,i,a,n)},lt:function(t,e,r,n,a){return s(t,e,r,n,a,i)},le:function(t,e,r,n,i){return s(t,e,r,n,i,a)},eq:function(t,e,r,n,i){return s(t,e,r,n,i,o)}}}}),Bg=f({"node_modules/pick-by-alias/index.js"(t,e){e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=r(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}}}),Ug=f({"node_modules/array-bounds/index.js"(t,e){e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;ni&&(i=t[o]),t[o]>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?d=new(u(e.dtype))(g):e.dtype&&(d=e.dtype,Array.isArray(d)&&(d.length=g));for(let t=0;tn||s>1073741824){for(let t=0;tr+i||b>c||T=A)return;if(o===s)return;let h=y[a];void 0===s&&(s=h.length);for(let e=o;e=l&&n<=d&&i>=u&&i<=m&&M.push(r)}let f=v[a],p=f[4*o+0],x=f[4*o+1],_=f[4*o+2],w=f[4*o+3],S=function(t,e){let r=null,n=0;for(;null===r;)if(r=t[4*e+n],n++,n>t.length)return null;return r}(f,o+1),E=.5*i,C=a+1;e(r,n,E,C,p,x||_||w||S),e(r,n+E,E,C,x,_||w||S),e(r+E,n,E,C,_,w||S),e(r+E,n+E,E,C,w,S)}(0,0,1,0,0,1),M},d;function w(t,e,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};t.default=function(t){var e=t.px,s=t.py,l=t.cx,c=t.cy,u=t.rx,h=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===h)return[];var x=Math.sin(p*n/360),_=Math.cos(p*n/360),b=_*(e-l)/2+x*(s-c)/2,w=-x*(e-l)/2+_*(s-c)/2;if(0===b&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var T=Math.pow(b,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);T>1&&(u*=Math.sqrt(T),h*=Math.sqrt(T));var k=function(t,e,r,i,a,s,l,c,u,h,f,p){var d=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(f,2),y=Math.pow(p,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*a/s*p,_=v*-s/a*f,b=h*x-u*_+(t+r)/2,w=u*x+h*_+(e+i)/2,T=(f-x)/a,k=(p-_)/s,A=(-f-x)/a,M=(-p-_)/s,S=o(1,0,T,k),E=o(T,k,A,M);return 0===c&&E>0&&(E-=n),1===c&&E<0&&(E+=n),[b,w,S,E]}(e,s,l,c,u,h,m,y,x,_,b,w),A=r(k,4),M=A[0],S=A[1],E=A[2],C=A[3],I=Math.abs(C)/(n/4);Math.abs(1-I)<1e-7&&(I=1);var L=Math.max(Math.ceil(I),1);C/=L;for(var P=0;P4?(o=g[g.length-4],s=g[g.length-3]):(o=f,s=p),a.push(g)}return a};var r=Xg();function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),Jg=f({"node_modules/is-svg-path/index.js"(t,e){e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}}}),Kg=f({"node_modules/svg-path-bounds/index.js"(t,e){var r=$e(),n=Yg(),i=$g(),a=Jg(),o=ru();e.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t&&(o(a(t),"String is not an SVG path."),t=r(t)),o(Array.isArray(t),"Argument should be a string or an array of path segments."),t=n(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],s=0,l=t.length;se[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}}}),Qg=f({"node_modules/normalize-svg-path/index.js"(t,e){var r=Math.PI,n=l(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(t,e,i,a,l,c,u,h,f,p){if(p)T=p[0],k=p[1],b=p[2],w=p[3];else{var d=s(t,e,-l);t=d.x,e=d.y;var m=(t-(h=(d=s(h,f,-l)).x))/2,g=(e-(f=d.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,_=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));_==1/0&&(_=1);var b=_*i*g/a+(t+h)/2,w=_*-a*m/i+(e+f)/2,T=Math.asin(((e-w)/a).toFixed(9)),k=Math.asin(((f-w)/a).toFixed(9));(T=tk&&(T-=2*r),!u&&k>T&&(k-=2*r)}if(Math.abs(k-T)>n){var A=k,M=h,S=f;k=T+n*(u&&k>T?1:-1);var E=o(h=b+i*Math.cos(k),f=w+a*Math.sin(k),i,a,l,0,u,M,S,[k,A,b,w])}var C=Math.tan((k-T)/4),I=4/3*i*C,L=4/3*a*C,P=[2*t-(t+I*Math.sin(T)),2*e-(e-L*Math.cos(T)),h+I*Math.sin(k),f-L*Math.cos(k),h,f];if(p)return P;E&&(P=P.concat(E));for(var z=0;z7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=p,_=d;"C"!=e&&"S"!=e||(x+=x-n,_+=_-s),y=["C",x,_,y[1],y[2],y[3],y[4]];break;case"T":"Q"==e||"T"==e?(h=2*p-h,f=2*d-f):(h=p,f=d),y=a(p,d,h,f,y[1],y[2]);break;case"Q":h=y[1],f=y[2],y=a(p,d,y[1],y[2],y[3],y[4]);break;case"L":y=i(p,d,y[1],y[2]);break;case"H":y=i(p,d,y[1],d);break;case"V":y=i(p,d,p,y[1]);break;case"Z":y=i(p,d,c,u)}e=v,p=y[y.length-2],d=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=p,s=d),r.push(y)}return r}}}),ty=f({"node_modules/draw-svg-path/index.js"(t,e){var r=Yg(),n=Qg(),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),n(r(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}}}),ey=f({"node_modules/bitmap-sdf/index.js"(t,e){var r=Fd();e.exports=function(t,e){e||(e={});var a,o,s,l,c,u,h,f,p,d,m,g=null==e.cutoff?.25:e.cutoff,y=null==e.radius?8:e.radius,v=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");a=e.width,o=e.height,l=t,u=e.stride?e.stride:Math.floor(t.length/a/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(h=(f=t).getContext("2d"),a=f.width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(h=t,a=(f=t.canvas).width,o=f.height,l=(p=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&t instanceof window.ImageData&&(p=t,a=t.width,o=t.height,l=p.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),d=0,m=c.length;d0?"white":"black",c.lineWidth=Math.abs(p)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return r=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var n=t.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(t);c.fill(y),p&&c.stroke(y)}else{var v=i(t);a(c,v),c.fill(),p&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*f})}}}),ny=f({"src/traces/scattergl/convert.js"(t,e){var r=T(),n=ry(),i=Bd(),a=Vt(),o=se(),s=o.isArrayOrTypedArray,l=Ke(),c=ve(),u=Ud().formatColor,h=We(),f=Ye(),p=Og(),d=zg(),m=H().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Xe().appendArrayPointValue;function v(t,e){var n,i=t._fullLayout,a=e._length,l=e.textfont,c=e.textposition,u=s(c)?c:[c],h=l.color,f=l.size,p=l.family,d=l.weight,m=l.style,g=l.variant,v={},_=t._context.plotGlPixelRatio,b=e.texttemplate;if(b){v.text=[];var w=i._d3locale,T=Array.isArray(b),k=T?Math.min(b.length,a):a,A=T?function(t){return b[t]}:function(){return b};for(n=0;n500?"bold":"normal":t}function _(t,e){var r,n,a=e._length,o=e.marker,l={},c=s(o.symbol),h=s(o.angle),d=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=p.isOpenSymbol(o.symbol)),c||d||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,_=o.angle,b=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var T=w;for(w=Array(a),r=0;rd.TOO_MANY_POINTS||h.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var f=n[0],p=n[1];for(i=0;i1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[d],v=g[m],x=f?f/.8+1:0,_=-v*x-.5*v;o.offset[i]=[y*x/p,_/p]}}return o}}}}),iy=f({"src/traces/scattergl/scene_update.js"(t,e){var r=se();e.exports=function(t,e){var n=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((n=e._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(t){var e=r.repeat(t,n.count);if(n.fill2d&&n.fill2d.update(e),n.scatter2d&&n.scatter2d.update(e),n.line2d&&n.line2d.update(e),n.error2d&&n.error2d.update(e.concat(e)),n.select2d&&n.select2d.update(e),n.glText)for(var i=0;i=m,w=2*_,T={},k=y.makeCalcdata(e,"x"),A=v.makeCalcdata(e,"y"),M=o(e,y,"x",k),S=o(e,v,"y",A),E=M.vals,C=S.vals;e._x=E,e._y=C,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=A,e._yStarts=S.starts,e._yEnds=S.ends);var I=new Array(w),L=new Array(_);for(a=0;a<_;a++)I[2*a]=E[a]===d?NaN:E[a],I[2*a+1]=C[a]===d?NaN:C[a],L[a]=a;if("log"===y.type)for(a=0;a1&&n.extendFlat(s.line,f.linePositions(t,r,i)),s.errorX||s.errorY){var l=f.errorBarPositions(t,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},f.textPosition(t,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},f.textPosition(t,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},f.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,I,E,C),D=p(t,x);return u(s,e),b?z.marker&&(P=z.marker.sizeAvg||Math.max(z.marker.size,3)):P=l(e,_),c(t,e,y,v,E,C,P),z.errorX&&g(e,y,z.errorX),z.errorY&&g(e,v,z.errorY),z.fill&&!D.fill2d&&(D.fill2d=!0),z.marker&&!D.scatter2d&&(D.scatter2d=!0),z.line&&!D.line2d&&(D.line2d=!0),!z.errorX&&!z.errorY||D.error2d||(D.error2d=!0),z.text&&!D.glText&&(D.glText=!0),z.marker&&(z.marker.snap=_),D.lineOptions.push(z.line),D.errorXOptions.push(z.errorX),D.errorYOptions.push(z.errorY),D.fillOptions.push(z.fill),D.markerOptions.push(z.marker),D.markerSelectedOptions.push(z.markerSel),D.markerUnselectedOptions.push(z.markerUnsel),D.textOptions.push(z.text),D.textSelectedOptions.push(z.textSel),D.textUnselectedOptions.push(z.textUnsel),D.selectBatch.push([]),D.unselectBatch.push([]),T._scene=D,T.index=D.count,T.x=E,T.y=C,T.positions=I,D.count++,[{x:!1,y:!1,t:T,trace:e}]}}}),oy=f({"src/traces/scattergl/edit_style.js"(t,e){var r=se(),n=q(),i=H().DESELECTDIM;e.exports={styleTextSelection:function(t){var e,a,o=t[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],f=c.unselectBatch[u],p=c.textOptions[u],d=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},p);if(h.length||f.length){var y=d.color,v=m.color,x=p.color,_=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),e=0;e>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),uy=f({"node_modules/object-assign/index.js"(t,e){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var a,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;lt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(c)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var f={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(f):e.elements=o.elements(f)}var p=g.float32(t);return i({data:p,usage:"dynamic"}),a({data:g.fract32(t,p),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i80*r){i=s=t[0],o=l=t[1];for(var x=r;xs&&(s=c),f>l&&(l=f);p=0!==(p=Math.max(s-i,l-o))?32767/p:0}return a(y,v,r,i,o,p,0),v}function n(t,e,r,n,i){var a,o;if(i===S(t,e,r,n)>0)for(a=e;a=e;a-=n)o=k(a,t[a],t[a+1],o);return o&&v(o,o.next)&&(A(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,u,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=p(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,u,h);for(var d,m,g=t;t.prev!==t.next;)if(d=t.prev,m=t.next,h?s(t,n,u,h):o(t))e.push(d.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),A(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?a(t=l(i(t),e,r),e,r,n,u,h,2):2===f&&c(t,e,r,n,u,h):a(i(t),e,r,n,u,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c,d=n.next;d!==e;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&m(i,s,a,l,o,c,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function s(t,e,r,n){var i=t.prev,a=t,o=t.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,d=sl?s>c?s:c:l>c?l:c,x=u>h?u>f?u:f:h>f?h:f,_=p(d,g,e,r,n),b=p(v,x,e,r,n),w=t.prevZ,T=t.nextZ;w&&w.z>=_&&T&&T.z<=b;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,f,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;w&&w.z>=_;){if(w.x>=d&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=b;){if(T.x>=d&&T.x<=v&&T.y>=g&&T.y<=x&&T!==i&&T!==o&&m(s,u,l,h,c,f,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(e.push(a.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),A(n),A(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,o,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=T(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,e,r,n,o,s,0),void a(u,e,r,n,o,s,0)}c=c.next}l=l.next}while(l!==t)}function u(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x=n.x&&n.x>=u&&i!==n.x&&m(ar.x||n.x===r.x&&f(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var n=T(r,t);return i(n,n.next),i(r,r.next)}function f(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d(t){var e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var i=b(y(t,e,r)),a=b(y(t,e,n)),o=b(y(r,n,t)),s=b(y(r,n,e));return i!==a&&o!==s||!(0!==i||!_(t,r,e))||!(0!==a||!_(t,n,e))||!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function b(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function k(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,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 S(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}}}),yy=f({"node_modules/array-normalize/index.js"(t,e){var r=Ug();e.exports=function(t,e,n){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==n&&(n=r(t,e));for(var i=0;i-1}}}),qy=f({"node_modules/es5-ext/string/#/contains/index.js"(t,e){e.exports=Uy()()?String.prototype.contains:Vy()}}),Hy=f({"node_modules/d/index.js"(t,e){var r=Cy(),n=zy(),i=By(),a=Ny(),o=qy(),s=e.exports=function(t,e){var n,s,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=o.call(t,"c"),s=o.call(t,"e"),l=o.call(t,"w")):(n=l=!0,s=!1),u={value:e,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(t,e,s){var l,c,u,h;return"string"!=typeof t?(u=s,s=e,e=t,t=null):u=arguments[3],r(e)?n(e)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=e,e=s=void 0):e=void 0,r(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),h={get:e,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),Gy=f({"node_modules/es5-ext/function/is-arguments.js"(t,e){var r=Object.prototype.toString,n=r.call(function(){return arguments}());e.exports=function(t){return r.call(t)===n}}}),Zy=f({"node_modules/es5-ext/string/is-string.js"(t,e){var r=Object.prototype.toString,n=r.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===n)||!1}}}),Wy=f({"node_modules/ext/global-this/is-implemented.js"(t,e){e.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),Yy=f({"node_modules/ext/global-this/implementation.js"(t,e){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),Xy=f({"node_modules/ext/global-this/index.js"(t,e){e.exports=Wy()()?globalThis:Yy()}}),$y=f({"node_modules/es6-symbol/is-implemented.js"(t,e){var r=Xy(),n={object:!0,symbol:!0};e.exports=function(){var t,e=r.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof e.iterator]&&!!n[typeof e.toPrimitive]&&!!n[typeof e.toStringTag]}}}),Jy=f({"node_modules/es6-symbol/is-symbol.js"(t,e){e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}}}),Ky=f({"node_modules/es6-symbol/validate-symbol.js"(t,e){var r=Jy();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}}}),Qy=f({"node_modules/es6-symbol/lib/private/generate-name.js"(t,e){var r=Hy(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);e.exports=function(t){for(var e,n,s=0;o[t+(s||"")];)++s;return o[t+=s||""]=!0,i(a,e="@@"+t,r.gs(null,(function(t){n||(n=!0,i(this,e,r(t)),n=!1)}))),e}}}),tv=f({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(t,e){var r=Hy(),n=Xy().Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:r("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:r("",n&&n.iterator||t("iterator")),match:r("",n&&n.match||t("match")),replace:r("",n&&n.replace||t("replace")),search:r("",n&&n.search||t("search")),species:r("",n&&n.species||t("species")),split:r("",n&&n.split||t("split")),toPrimitive:r("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:r("",n&&n.toStringTag||t("toStringTag")),unscopables:r("",n&&n.unscopables||t("unscopables"))})}}}),ev=f({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(t,e){var r=Hy(),n=Ky(),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:r((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:r((function(t){var e;for(e in n(t),i)if(i[e]===t)return e}))})}}}),rv=f({"node_modules/es6-symbol/polyfill.js"(t,e){var r,n,i,a=Hy(),o=Ky(),s=Xy().Symbol,l=Qy(),c=tv(),u=ev(),h=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof s)try{String(s()),i=!0}catch(t){}else s=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?s(e):(r=h(n.prototype),e=void 0===e?"":String(e),f(r,{__description__:a("",e),__name__:a("",l(e))}))},c(r),u(r),f(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),f(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),p(r.prototype,r.toPrimitive,a("",(function(){var t=o(this);return"symbol"==typeof t?t:t.toString()}))),p(r.prototype,r.toStringTag,a("c","Symbol")),p(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),p(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),nv=f({"node_modules/es6-symbol/index.js"(t,e){e.exports=$y()()?Xy().Symbol:rv()}}),iv=f({"node_modules/es5-ext/array/#/clear.js"(t,e){var r=Ty();e.exports=function(){return r(this).length=0,this}}}),av=f({"node_modules/es5-ext/object/valid-callable.js"(t,e){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}}),ov=f({"node_modules/type/string/coerce.js"(t,e){var r=Cy(),n=Iy(),i=Object.prototype.toString;e.exports=function(t){if(!r(t))return null;if(n(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}}}),sv=f({"node_modules/type/lib/safe-to-string.js"(t,e){e.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(t){return null}}}}}),lv=f({"node_modules/type/lib/to-short-string.js"(t,e){var r=sv(),n=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=r(t);return null===e?"":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(n,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),cv=f({"node_modules/type/lib/resolve-exception.js"(t,e){var r=Cy(),n=Iy(),i=ov(),a=lv(),o=function(t,e){return t.replace("%v",a(e))};e.exports=function(t,e,a){if(!n(a))throw new TypeError(o(e,t));if(!r(t)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=e),new TypeError(o(s,t))}}}),uv=f({"node_modules/type/value/ensure.js"(t,e){var r=cv(),n=Cy();e.exports=function(t){return n(t)?t:r(t,"Cannot use %v",arguments[1])}}}),hv=f({"node_modules/type/plain-function/ensure.js"(t,e){var r=cv(),n=zy();e.exports=function(t){return n(t)?t:r(t,"%v is not a plain function",arguments[1])}}}),fv=f({"node_modules/es5-ext/array/from/is-implemented.js"(t,e){e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}}}),pv=f({"node_modules/es5-ext/function/is-function.js"(t,e){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&n(r.call(t))}}}),dv=f({"node_modules/es5-ext/math/sign/is-implemented.js"(t,e){e.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}}}),mv=f({"node_modules/es5-ext/math/sign/shim.js"(t,e){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}}}),gv=f({"node_modules/es5-ext/math/sign/index.js"(t,e){e.exports=dv()()?Math.sign:mv()}}),yv=f({"node_modules/es5-ext/number/to-integer.js"(t,e){var r=gv(),n=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*i(n(t)):t}}}),vv=f({"node_modules/es5-ext/number/to-pos-integer.js"(t,e){var r=yv(),n=Math.max;e.exports=function(t){return n(0,r(t))}}}),xv=f({"node_modules/es5-ext/array/from/shim.js"(t,e){var r=nv().iterator,n=Gy(),i=pv(),a=vv(),o=av(),s=Ty(),l=_y(),c=Zy(),u=Array.isArray,h=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(t){var e,d,m,g,y,v,x,_,b,w,T=arguments[1],k=arguments[2];if(t=Object(s(t)),l(T)&&o(T),this&&this!==Array&&i(this))e=this;else{if(!T){if(n(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(u(t)){for(g=new Array(y=t.length),d=0;d=55296&&v<=56319&&(w+=t[++d]),w=T?h.call(T,k,w,m):w,e?(f.value=w,p(g,m,f)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),d=0;d=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):u(this,"__redo__",s("c",[t])))})),_onDelete:s((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Sv=f({"node_modules/es6-iterator/array.js"(t,e){var r,n=My(),i=qy(),a=Hy(),o=nv(),s=Mv(),l=Object.defineProperty;r=e.exports=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",l(this,"__kind__",a("",e))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Ev=f({"node_modules/es6-iterator/string.js"(t,e){var r,n=My(),i=Hy(),a=nv(),o=Mv(),s=Object.defineProperty;r=e.exports=function(t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t=String(t),o.call(this,t),s(this,"__length__",i("",t.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),Cv=f({"node_modules/es6-iterator/is-iterable.js"(t,e){var r=Gy(),n=_y(),i=Zy(),a=nv().iterator,o=Array.isArray;e.exports=function(t){return!(!n(t)||!o(t)&&!i(t)&&!r(t)&&"function"!=typeof t[a])}}}),Iv=f({"node_modules/es6-iterator/valid-iterable.js"(t,e){var r=Cv();e.exports=function(t){if(!r(t))throw new TypeError(t+" is not iterable");return t}}}),Lv=f({"node_modules/es6-iterator/get.js"(t,e){var r=Gy(),n=Zy(),i=Sv(),a=Ev(),o=Iv(),s=nv().iterator;e.exports=function(t){return"function"==typeof o(t)[s]?t[s]():r(t)?new i(t):n(t)?new a(t):new i(t)}}}),Pv=f({"node_modules/es6-iterator/for-of.js"(t,e){var r=Gy(),n=av(),i=Zy(),a=Lv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;e.exports=function(t,e){var c,u,h,f,p,d,m,g,y=arguments[2];if(o(t)||r(t)?c="array":i(t)?c="string":t=a(t),n(e),h=function(){f=!0},"array"!==c)if("string"!==c)for(u=t.next();!u.done;){if(s.call(e,y,u.value,h),f)return;u=t.next()}else for(d=t.length,p=0;p=55296&&g<=56319&&(m+=t[++p]),s.call(e,y,m,h),!f);++p);else l.call(t,(function(t){return s.call(e,y,t,h),f}))}}}),zv=f({"node_modules/es6-weak-map/is-native-implemented.js"(t,e){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),Dv=f({"node_modules/es6-weak-map/polyfill.js"(t,e){var r,n=_y(),i=My(),a=Sy(),o=Ty(),s=Ey(),l=Hy(),c=Lv(),u=Pv(),h=nv().toStringTag,f=zv(),p=Array.isArray,d=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;e.exports=r=function(){var t,e=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return t=f&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(e)&&(p(e)||(e=c(e))),d(t,"__weakMapData__",l("c","$weakMap$"+s())),e?(u(e,(function(e){o(e),t.set(e[0],e[1])})),t):t},f&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(t){return!!m.call(a(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:l((function(t){if(m.call(a(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:l((function(t){return m.call(a(t),this.__weakMapData__)})),set:l((function(t,e){return d(a(t),this.__weakMapData__,l("c",e)),this})),toString:l((function(){return"[object WeakMap]"}))}),d(r.prototype,h,l("c","WeakMap"))}}),Ov=f({"node_modules/es6-weak-map/index.js"(t,e){e.exports=vy()()?WeakMap:Dv()}}),Rv=f({"node_modules/array-find-index/index.js"(t,e){e.exports=function(t,e,r){if("function"==typeof Array.prototype.findIndex)return t.findIndex(e,r);if("function"!=typeof e)throw new TypeError("predicate must be a function");var n=Object(t),i=n.length;if(0===i)return-1;for(var a=0;a"round"===e.join?2:1,miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight],depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(t,e)=>!e.overlay},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:(t,e)=>e.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},d.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},d.prototype.render=function(...t){t.length&&this.update(...t),this.draw()},d.prototype.draw=function(...t){return(t.length?t:this.passes).forEach(((t,e)=>{if(t&&Array.isArray(t))return this.draw(...t);"number"==typeof t&&(t=this.passes[t]),t&&t.count>1&&t.opacity&&(this.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&this.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>d.precisionThreshold||t.scale[1]*t.viewport.height>d.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=d.maxPoints)?this.shaders.rect(t):this.shaders.miter(t)))})),this},d.prototype.update=function(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let{regl:e,gl:h}=this;if(t.forEach(((t,m)=>{let g=this.passes[m];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=a(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:e.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:e.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},d.defaults,t)),null!=t.thickness&&(g.thickness=parseFloat(t.thickness)),null!=t.opacity&&(g.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(g.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(g.overlay=!!t.overlay,mt-e)),e=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let e=p(t,(t=>t>=a));t=t.slice(0,e),t.push(a)}for(let n=0;ne-a+(t[n]-i))),c=s(o,l);c=c.map((e=>e+i+(e+i{t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()})),this.passes.length=0,this}}}),jv=f({"node_modules/regl-error2d/index.js"(t,e){var r=Ug(),n=Bd(),i=fy(),a=Bg(),o=uy(),s=qg(),{float32:l,fract32:c}=dy();e.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,f,p,d,m,g,y=t._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return d=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),f=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:u}),T(e),h=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:(t,e)=>[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{color:{buffer:d,offset:(t,e)=>4*e.offset,divisor:1},position:{buffer:f,offset:(t,e)=>8*e.offset,divisor:1},positionFract:{buffer:p,offset:(t,e)=>8*e.offset,divisor:1},error:{buffer:m,offset:(t,e)=>16*e.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:u.length}),o(_,{update:T,draw:b,destroy:k,regl:t,gl:y,canvas:y.canvas,groups:x}),_;function _(t){t?T(t):null===t&&k(),b()}function b(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),x.forEach(((t,r)=>{t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=x[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],h(t),t.after&&t.after(t))}function T(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let e=0,u=0;if(_.groups=x=t.map(((t,l)=>{let h=x[l];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=a(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=o({},v,t)),i(h,t,[{lineWidth:t=>.5*+t,capSize:t=>.5*+t,opacity:parseFloat,errors:t=>(t=s(t),u+=t.length,t),positions:(t,n)=>(t=s(t,"float64"),n.count=Math.floor(t.length/2),n.bounds=r(t,2),n.offset=e,e+=n.count,t)},{color:(t,e)=>{let r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){let e=t;t=Array(r);for(let n=0;n{let n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=c(e.scale),e.translateFract=c(e.translate),t},viewport:t=>{let e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},e}}]),h):h})),e||u){let t=x.reduce(((t,e,r)=>t+(e?e.count:0)),0),e=new Float64Array(2*t),r=new Uint8Array(4*t),n=new Float32Array(4*t);x.forEach(((t,i)=>{if(!t)return;let{positions:a,count:o,offset:s,color:l,errors:c}=t;o&&(r.set(l,4*s),n.set(c,4*s),e.set(a,2*s))}));var h=l(e);f(h);var g=c(e,h);p(g),d(r),m(n)}}function k(){f.destroy(),p.destroy(),d.destroy(),m.destroy(),g.destroy()}};var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),Bv=f({"node_modules/unquote/index.js"(t,e){var r=/[\'\"]/;e.exports=function(t){return t?(r.test(t.charAt(0))&&(t=t.substr(1)),r.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}}}),Nv=f({"node_modules/css-global-keywords/index.json"(){}}),Uv=f({"node_modules/css-system-font-keywords/index.json"(){}}),Vv=f({"node_modules/css-font-weight-keywords/index.json"(){}}),qv=f({"node_modules/css-font-style-keywords/index.json"(){}}),Hv=f({"node_modules/css-font-stretch-keywords/index.json"(){}}),Gv=f({"node_modules/parenthesis/index.js"(t,e){function r(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",a=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function a(e,a,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach((function(t,n){for(var i,o=0;t!=i;)if(i=t,t=t.replace(e,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function t(e,r,n){for(var i,a=[],s=0;i=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(e.slice(0,i.index)),a.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return a.push(e),a}(r[0],r)}function n(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(a,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?n(t,e):r(t,e)}i.parse=r,i.stringify=n,e.exports=i}}),Zv=f({"node_modules/string-split-by/index.js"(t,e){var r=Gv();e.exports=function(t,e,n){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");n?("string"==typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=r.parse(t,{flat:!0,brackets:n.ignore}),a=i[0].split(e);if(n.escape){for(var o=[],s=0;s1&&e===r&&('"'===e||"'"===e))return['"'+n(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return i(t.substr(0,a.index)).concat(i(a[1])).concat(i(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+n(t)+'"'];for(var s=[],l=0;l65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function d(){var t=f(8,(function(){return[]}));function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[p(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[p(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case 5120:n=new Int8Array(e(r),0,r);break;case 5121:n=new Uint8Array(e(r),0,r);break;case 5122:n=new Int16Array(e(2*r),0,r);break;case 5123:n=new Uint16Array(e(2*r),0,r);break;case 5124:n=new Int32Array(e(4*r),0,r);break;case 5125:n=new Uint32Array(e(4*r),0,r);break;case 5126:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var m=d();m.zero=d();var g=3553,y=6408,v=5126,x=36160,_=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function b(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||_(t.data))}var w=function(t){return Object.keys(t).map((function(e){return t[e]}))},T={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var a=0;a>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function G(t){return Array.isArray(t)||_(t)}var Z=3553,W=34067,Y=34069,X=6408,$=6406,J=6407,K=6409,Q=6410,tt=32855,et=6402,rt=34041,nt=35904,it=35906,at=36193,ot=33776,st=33777,lt=33778,ct=33779,ut=5121,ht=5123,ft=5125,pt=5126,dt=33071,mt=9728,gt=9984,yt=9987,vt=4352,xt=33984,_t=[gt,9986,9985,yt],bt=[0,K,Q,J,X],wt={};function Tt(t){return"[object "+t+"]"}wt[6409]=wt[6406]=wt[6402]=1,wt[34041]=wt[6410]=2,wt[6407]=wt[35904]=3,wt[6408]=wt[35906]=4;var kt=Tt("HTMLCanvasElement"),At=Tt("OffscreenCanvas"),Mt=Tt("CanvasRenderingContext2D"),St=Tt("ImageBitmap"),Et=Tt("HTMLImageElement"),Ct=Tt("HTMLVideoElement"),It=Object.keys(M).concat([kt,At,Mt,St,Et,Ct]),Lt=[];Lt[5121]=1,Lt[5126]=4,Lt[36193]=2,Lt[5123]=2,Lt[5125]=4;var Pt=[];function zt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function Dt(t){return!!Array.isArray(t)&&!(0===t.length||!G(t[0]))}function Ot(t){return Object.prototype.toString.call(t)}function Rt(t){return Ot(t)===kt}function Ft(t){return Ot(t)===At}function jt(t){if(!t)return!1;var e=Ot(t);return It.indexOf(e)>=0||zt(t)||Dt(t)||b(t)}function Bt(t){return 0|M[Object.prototype.toString.call(t)]}function Nt(t,e){return m.allocType(t.type===at?pt:t.type,e)}function Ut(t,e){t.type===at?(t.data=H(e),m.freeType(e)):t.data=e}function Vt(t,e,r,n,i,a){var o;if(o=void 0!==Pt[t]?Pt[t]:wt[t]*Lt[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function qt(e,r,n,i,a,o,s){var l={"don't care":vt,"dont care":vt,nice:4354,fast:4353},c={repeat:10497,clamp:dt,mirror:33648},u={nearest:mt,linear:9729},h=t({mipmap:yt,"nearest mipmap nearest":gt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":yt},u),f={none:0,browser:37444},p={uint8:ut,rgba4:32819,rgb565:33635,"rgb5 a1":32820},d={alpha:$,luminance:K,"luminance alpha":Q,rgb:J,rgba:X,rgba4:32854,"rgb5 a1":tt,rgb565:36194},g={};r.ext_srgb&&(d.srgb=nt,d.srgba=it),r.oes_texture_float&&(p.float32=p.float=pt),r.oes_texture_half_float&&(p.float16=p["half float"]=at),r.webgl_depth_texture&&(t(d,{depth:et,"depth stencil":rt}),t(p,{uint16:ht,uint32:ft,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&t(g,{"rgb s3tc dxt1":ot,"rgba s3tc dxt1":st,"rgba s3tc dxt3":lt,"rgba s3tc dxt5":ct}),r.webgl_compressed_texture_atc&&t(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&t(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(e.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(d[t]=e)}));var v=Object.keys(d);n.textureFormats=v;var x=[];Object.keys(d).forEach((function(t){var e=d[t];x[e]=t}));var k=[];Object.keys(p).forEach((function(t){var e=p[t];k[e]=t}));var A=[];Object.keys(u).forEach((function(t){A[u[t]]=t}));var M=[];Object.keys(h).forEach((function(t){var e=h[t];M[e]=t}));var S=[];Object.keys(c).forEach((function(t){S[c[t]]=t}));var E=v.reduce((function(t,e){var n=d[e];return n===K||n===$||n===K||n===Q||n===et||n===rt||r.ext_srgb&&(n===nt||n===it)?t[n]=n:n===tt||e.indexOf("rgba")>=0?t[n]=X:t[n]=J,t}),{});function C(){this.internalformat=X,this.format=X,this.type=ut,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function L(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=f[e.colorSpace]),"type"in e){var r=e.type;t.type=p[r]}var n=t.width,i=t.height,a=t.channels,o=!1;"shape"in e?(n=e.shape[0],i=e.shape[1],3===e.shape.length&&(a=e.shape[2],o=!0)):("radius"in e&&(n=i=e.radius),"width"in e&&(n=e.width),"height"in e&&(i=e.height),"channels"in e&&(a=e.channels,o=!0)),t.width=0|n,t.height=0|i,t.channels=0|a;var s=!1;if("format"in e){var l=e.format,c=t.internalformat=d[l];t.format=E[c],l in p&&("type"in e||(t.type=p[l])),l in g&&(t.compressed=!0),s=!0}!o&&s?t.channels=wt[t.format]:o&&!s&&t.channels!==bt[t.format]&&(t.format=t.internalformat=bt[t.channels])}}function P(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function z(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function D(t,e){var r=null;if(jt(e)?r=e:e&&(L(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),jt(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(_(r))t.channels=t.channels||4,t.data=r,"type"in e||t.type!==ut||(t.type=Bt(r));else if(zt(r))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case ut:case ht:case ft:case pt:var n=m.allocType(t.type,r);n.set(e),t.data=n;break;case at:t.data=H(e)}}(t,r),t.alignment=1,t.needsFree=!0;else if(b(r)){var o=r.data;Array.isArray(o)||t.type!==ut||(t.type=Bt(o));var s,l,c,u,h,f,p=r.shape,d=r.stride;3===p.length?(c=p[2],f=d[2]):(c=1,f=1),s=p[0],l=p[1],u=d[0],h=d[1],t.alignment=1,t.width=s,t.height=l,t.channels=c,t.format=t.internalformat=bt[c],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=Nt(t,o*s*l),u=0,h=0;h>=i,r.height>>=i,D(r,n[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;t.magFilter=u[n]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var o=e.wrap;"string"==typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in e){var s=e.wrapS;i=c[s]}if("wrapT"in e){var f=e.wrapT;a=c[f]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e&&(e.anisotropic,t.anisotropic=e.anisotropic),"mipmap"in e){var p=!1;switch(typeof e.mipmap){case"string":t.mipmapHint=l[e.mipmap],t.genMipmaps=!0,p=!0;break;case"boolean":p=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,p=!0}p&&!("min"in e)&&(t.minFilter=gt)}}function Pt(t,n){e.texParameteri(n,10241,t.minFilter),e.texParameteri(n,10240,t.magFilter),e.texParameteri(n,10242,t.wrapS),e.texParameteri(n,10243,t.wrapT),r.ext_texture_filter_anisotropic&&e.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(e.hint(33170,t.mipmapHint),e.generateMipmap(n))}var qt=0,Ht={},Gt=n.maxTextureUnits,Zt=Array(Gt).map((function(){return null}));function Wt(t){C.call(this),this.mipmask=0,this.internalformat=X,this.id=qt++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new It,s.profile&&(this.stats={size:0})}function Yt(t){e.activeTexture(xt),e.bindTexture(t.target,t.texture)}function Xt(){var t=Zt[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(Z,null)}function $t(t){var r=t.texture,n=t.unit,i=t.target;n>=0&&(e.activeTexture(xt+n),e.bindTexture(i,null),Zt[n]=null),e.deleteTexture(r),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Ht[t.id],o.textureCount--}return t(Wt.prototype,{bind:function(){var t=this;t.bindCount+=1;var r=t.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}Zt[n]=t,r=n;break}s.profile&&o.maxTextureUnits>l)-o,c.height=c.height||(n.height>>l)-s,Yt(n),R(c,Z,o,s,l),Xt(),B(c),i},i.resize=function(t,r){var a=0|t,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Yt(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;e.texImage2D(Z,l,n.format,c,u,0,n.format,n.type,null)}return Xt(),s.profile&&(n.stats.size=Vt(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(t,r,n,i,a,l){var c=new Wt(W);Ht[c.id]=c,o.cubeCount++;var u=new Array(6);function h(t,e,r,n,i,a){var o,l=c.texInfo;for(It.call(l),o=0;o<6;++o)u[o]=kt();if("number"!=typeof t&&t){if("object"==typeof t)if(e)V(u[0],t),V(u[1],e),V(u[2],r),V(u[3],n),V(u[4],i),V(u[5],a);else if(Lt(l,t),L(c,t),"faces"in t){var f=t.faces;for(o=0;o<6;++o)I(u[o],c),V(u[o],f[o])}else for(o=0;o<6;++o)V(u[o],t)}else{var p=0|t||1;for(o=0;o<6;++o)U(u[o],p,p)}for(I(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Yt(c),o=0;o<6;++o)q(u[o],Y+o);for(Pt(l,W),Xt(),s.profile&&(c.stats.size=Vt(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[c.internalformat],h.type=k[c.type],h.mag=A[l.magFilter],h.min=M[l.minFilter],h.wrapS=S[l.wrapS],h.wrapT=S[l.wrapT],o=0;o<6;++o)At(u[o]);return h}return h(t,r,n,i,a,l),h.subimage=function(t,e,r,n,i){var a=0|r,o=0|n,s=0|i,l=j();return I(l,c),l.width=0,l.height=0,D(l,e),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Yt(c),R(l,Y+t,a,o,s),Xt(),B(l),h},h.resize=function(t){var r=0|t;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Yt(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)e.texImage2D(Y+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xt(),s.profile&&(c.stats.size=Vt(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var t=0;t>r,t.height>>r,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)e.texImage2D(Y+n,r,t.internalformat,t.width>>r,t.height>>r,0,t.internalformat,t.type,null);Pt(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t>>4&15)+r.charAt(15&e);return n}(function(t){return ae(de(ie(t),8*t.length))}(function(t){for(var e,r,n="",i=-1;++i>>6&31,128|63&e):e<=65535?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(t)))}function ie(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;return e}function ae(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}function oe(t,e){return t>>>e|t<<32-e}function se(t,e){return t>>>e}function le(t,e,r){return t&e^~t&r}function ce(t,e,r){return t&e^t&r^e&r}function ue(t){return oe(t,2)^oe(t,13)^oe(t,22)}function he(t){return oe(t,6)^oe(t,11)^oe(t,25)}function fe(t){return oe(t,7)^oe(t,18)^se(t,3)}var pe=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function de(t,e){var r,n,i,a,o,s,l,c,u,h,f,p,d,m=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),g=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,u=0;u>16)+(e>>16)+(r>>16)<<16|65535&r}function ge(t){return Array.prototype.slice.call(t)}function ye(t){return ge(t).join("")}var ve="xyzw".split(""),xe="dither",_e="blend.enable",be="blend.color",we="blend.equation",Te="blend.func",ke="depth.enable",Ae="depth.func",Me="depth.range",Se="depth.mask",Ee="colorMask",Ce="cull.enable",Ie="cull.face",Le="frontFace",Pe="lineWidth",ze="polygonOffset.enable",De="polygonOffset.offset",Oe="sample.alpha",Re="sample.enable",Fe="sample.coverage",je="stencil.enable",Be="stencil.mask",Ne="stencil.func",Ue="stencil.opFront",Ve="stencil.opBack",qe="scissor.enable",He="scissor.box",Ge="viewport",Ze="profile",We="framebuffer",Ye="vert",Xe="frag",$e="elements",Je="primitive",Ke="count",Qe="offset",tr="instances",er="vao",rr="Width",nr="Height",ir=We+rr,ar=We+nr,or=Ge+rr,sr=Ge+nr,lr="drawingBuffer",cr=lr+rr,ur=lr+nr,hr=[Te,we,Ne,Ue,Ve,Fe,Ge,He,De],fr=34962,pr=34963,dr=35664,mr=35665,gr=35666,yr=35667,vr=35668,xr=35669,_r=35671,br=35672,wr=35673,Tr=35674,kr=35675,Ar=35676,Mr=35678,Sr=35680,Er=1028,Cr=1029,Ir=2305,Lr=7680,Pr={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Dr={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Or={cw:2304,ccw:Ir};function Rr(t){return Array.isArray(t)||_(t)||b(t)}function Fr(t){return t.sort((function(t,e){return t===Ge?-1:e===Ge?1:t=1,n>=2,e)}if(4===r){var i=t.data;return new jr(i.thisDep,i.contextDep,i.propDep,e)}if(5===r)return new jr(!1,!1,!1,e);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new jr(a,o,s,e)}return new jr(3===r,2===r,1===r,e)}var Vr=new jr(!1,!1,!1,(function(){}));function qr(e,r,n,i,a,s,l,c,u,h,p,d,m,g,y,v){var x=h.Record,_={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(_.min=32775,_.max=32776);var b=n.angle_instanced_arrays,w=n.webgl_draw_buffers,T=n.oes_vertex_array_object,k={dirty:!0,profile:v.profile},A={},M=[],E={},C={};function I(t){return t.replace(".","_")}function L(t,e,r){var n=I(t);M.push(t),A[n]=k[n]=!!r,E[n]=e}function P(t,e,r){var n=I(t);M.push(t),Array.isArray(r)?(k[n]=r.slice(),A[n]=r.slice()):k[n]=A[n]=r,C[n]=e}function z(t){return!!isNaN(t)}L(xe,3024),L(_e,3042),P(be,"blendColor",[0,0,0,0]),P(we,"blendEquationSeparate",[32774,32774]),P(Te,"blendFuncSeparate",[1,0,1,0]),L(ke,2929,!0),P(Ae,"depthFunc",513),P(Me,"depthRange",[0,1]),P(Se,"depthMask",!0),P(Ee,Ee,[!0,!0,!0,!0]),L(Ce,2884),P(Ie,"cullFace",Cr),P(Le,Le,Ir),P(Pe,Pe,1),L(ze,32823),P(De,"polygonOffset",[0,0]),L(Oe,32926),L(Re,32928),P(Fe,"sampleCoverage",[1,!1]),L(je,2960),P(Be,"stencilMask",-1),P(Ne,"stencilFunc",[519,0,-1]),P(Ue,"stencilOpSeparate",[Er,Lr,Lr,Lr]),P(Ve,"stencilOpSeparate",[Cr,Lr,Lr,Lr]),L(qe,3089),P(He,"scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),P(Ge,Ge,[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var D={gl:e,context:m,strings:r,next:A,current:k,draw:d,elements:s,buffer:a,shader:p,attributes:h.state,vao:h,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Rr},O={primTypes:F,compareFuncs:zr,blendFuncs:Pr,blendEquations:_,stencilOps:Dr,glTypes:S,orientationType:Or};w&&(O.backBuffer=[Cr],O.drawBuffer=f(i.maxDrawbuffers,(function(t){return 0===t?[0]:f(t,(function(t){return 36064+t}))})));var R=0;function j(){var e=function(e){var r=e&&e.cache,n=0,i=[],a=[],o=[];function s(){var e=[],r=[];return t((function(){e.push.apply(e,ge(arguments))}),{def:function(){var t="v"+n++;return r.push(t),arguments.length>0&&(e.push(t,"="),e.push.apply(e,ge(arguments)),e.push(";")),t},toString:function(){return ye([r.length>0?"var "+r.join(",")+";":"",ye(e)])}})}function l(){var e=s(),r=s(),n=e.toString,i=r.toString;function a(t,n){r(t,n,"=",e.def(t,n),";")}return t((function(){e.apply(e,ge(arguments))}),{def:e.def,entry:e,exit:r,save:a,set:function(t,r,n){a(t,r),e(t,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(t,e){var r=e&&e.stable;if(!r)for(var s=0;s0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var a=[],o=0;o0,T={framebuffer:d,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=function(t){var e,r=t.static,n=t.dynamic;if(Ze in r){var i=!!r[Ze];(e=Nr((function(t,e){return i}))).enable=i}else if(Ze in n){var a=n[Ze];e=Ur(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),T.uniforms=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r,i=e[t];if("number"==typeof i||"boolean"==typeof i)r=Nr((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Nr((function(t){return t.link(i)})):"framebuffer"!==a&&"framebufferCube"!==a||(r=Nr((function(t){return t.link(i.color[0])})))}else G(i)&&(r=Nr((function(t){return t.global.def("[",f(i.length,(function(t){return i[t]})),"]")})));r.value=i,n[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Ur(e,(function(t,r){return t.invoke(r,e)}))})),n}(i),T.drawVAO=T.scopeVAO=g.vao,!T.drawVAO&&v.program&&!u&&n.angle_instanced_arrays&&g.static.elements){var k=!0,A=v.program.attributes.map((function(t){var r=e.static[t];return k=k&&!!r,r}));if(k&&A.length>0){var E=h.getVAO(h.createVAO({attributes:A,elements:g.static.elements}));T.drawVAO=new jr(null,null,null,(function(t,e){return t.link(E)})),T.useVAO=!0}}return u?T.useVAO=!0:T.attributes=function(t){var e=t.static,n=t.dynamic,i={};return Object.keys(e).forEach((function(t){var n=e[t],o=r.id(t),s=new x;if(Rr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,fr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"==typeof c?s.x=c:ve.forEach((function(t,e){e"+e+"?"+n+".constant["+e+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",fr,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(e),T.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=Nr((function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)}))})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=Ur(e,(function(t,r){return t.invoke(r,e)}))})),n}(o),T}function N(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach((function(a){e.save(n,"."+a);var o=r[a].append(t,e);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),e(i)}function U(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;w&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,c=t.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&e(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",36160,",null);"),w&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function V(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");M.forEach((function(e){var n,u,h=I(e);if(!(h in r.state))if(h in o){n=o[h],u=a[h];var p=f(k[h].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(p.map((function(t,e){return t+"!=="+u+"["+e+"]"})).join("||")).then(i,".",C[h],"(",p,");",p.map((function(t,e){return u+"["+e+"]="+t})).join(";"),";"))}else{n=c.def(l,".",h);var d=t.cond(n,"!==",s,".",h);c(d),h in E?d(t.cond(n).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",n,";"):d(i,".",C[h],"(",n,");",s,".",h,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function q(t,e,r,n){var i,a=t.shared,o=t.current,s=a.current,l=a.gl;Fr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(t,e);if(E[a]){var h=E[a];Br(c)?(i=t.link(u,{stable:!0}),e(t.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",i,";")):(e(t.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),e(s,".",a,"=",u,";"))}else if(G(u)){var f=o[a];e(l,".",C[a],"(",u,");",u.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";")}else Br(c)?(i=t.link(u,{stable:!0}),e(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):e(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function H(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function Z(t,e,r,n,i){var a,o,s,l=t.shared,c=t.stats,u=l.current,h=l.timer,f=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(a=e.def(),"=",p(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(n?t(o=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",p(),"-",a,";"),g&&(n?t(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function y(t){var r=e.def(u,".profile");e(u,".profile=",t,";"),e.exit(u,".profile=",r,";")}if(f){if(Br(f))return void(f.enable?(d(e),m(e.exit),y("true")):y("false"));y(s=f.append(t,e))}else s=e.def(u,".profile");var v=t.block();d(v),e("if(",s,"){",v,"}");var x=t.block();m(x),e.exit("if(",s,"){",x,"}")}function W(t,e,r,n,i){var a=t.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(Vr))return;var c=t.scopeAttrib(s);o={},Object.keys(new x).forEach((function(t){o[t]=e.def(c,".",t)}))}!function(r,n,i){var o=a.gl,s=e.def(r,".location"),l=e.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function p(){e("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",l,".type!==",a,"||",l,".size!==",r,"||",f.map((function(t){return l+"."+t+"!=="+i[t]})).join("||"),"){",o,".bindBuffer(",fr,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",f.map((function(t){return l+"."+t+"="+i[t]+";"})).join(""),"}"),b){var c=i.divisor;e("if(",l,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function d(){e("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",ve.map((function(t,e){return l+"."+t+"!=="+h[e]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",ve.map((function(t,e){return l+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?p():2===c?d():(e("if(",c,"===",1,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case dr:case yr:case _r:return 2;case mr:case vr:case br:return 3;case gr:case xr:case wr:return 4;default:return 1}}(n.info.type),o)}))}function Y(t,e,n,i,a,o){for(var s,l=t.shared,c=l.gl,u=0;u1){for(var M=[],S=[],E=0;E>1)",p],");")}function e(){r(d,".drawArraysInstancedANGLE(",[m,g,y,p],");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function w(){function t(){r(l+".drawElements("+[m,y,v,g+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[m,g,y]+");")}h&&"null"!==h?x?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof p||p>=0)?"string"==typeof p?(r("if(",p,">0){"),_(),r("}else if(",p,"<0){"),w(),r("}")):_():w()}function $(t,e,r,n,i){var a=j(),o=a.proc("body",i);return b&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function J(t,e,r,n){H(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,r,n.attributes,(function(){return!0}))),Y(t,e,r,n.uniforms,(function(){return!0}),!1),X(t,e,e,r)}function K(t,e,r,n){function i(){return!0}t.batchId="a1",H(t,e),W(t,e,r,n.attributes,i),Y(t,e,r,n.uniforms,i,!1),X(t,e,e,r)}function Q(t,e,r,n){H(t,e);var i=r.contextDep,a=e.def(),o=e.def();t.shared.props=o,t.batchId=a;var s=t.scope(),l=t.scope();function c(t){return t.contextDep&&i||t.propDep}function u(t){return!c(t)}if(e(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&N(t,l,r.context),r.needsFramebuffer&&U(t,l,r.framebuffer),q(t,l,r.state,c),r.profile&&c(r.profile)&&Z(t,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(t.shared.vao,".setVAO(",r.drawVAO.append(t,l),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),W(t,s,r,n.attributes,u),W(t,l,r,n.attributes,c)),Y(t,s,r,n.uniforms,u,!1),Y(t,l,r,n.uniforms,c,!0),X(t,s,l,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,l),p=l.def(f,".id"),d=l.def(h,"[",p,"]");l(t.shared.gl,".useProgram(",f,".program);","if(!",d,"){",d,"=",h,"[",p,"]=",t.link((function(t){return $(K,0,r,t,2)})),"(",f,");}",d,".call(this,a0[",a,"],",a,");")}}function tt(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!G(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,a=i.current;if(N(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),Fr(Object.keys(e.state)).forEach((function(r){var a=e.state[r],o=a.append(t,n);G(o)?o.forEach((function(e,i){z(e)?n.set(t.next[r],"["+i+"]",e):n.set(t.next[r],"["+i+"]",t.link(e,{stable:!0}))})):Br(a)?n.set(i.next,"."+r,t.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),Z(t,n,e,!0,!0),[$e,Qe,Ke,tr,Je].forEach((function(r){var a=e.draw[r];if(a){var o=a.append(t,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,t.link(o),{stable:!0})}})),Object.keys(e.uniforms).forEach((function(a){var o=e.uniforms[a].append(t,n);Array.isArray(o)&&(o="["+o.map((function(e){return z(e)?e:t.link(e,{stable:!0})}))+"]"),n.set(i.uniforms,"["+t.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(e.attributes).forEach((function(r){var i=e.attributes[r].append(t,n),a=t.scopeAttrib(r);Object.keys(new x).forEach((function(t){n.set(a,"."+t,i[t])}))})),e.scopeVAO){var o=e.scopeVAO.append(t,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",t.link(o,{stable:!0}))}function s(r){var a=e.shader[r];if(a){var o=a.append(t,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,t.link(o,{stable:!0}))}}s(Ye),s(Xe),Object.keys(e.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,l),function(t,e){var r=t.proc("batch",2);t.batchId="0",H(t,r);var n=!1,i=!0;Object.keys(e.context).forEach((function(t){n=n||e.context[t].propDep})),n||(N(t,r,e.context),i=!1);var a=e.framebuffer,o=!1;function s(t){return t.contextDep&&n||t.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(t,r,a)):U(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),V(t,r,e),q(t,r,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||Z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=o;var l=e.shader.progVar;if(l.contextDep&&n||l.propDep)Q(t,r,e,null);else{var c=l.append(t,r);if(r(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Q(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var u=t.global.def("{}"),h=r.def(c,".id"),f=r.def(u,"[",h,"]");r(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",t.link((function(t){return $(Q,0,e,t,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;"),t.shared.vao&&r(t.shared.vao,".setVAO(null);")}(s,l),t(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var Hr=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[],s=[];function l(t,e,r){var n=o.pop()||new a;n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var c=[],u=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),l(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var t,r,a=i.length;if(0!==a){u.length=Math.max(u.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,u[0]=0;var l,h=0;for(t=0,r=0;r0)if(Array.isArray(e[0])){o=I(e);for(var c=1,u=1;u0)if("number"==typeof t[0]){var i=m.allocType(h.dtype,t.length);O(i,t),p(i,n),m.freeType(i)}else if(Array.isArray(t[0])||_(t[0])){r=I(t);var a=C(t,r,h.dtype);p(a,n),m.freeType(a)}}else if(b(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var d=Array.isArray(t.data)?h.dtype:D(t.data),g=m.allocType(d,s*l);R(g,t.data,s,l,c,u,t.offset),p(g,n),m.freeType(g)}return f},r.profile&&(f.stats=h.stats),f.destroy=function(){u(h)},f},createStream:function(t,e){var r=s.pop();return r||(r=new o(t)),r.bind(),c(r,e,35040,0,1,!1),r},destroyStream:function(t){s.push(t)},clear:function(){w(a).forEach(u),s.forEach(u)},getBuffer:function(t){return t&&t._buffer instanceof o?t._buffer:null},restore:function(){w(a).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:c}}(n,p,r,(function(t){return Y.destroyBuffer(t)})),W=function(t,e,r,n){var i={},a=0,o={uint8:j,uint16:B};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}e.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;c||_(i)&&(!b(i)||_(i.data))||(h=e.oes_element_index_uint?N:B),r._initBuffer(n.buffer,i,a,h,3)}else t.bufferData(U,l,a),n.buffer.dtype=u||j,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case j:case 5120:u=j;break;case B:case 5122:u=B;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var f=s;f<0&&(f=n.buffer.byteLength,u===B?f>>=1:u===N&&(f>>=2)),n.vertCount=f;var p=o;if(o<0){p=4;var d=n.buffer.dimension;1===d&&(p=0),2===d&&(p=1),3===d&&(p=4)}n.primType=p}function u(t){n.elementsCount--,delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,e){var i=r.create(null,U,!0),a=new s(i._buffer);function l(t){if(t)if("number"==typeof t)i(t),a.primType=4,a.vertCount=0|t,a.type=j;else{var e=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(t)||_(t)||b(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=E[t.usage]),"primitive"in t&&(n=F[t.primitive]),"count"in t&&(s=0|t.count),"type"in t&&(h=o[t.type]),"length"in t?u=0|t.length:(u=s,h===B||5122===h?u*=2:h!==N&&5124!==h||(u*=4))),c(a,e,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=j;return l}return n.elementsCount++,l(t),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return i.subdata(t,e),l},l.destroy=function(){u(a)},l},createStream:function(t){var e=l.pop();return e||(e=new s(r.create(null,U,!0,!1)._buffer)),c(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){w(i).forEach(u)}}}(n,T,Z,p),Y=function(t,e,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c=p.byteLength?u.subdata(p):(u.destroy(),e.buffers[c]=null)),e.buffers[c]||(u=e.buffers[c]=i.create(h,34962,!1,!0)),f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[c]=1):i.getBuffer(h)?(f.buffer=i.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(h.buffer)?(f.buffer=i.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,f.type="type"in h?S[h.type]:f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1):"x"in h&&(f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2)}for(var d=0;d1)for(var y=0;yt&&(t=e.stats.uniformsCount)})),t},n.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var t=e.deleteShader.bind(e);w(a).forEach(t),a={},w(o).forEach(t),o={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var f=c[r];if(f&&(f.refCount++,!l))return f;var m=new p(i,r);return n.shaderCount++,d(m,0,l),f||(c[r]=m),h.push(m),t(m,{destroy:function(){if(m.refCount--,m.refCount<=0){e.deleteProgram(m.program);var t=h.indexOf(m);h.splice(t,1),n.shaderCount--}c[m.vertId].refCount<=0&&(e.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(e.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var t=0;t=0?f=!0:c.indexOf(d)>=0&&(f=!1))),("depthTexture"in M||"depthStencilTexture"in M)&&(k=!(!M.depthTexture&&!M.depthStencilTexture)),"depth"in M&&("boolean"==typeof M.depth?s=M.depth:(_=M.depth,u=!1)),"stencil"in M&&("boolean"==typeof M.stencil?u=M.stencil:(b=M.stencil,s=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?s=u=M.depthStencil:(w=M.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,I=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=M(s)}return t(n,{width:l,height:l,color:o})}return n(e),t(n,{faces:r,resize:function(t){var e,i=0|t;if(i===n.width)return n;var a=n.color;for(e=0;e=0;--t){var e=nt[t];e&&e(q,null,0)}n.flush(),k&&k.update()}function ct(){!st&&nt.length>0&&(st=s.next(lt))}function ut(){st&&(s.cancel(lt),st=null)}function ht(t){t.preventDefault(),ut(),it.forEach((function(t){t()}))}function ft(t){n.getError(),a.restore(),X.restore(),Z.restore(),$.restore(),J.restore(),K.restore(),Y.restore(),k&&k.restore(),Q.procs.refresh(),ct(),at.forEach((function(t){t()}))}function pt(e){function r(t,e){var r={},n={};return Object.keys(t).forEach((function(i){var a=t[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(e&&Array.isArray(a))for(var s=0;s0)return h.call(this,function(t){for(;p.length=0},read:tt,destroy:function(){nt.length=0,ut(),rt&&(rt.removeEventListener(Gr,ht),rt.removeEventListener(Zr,ft)),X.clear(),K.clear(),J.clear(),Y.clear(),$.clear(),W.clear(),Z.clear(),k&&k.clear(),ot.forEach((function(t){t()}))},_gl:n,_refresh:xt,poll:function(){vt(),k&&k.update()},now:_t,stats:p,getCachedCode:function(){return d},preloadCachedCode:function(t){Object.entries(t).forEach((function(t){d[t[0]]=t[1]}))}});return r.onDone(null,bt),bt}},"object"==typeof t&&void 0!==e?e.exports=n():r.createREGL=n()}}),Qv=f({"node_modules/gl-util/context.js"(t,e){var r=Bg();function n(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function a(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=i(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:r(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var o=document.querySelector(t.container);if(!o)throw Error("Element "+t.container+" is not found");t.container=o}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=a(),t.container.appendChild(t.canvas),n(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=a(),t.container.appendChild(t.canvas),n(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}}}),tx=f({"node_modules/font-atlas/index.js"(t,e){var r=$v(),n=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],i=t.canvas||document.createElement("canvas"),a=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||n;if(a&&"string"!=typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");e=e.slice(),i.width=e[0],i.height=e[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var f=o[0]/2,p=o[1]/2;for(c=0;ce[0]-o[0]/2&&(f=o[0]/2,p+=o[1]);return i}}}),ex=f({"node_modules/bit-twiddle/twiddle.js"(t){function e(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(t){return(t>0)-(t<0)},t.abs=function(t){var e=t>>31;return(t^e)-e},t.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},t.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},t.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},t.countTrailingZeros=e,t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},t.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},t.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},t.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},t.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},t.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},t.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>e(t)+1}}}),rx=f({"node_modules/dup/dup.js"(t,e){function r(t,e,n){var i=0|t[n];if(i<=0)return[];var a,o=new Array(i);if(n===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n0?n.pop():new ArrayBuffer(t)}function f(t){return new Uint8Array(h(t),0,t)}function p(t){return new Uint16Array(h(2*t),0,t)}function d(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function g(t){return new Int16Array(h(2*t),0,t)}function y(t){return new Int32Array(h(4*t),0,t)}function v(t){return new Float32Array(h(4*t),0,t)}function x(t){return new Float64Array(h(8*t),0,t)}function _(t){return i?new Uint8ClampedArray(h(t),0,t):f(t)}function b(t){return a?new BigUint64Array(h(8*t),0,t):null}function w(t){return o?new BigInt64Array(h(8*t),0,t):null}function T(t){return new DataView(h(t),0,t)}function k(t){t=e.nextPow2(t);var r=e.log2(t),i=c[r];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))c[e.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,i=0|e.log2(r);l[i].push(t)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(t){u(t.buffer)},t.freeArrayBuffer=u,t.freeBuffer=function(t){c[e.log2(t.length)].push(t)},t.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return f(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return m(t);case"int16":return g(t);case"int32":return y(t);case"float":case"float32":return v(t);case"double":case"float64":return x(t);case"uint8_clamped":return _(t);case"bigint64":return w(t);case"biguint64":return b(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},t.mallocArrayBuffer=h,t.mallocUint8=f,t.mallocUint16=p,t.mallocUint32=d,t.mallocInt8=m,t.mallocInt16=g,t.mallocInt32=y,t.mallocFloat32=t.mallocFloat=v,t.mallocFloat64=t.mallocDouble=x,t.mallocUint8Clamped=_,t.mallocBigUint64=b,t.mallocBigInt64=w,t.mallocDataView=T,t.mallocBuffer=k,t.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.BIGUINT64[t].length=0,s.BIGINT64[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}}),ix=f({"node_modules/is-plain-obj/index.js"(t,e){var r=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}}}),ax=f({"node_modules/parse-unit/index.js"(t,e){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}}}),ox=f({"node_modules/to-px/topx.js"(t,e){var r=ax();function n(t,e){var n=r(getComputedStyle(t).getPropertyValue(e));return n[0]*i(n[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}e.exports=i}}),sx=f({"node_modules/detect-kerning/index.js"(t,e){e.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var i,o={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?i=a(e):Array.isArray(e)?i=e:(e.o?i=a(e.o):e.pairs&&(i=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),i||(i=n),r.font=s+"px "+t;for(var c=0;cs*l){var p=(f-h)/s;o[u]=1e3*p}}return o}function a(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),cx=f({"node_modules/gl-text/dist.js"(t,e){var r,n=Jv(),i=Bg(),a=Kv(),o=Qv(),s=Ov(),l=Bd(),c=tx(),u=nx(),h=Ng(),f=ix(),p=ax(),d=ox(),m=sx(),g=uy(),y=lx(),v=qg(),x=ex().nextPow2,_=new s,b=!1;document.body&&((r=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(r).fontStretch&&(b=!0),document.body.removeChild(r));var w=function(t){!function(t){return"function"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=_.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),_.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(f(t)?t:{})};w.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},w.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=v(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=w.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(w.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,c=t.variant;t=n.parse(n.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),c&&(t.variant=c)}var u=n.stringify({size:w.baseFontSize,family:t.family,stretch:b?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=p(t.size),f=Math.round(h[0]*d(h[1]));if(f!==e.fontSize[r]&&(o=!0,e.fontSize[r]=f),!(e.font[r]&&u==e.font[r].baseString||(a=!0,e.font[r]=w.fonts[u],e.font[r]))){var m=t.family.join(", "),g=[t.style];t.style!=t.variant&&g.push(t.variant),t.variant!=t.weight&&g.push(t.weight),b&&t.weight!=t.stretch&&g.push(t.stretch),e.font[r]={baseString:u,family:m,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:y(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:g.join(" ")})},w.fonts[u]=e.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:e.fontSize[i],family:r.family,stretch:b?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[a],!e.fontAtlas[i]){var o=r.metrics;e.shader.atlas[a]=e.fontAtlas[i]={fontString:a,step:2*Math.ceil(e.fontSize[i]*o.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),f=0;f2){for(var T=!t.position[0].length,k=u.mallocFloat(2*this.count),A=0,M=0;A1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"==typeof t?t-n.baseline:-n[t],i*=-1}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var G=t.color.length;H=u.mallocUint8(G);for(var Z=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var $=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array($);for(var J=0;J1?this.counts[J]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[J]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*J,4*J+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[J]:this.opacity,baseline:null!=this.baselineOffset[J]?this.baselineOffset[J]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[J]?this.alignOffset[J]:this.alignOffset[0]:0,atlas:this.fontAtlas[J]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*J,2*J+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},e.exports=w}}),ux=f({"src/lib/prepare_regl.js"(t,e){var r=Jd(),n=Kv();e.exports=function(t,e,i){var a=t._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:i||{}})}catch(t){o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),hx=f({"src/traces/scattergl/plot.js"(t,e){var r=my(),n=Fv(),i=jv(),a=cx(),o=se(),s=Dr().selectMode,l=ux(),c=We(),u=ui(),h=oy().styleTextSelection,f={};function p(t,e,r,n){var i=t._size,a=t.width*n,o=t.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,f=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*f,a-c-(1-e.domain[1])*h,o-u-(1-r.domain[1])*f]}(e.exports=function(t,e,d){if(d.length){var m,g,y=t._fullLayout,v=e._scene,x=e.xaxis,_=e.yaxis;if(v)if(l(t,["ANGLE_instanced_arrays","OES_element_index_uint"],f)){var b=v.count,w=y._glcanvas.data()[0].regl;if(u(t,e,d),v.dirty){if(!v.line2d&&!v.error2d||v.scatter2d||v.fill2d||v.glText||w.clear({}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(b),m=0;mv.glText.length){var T=b-v.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var A=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(A)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,b),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var r=d[e];if(t&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[e],c=[];o._ownfill&&c.push(e),o._nexttrace&&c.push(e+1),c.length&&(v.fillOrder[e]=c);var u,h,f=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;uu&&isNaN(p[h+1]);)h-=2;0!==p[u+1]&&(f=[p[u],0]),f=f.concat(p.slice(u,h+2)),0!==p[h+1]&&(f=f.concat([p[h],0]))}else if("tozerox"===o.fill){for(u=0;uu&&isNaN(p[h]);)h-=2;0!==p[u]&&(f=[0,p[u+1]]),f=f.concat(p.slice(u,h+2)),0!==p[h]&&(f=f.concat([0,p[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(f=[],n=0,t.splitNull=!0,i=0;i-1;for(m=0;ma&&l||ih?_.sizeAvg||Math.max(_.size,3):i(e,x),p=0;p2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),f.length>2?(s=f[0],c=f[2],l=f[1],u=f[3]):f.length?(s=l=f[0],c=u=f[1]):(s=f.x,l=f.y,c=f.x+f.width,u=f.y+f.height),[s,i,c,o]}function f(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];{let e=s(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}}e.exports=c,c.prototype.render=function(...t){return t.length&&this.update(...t),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.prototype.update=function(...t){if(!t.length)return;for(let e=0;ee)continue;if(!c.lower&&t{e[a+r]=n}))}this.scatter.draw(...e)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((t=>{t.buffer&&t.buffer.destroy&&t.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),Tx=f({"src/traces/splom/plot.js"(t,e){var r=wx(),n=se(),i=ve(),a=Dr().selectMode;function o(t,e){var o,s,l,c,u,h=t._fullLayout,f=h._size,p=e.trace,d=e.t,m=h._splomScenes[p.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=p.showupperhalf,g.upper=p.showlowerhalf,g.diagonal=p.diagonal.visible;var _=p._visibleDims,b=y.length,w=m.viewOpts={};for(w.ranges=new Array(b),w.domains=new Array(b),u=0;u<_.length;u++){l=_[u];var T=w.ranges[u]=new Array(4),k=w.domains[u]=new Array(4);(o=i.getFromId(t,p._diag[l][0]))&&(T[0]=o._rl[0],T[2]=o._rl[1],k[0]=o.domain[0],k[2]=o.domain[1]),(s=i.getFromId(t,p._diag[l][1]))&&(T[1]=s._rl[0],T[3]=s._rl[1],k[1]=s.domain[0],k[3]=s.domain[1])}var A=t._context.plotGlPixelRatio,M=f.l*A,S=f.b*A,E=f.w*A,C=f.h*A;w.viewport=[M,S,E+M,C+S],!0===m.matrix&&(m.matrix=r(v));var I=h.clickmode.indexOf("select")>-1,L=!0;if(a(x)||p.selectedpoints||I){var P=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var z=p.selectedpoints,D={};for(l=0;l=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],u=l,f=a;i*fe){f=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(f)?isNaN(h)?f:h:e-c[h][1]t[1]+n||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var y=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(n=0;n=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(i)].sort(o),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),_(t.parentNode)}function T(t,e){var i=b(e,e.height-n.mouse(t)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){n.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(t){!function(t,e){n.event.sourceEvent.stopPropagation();var i=e.height-n.mouse(t)[1]-2*r.verticalPadding,a=e.unitToPaddedPx.invert(i),o=e.brush,s=b(e,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,i=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),_(t.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?_(t.parentNode,s):(s(),_(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,t)})))}function A(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var s,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(o)})).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(s=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e),n=r.slice();e.filter.set(n),s()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,n){var o=t.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(t,e,n){var i=n._context.staticPlot,o=t.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(p).call(d).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(k).attr("height",(function(t){return t.height-r.verticalPadding}));var l=t.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",e).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(t){return t.height})).call(x);var c=t.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(x)}(o,e,n)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(o)})),t=e.multiselect?S(t.sort(A)):[t[0]]):t=[t.sort(o)],e.tickvals){var r=e.tickvals.slice().sort(o);if(!(t=t.map((function(t){var e=[f(0,r,t[0],[]),f(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}}}),Rx=f({"src/traces/parcoords/defaults.js"(t,e){var r=se(),n=Se().hasColorscale,i=Ve(),a=Ta().defaults,o=je(),s=nr(),l=Px(),c=Ox(),u=zx().maxDimensionCount,h=mx();function f(t,e,n,i){function a(n,i){return r.coerce(t,e,l.dimensions,n,i)}var o=a("values"),u=a("visible");if(o&&o.length||(u=e.visible=!1),u){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(e._ax,i.layout),a("multiselect");var f=a("constraintrange");f&&(e.constraintrange=c.cleanRanges(f,e))}}e.exports=function(t,e,s,c){function p(n,i){return r.coerce(t,e,l,n,i)}var d=t.dimensions;Array.isArray(d)&&d.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),d.splice(u));var m=o(t,e,{name:"dimensions",layout:c,handleItemDefaults:f}),g=function(t,e,a,o,s){var l=s("line.color",a);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,s,c,p);a(e,c,p),Array.isArray(m)&&m.length||(e.visible=!1),h(e,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(p,"labelfont",y),r.coerceFont(p,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(p,"rangefont",y),p("labelangle"),p("labelside"),p("unselected.line.color"),p("unselected.line.opacity")}}}),Fx=f({"src/traces/parcoords/calc.js"(t,e){var r=se().isArrayOrTypedArray,n=Ze(),i=Dx().wrap;e.exports=function(t,e){var a,o;return n.hasColorscale(e,"line")&&r(e.line.color)?(a=e.line.color,o=n.extractOpts(e.line).colorscale,n.calc(t,e,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(t){for(var e=new Array(t),r=0;r>>16,(65280&t)>>>8,255&t],alpha:1};if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),Fp.default[t])a=Fp.default[t].slice(),i="rgb";else if("transparent"===t)o=0,i="rgb",a=[0,0,0];else if("#"===t[0]){var s=t.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var c=n[1],u="cmyk"===(i=c.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map((function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]?100*t:"l"!==i[0]||e?"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t:100*t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==Bp[t])return Bp[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)}))).length>u?a.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(a=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=(null==(r=null==(e=t.match(/([a-z])/gi))?void 0:e.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var Bx,Nx,Ux=h({"node_modules/color-parse/index.js"(){var r,n,i;r=Dd(),n=1,i=null!=r?t(s(r)):{},Fp=d(!n&&r&&r.__esModule?i:e(i,"default",{value:r,enumerable:!0}),r),jp=jx,Bp={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Vx=h({"node_modules/color-space/rgb.js"(){Bx={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),qx=h({"node_modules/color-space/hsl.js"(){Vx(),Nx={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c++]=255*a;return i}},Bx.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),Hx={};function Gx(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var r=jp(t);if(!r.space)return[];const n="h"===r.space[0]?Nx.min:Bx.min,i="h"===r.space[0]?Nx.max:Bx.max;return(e=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),e[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),e[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(e=Nx.rgb(e)),e.push(Math.min(Math.max(r.alpha,0),1)),e}p(Hx,{default:()=>Gx});var Zx=h({"node_modules/color-rgba/index.js"(){Ux(),Vx(),qx()}}),Wx=f({"src/traces/parcoords/helpers.js"(t){var e=se().isTypedArray;t.convertTypedArray=function(t){return e(t)?Array.prototype.slice.call(t):t},t.isOrdinal=function(t){return!!t.tickvals},t.isVisible=function(t){return t.visible||!("visible"in t)}}}),Yx=f({"src/traces/parcoords/lines.js"(t,e){var r=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=zx().maxDimensionCount,a=se(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function f(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[n].dim1.canvasX,a=n);0===o&&h(A,0,0,l.canvasWidth,l.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&n<_.length?_[n].brush.filter.getBounds():[-1/0,1/0];i[0][n]=a[0],i[1][n]=a[1]}var o=new Array(16384);for(e=0;e<16384;e++)o[e]=255;if(!t)for(e=0;e<_.length;e++){var l=e%8,c=(e-l)/8,u=Math.pow(2,l),h=_[e].brush.filter.get();if(!(h.length<2)){var f=x(h[0])[1];for(r=1;rs._length&&(M=M.slice(0,s._length));var C,L=s.tickvals;function P(t,e){return{val:t,text:C[e]}}function z(t,e){return t.val-e.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),C=s.ticktext,i(C)&&C.length?C.length>L.length?C=C.slice(0,L.length):L.length>C.length&&(L=L.slice(0,C.length)):C=L.map(a(s.tickformat));for(var D=1;D=n||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,f={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:h};h!==B&&(u?a.hover(f):a.unhover&&a.unhover(f),B=h)}})),j.style("opacity",(function(t){return t.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var N=p.selectAll("."+_.cn.parcoords).data(C,d);N.exit().remove(),N.enter().append("g").classed(_.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),N.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var U=N.selectAll("."+_.cn.parcoordsControlView).data(g,d);U.enter().append("g").classed(_.cn.parcoordsControlView,!0),U.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var V=U.selectAll("."+_.cn.yAxis).data((function(t){return t.dimensions}),d);V.enter().append("g").classed(_.cn.yAxis,!0),U.each((function(t){O(V,t,v)})),j.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=w(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),V.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),V.call(r.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;E.linePickActive(!1),t.x=Math.max(-_.overdrag,Math.min(t.model.width+_.overdrag,r.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,V.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),O(V,e,v),V.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),r.select(this).attr("transform",c(t.x,0)),V.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!I(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(V,e,v),r.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!I(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),E.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),V.exit().remove();var q=V.selectAll("."+_.cn.axisOverlays).data(g,d);q.enter().append("g").classed(_.cn.axisOverlays,!0),q.selectAll("."+_.cn.axis).remove();var H=q.selectAll("."+_.cn.axis).data(g,d);H.enter().append("g").classed(_.cn.axis,!0),H.each((function(t){var e=t.model.height/t.model.tickDistance,n=t.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return x.isOrdinal(t)?e:R(t.model.dimensions[t.visibleIndex],e)})).scale(n)),h.font(H.selectAll("text"),t.model.tickFont)})),H.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),H.selectAll("text").style("cursor","default");var G=q.selectAll("."+_.cn.axisHeading).data(g,d);G.enter().append("g").classed(_.cn.axisHeading,!0);var Z=G.selectAll("."+_.cn.axisTitle).data(g,d);Z.enter().append("text").classed(_.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),Z.text((function(t){return t.label})).each((function(e){var n=r.select(this);h.font(n,e.model.labelFont),u.convertToTspans(n,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=_.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var W=q.selectAll("."+_.cn.axisExtent).data(g,d);W.enter().append("g").classed(_.cn.axisExtent,!0);var Y=W.selectAll("."+_.cn.axisExtentTop).data(g,d);Y.enter().append("g").classed(_.cn.axisExtentTop,!0),Y.attr("transform",c(0,-_.axisExtentOffset));var X=Y.selectAll("."+_.cn.axisExtentTopText).data(g,d);X.enter().append("text").classed(_.cn.axisExtentTopText,!0).call(z),X.text((function(t){return F(t,!0)})).each((function(t){h.font(r.select(this),t.model.rangeFont)}));var $=W.selectAll("."+_.cn.axisExtentBottom).data(g,d);$.enter().append("g").classed(_.cn.axisExtentBottom,!0),$.attr("transform",(function(t){return c(0,t.model.height+_.axisExtentOffset)}));var J=$.selectAll("."+_.cn.axisExtentBottomText).data(g,d);J.enter().append("text").classed(_.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),J.text((function(t){return F(t,!1)})).each((function(t){h.font(r.select(this),t.model.rangeFont)})),b.ensureAxisBrush(q,T,t)}}}),$x=f({"src/traces/parcoords/plot.js"(t,e){var r=Xx(),n=ux(),i=Wx().isVisible,a={};function o(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var s=t._fullLayout;if(n(t,[],a)){var l={},c={},u={},h={},f=s._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()})),r(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=c[e][r],a=n.map((function(t){return t.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[o]){var f=i.constraintrange;l[o]=f||null}var p=t._fullData[u[e]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,p.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete p.constraintrange,a=null);var d={};d[o]=a,t.emit("plotly_restyle",[d,[h[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,c[e].filter(i));l[e].sort(n),c[e].filter((function(t){return!i(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[h[e]]])}})}}).reglPrecompiled=a}}),Jx=f({"src/traces/parcoords/base_plot.js"(t){var e=v(),r=be().getModuleCalcData,n=$x(),i=ke();t.name="parcoords",t.plot=function(t){var e=r(t.calcdata,"parcoords")[0];e.length&&n(t,e)},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(t){var r=t._fullLayout._glimages,n=e.select(t).selectAll(".svg-container");n.filter((function(t,e){return e===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this,e=t.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:t.style.width,height:t.style.height})})),window.setTimeout((function(){e.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),Kx=f({"src/traces/parcoords/base_index.js"(t,e){e.exports={attributes:Px(),supplyDefaults:Rx(),calc:Fx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Jx(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Qx=f({"src/traces/parcoords/index.js"(t,e){var r=Kx();r.plot=$x(),e.exports=r}}),t_=f({"lib/parcoords.js"(t,e){e.exports=Qx()}}),e_=f({"src/traces/parcats/attributes.js"(t,e){var r=O().extendFlat,n=N(),i=R(),a=Le(),o=Dt().hovertemplateAttrs,s=Ta().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});e.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),r_=f({"src/traces/parcats/defaults.js"(t,e){var r=se(),n=Se().hasColorscale,i=Ve(),a=Ta().defaults,o=je(),s=e_(),l=mx(),c=S().isTypedArraySpec;function u(t,e){function n(n,i){return r.coerce(t,e,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=e.visible=!1),a){n("label"),n("displayindex",e._index);var o,l=t.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),u||"array"!==h||(e.categoryorder="trace")}}e.exports=function(t,e,c,h){function f(n,i){return r.coerce(t,e,s,n,i)}var p=o(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(t,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=a}return 1/0}(t,e,c,h,f);a(e,h,f),Array.isArray(p)&&p.length||(e.visible=!1),l(e,p,"values",d),f("hoveron"),f("hovertemplate"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var m=h.font;r.coerceFont(f,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(f,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),n_=f({"src/traces/parcats/calc.js"(t,e){var r=Dx().wrap,n=Se().hasColorscale,i=Ge(),a=ne(),o=Ke(),s=se(),l=T();function c(t,e,r){t.valueInds.push(e),t.count+=r}function u(t,e,r){return{categoryInds:t,color:e,rawColor:r,valueInds:[],count:0}}function h(t,e,r){t.valueInds.push(e),t.count+=r}e.exports=function(t,e){var f=s.filterVisible(e.dimensions);if(0===f.length)return[];var p,d,m,g=f.map((function(t){var e;if("trace"===t.categoryorder)e=null;else if("array"===t.categoryorder)e=t.categoryarray;else{e=a(t.values);for(var r=!0,n=0;n=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(r))for(e=0;ee.model.rawColor?1:t.model.rawColor"),C=r.mouse(h)[0];a.loneHover({trace:f,x:v-d.left+m.left,y:b-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C1&&f.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var _=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:v,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:y}]}}function I(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var e,n=t.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron,u=this;"color"===l?(function(t){var e=r.select(t).datum(),n=M(e);T(n),n.each((function(){o.raiseToTop(this)})),r.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){o.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),E(u,"plotly_hover",r.event)):(function(t){r.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=M(t);T(e),e.each((function(){o.raiseToTop(this)}))})),r.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),S(u,"plotly_hover",r.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?e=C(n,s,u):"color"===l?e=function(t,e,n){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,f=h.parcatsViewModel,p=f.model.dimensions[h.model.dimensionInd],d=f.trace,m=l.y+l.height/2;f.dimensions.length>1&&p.displayInd===f.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(t){t.color===u.color&&(v+=t.count)}));var x=h.model.count,_=0;f.pathSelection.each((function(t){t.model.color===u.color&&(_+=t.model.count)}));var b=v/y,w=v/_,T=v/x,k={countLabel:v,categoryLabel:g,probabilityLabel:b.toFixed(3)},A=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color ∩ "+g+"): "+k.probabilityLabel),A.push("P("+g+" | color): "+w.toFixed(3)),A.push("P(color | "+g+"): "+T.toFixed(3)));var M=A.join("
"),S=c.mostReadable(u.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:b,categorycount:x,colorcount:_,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(e=function(t,e,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(t,e,this))})),i}(n,s,u)),e&&a.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(t){var e=t.parcatsViewModel;e.dragDimension||(w(e.pathSelection),k(e.dimensionSelection.selectAll("g.category")),A(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(d),-1!==e.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):S(this,"plotly_unhover",r.event))}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var f=t.parcatsViewModel.dimensions[n],p=t.parcatsViewModel.dimensions[i];void 0!==f&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}V(t.parcatsViewModel),U(t.parcatsViewModel),j(t.parcatsViewModel),F(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var e={},n=R(t.parcatsViewModel),a=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==a[e]}));o&&a.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),h=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[h],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?E(t.potentialClickBand,"plotly_click",r.event.sourceEvent):S(t.potentialClickBand,"plotly_click",r.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,V(t.parcatsViewModel),U(t.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){j(t.parcatsViewModel,!0),F(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(t.parcatsViewModel.graphDiv,e,[n])}))}}function R(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+i)+" "+l[s]+","+(e[s]+i)+" "+(t[s]+r[s])+","+(e[s]+i),u+="l-"+r[s]+",0 ";return u+="Z"}function U(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=h(e),i=h(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var f=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(y.count/p):0;for(var v,x=new Array(n.length),_=0;_1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=t.model.maxCats,f=e.categories.length,p=e.count,d=t.height-8*(h-1),m=8*(h-f)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}}}),a_=f({"src/traces/parcats/plot.js"(t,e){var r=i_();e.exports=function(t,e,n,i){var a=t._fullLayout,o=a._paper,s=a._size;r(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),o_=f({"src/traces/parcats/base_plot.js"(t){var e=be().getModuleCalcData,r=a_(),n="parcats";t.name=n,t.plot=function(t,i,a,o){var s=e(t.calcdata,n);if(s.length){var l=s[0];r(t,l,a,o)}},t.clean=function(t,e,r,n){var i=n._has&&n._has("parcats"),a=e._has&&e._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),s_=f({"src/traces/parcats/index.js"(t,e){e.exports={attributes:e_(),supplyDefaults:r_(),calc:n_(),plot:a_(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:o_(),categories:["noOpacity"],meta:{}}}}),l_=f({"lib/parcats.js"(t,e){e.exports=s_()}}),c_=f({"src/plots/mapbox/constants.js"(t,e){var r=Zt(),n="1.13.4",i='©
OpenStreetMap contributors',a=['© Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=r(s);e.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+n+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}}),u_=f({"src/plots/mapbox/layout_attributes.js"(t,e){var r=se(),n=q().defaultLine,i=Ta().attributes,a=R(),o=wn().textposition,s=Lt().overrideAll,l=ge().templatedArray,c=c_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),h_=f({"src/traces/scattermapbox/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=bn(),a=Zm(),o=wn(),s=u_(),l=N(),c=Le(),u=O().extendFlat,h=Lt().overrideAll,f=u_(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),f_=f({"src/traces/scattermapbox/constants.js"(t,e){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),p_=f({"src/traces/scattermapbox/defaults.js"(t,e){var r=se(),n=We(),i=Zn(),a=Wn(),o=Xn(),s=$n(),l=h_(),c=f_().isSupportedFont;e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f);if(d){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),n.hasMarkers(e)){i(t,e,u,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==e.fill&&s(t,e,u,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),d_=f({"src/traces/scattermapbox/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),m_=f({"src/plots/mapbox/convert_text_opts.js"(t,e){var r=se();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),g_=f({"src/traces/scattermapbox/convert.js"(t,e){var r=T(),n=se(),i=k().BADNUM,a=Qm(),o=Ze(),s=Ke(),l=Ye(),c=We(),u=f_().isSupportedFont,h=m_(),f=Xe().appendArrayPointValue,p=Me().NEWLINES,d=Me().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),k=c.hasMarkers(u),A=c.hasText(u),M=k&&"circle"===u.marker.symbol,S=k&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,_=[];for(e=0;e=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function f(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",f.circle,l.cluster),r=0;r")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-f.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),x_=f({"src/traces/scattermapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),__=f({"src/traces/scattermapbox/select.js"(t,e){var r=se(),n=We(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},l=Math.pow(2,53)-1;function c(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}}var u=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function f(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function x(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function b(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function w(t){return Array.isArray(t)?t.map(w):"object"==typeof t&&t?_(t,w):t}var T={};function k(t){T[t]||("undefined"!=typeof console&&console.warn(t),T[t]=!0)}function A(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function M(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var C=null;function I(t){if(null==C){var e=t.navigator?t.navigator.userAgent:null;C=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return C}function L(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,z,D,O,R=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,j=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,B={now:R,frame:function(t){var e=F(t);return{cancel:function(){return j(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&O&&(q?H(t):D=t)}},V=!1,q=!1;function H(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,O),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}s.document&&((O=s.document.createElement("img")).onload=function(){D&&H(D),D=null,q=!0},O.onerror=function(){V=!0,D=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",Z=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function W(t){return 0===t.indexOf("mapbox:")}Z.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},Z.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Z.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},Z.prototype.normalizeStyleURL=function(t,e){if(!W(t))return t;var r=J(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var r=J(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var r=J(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},Z.prototype.normalizeSpriteURL=function(t,e,r,n){var i=J(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,K(i))},Z.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!W(t))return t;var r=J(t),n=B.devicePixelRatio>=2||512===e?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!N.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Y.test(t)}var $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function J(t){var e=t.match($);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var Q="mapbox.eventData";function tt(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(s.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var et=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};et.prototype.getStorageKey=function(t){var e,r=tt(N.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n=N.ACCESS_TOKEN||"",t?Q+"."+t+":"+n:Q+":"+n},et.prototype.fetchEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){k("Unable to read from LocalStorage")}},et.prototype.saveEventData=function(){var t=L("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){k("Unable to write to LocalStorage")}},et.prototype.processRequests=function(t){},et.prototype.postEvent=function(t,e,n,i){var a=this;if(N.EVENTS_URL){var o=J(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=e?p(s,e):s,c={url:K(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=St(c,(function(t){a.pendingRequest=null,n(t),a.saveEventData(),a.processRequests(i)}))}},et.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var rt,nt,it=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(et),at=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=tt(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)}),t)}},e}(et)),ot=at.postTurnstileEvent.bind(at),st=new it,lt=st.postMapLoadEvent.bind(st),ct="mapbox-tiles",ut=500,ht=50;function ft(){s.caches&&!rt&&(rt=s.caches.open(ct))}function pt(t,e,r){if(ft(),rt){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=E(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===nt)try{new Response(new ReadableStream),nt=!0}catch(t){nt=!1}nt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new s.Response(e,n);ft(),rt&&rt.then((function(e){return e.put(dt(t.url),r)})).catch((function(t){return k(t.message)}))})))}}function dt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function mt(t,e){if(ft(),!rt)return e(null);var r=dt(t.url);rt.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}var gt,yt=1/0;function vt(){return null==gt&&(gt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),gt}var xt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(xt);var _t=function(t){function e(e,r,n){401===r&&X(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),bt=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function wt(t,e){var r,n=new s.AbortController,i=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:bt(),signal:n.signal}),a=!1,o=!1,l=(r=i.url).indexOf("sku=")>0&&X(r);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&k(r),n&&a)return u(n);var c=Date.now();s.fetch(i).then((function(r){if(r.ok){var n=l?r.clone():null;return u(r,n,c)}return e(new _t(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&pt(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return l?mt(i,c):c(null,null),{cancel:function(){o=!0,a||n.abort()}}}var Tt,kt,At=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(bt())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return wt(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new s.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new _t(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Mt=function(t,e){return At(p(t,{type:"arrayBuffer"}),e)},St=function(t,e){return At(p(t,{method:"POST"}),e)},Et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Tt=[],kt=0;var Ct=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),kt>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return Tt.push(r),r}kt++;var n=!1,i=function(){if(!n)for(n=!0,kt--;Tt.length&&kt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Dt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Ot={$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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},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:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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-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"],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}},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"}}},Rt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ft(t){var e=t.key,r=t.value;return r?[new Rt(e,r,"constants have been deprecated as of v8")]:[]}function jt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ee=[qt,Ht,Gt,Zt,Wt,Jt,Yt,Qt(Xt),Kt];function re(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!re(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=ee;r255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),g=m<=.5?m*(d+1):m+d-m*d,y=2*m-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,oe=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};oe.parse=function(t){if(t){if(t instanceof oe)return t;if("string"==typeof t){var e=ae(t);if(e)return new oe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},oe.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},oe.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},oe.black=new oe(0,0,0,1),oe.white=new oe(1,1,1,1),oe.transparent=new oe(0,0,0,0),oe.red=new oe(1,0,0,1);var se=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var le=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ce=function(t){this.sections=t};ce.fromString=function(t){return new ce([new le(t,null,null,null,null)])},ce.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ce.factory=function(t){return t instanceof ce?t:ce.fromString(t)},ce.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function fe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof oe)return!0;if(t instanceof se)return!0;if(t instanceof ce)return!0;if(t instanceof ue)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in ye)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=ye[s],n++}else a=Xt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Qt(a,o)}else r=ye[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var xe=function(t){this.type=Jt,this.sections=t};xe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Ht)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Qt(Gt))))return null;var c=null;if(o["text-color"]&&!(c=e.parse(o["text-color"],1,Wt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=e.parse(t[a],1,Xt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new xe(n)},xe.prototype.evaluate=function(t){return new ce(this.sections.map((function(e){var r=e.content.evaluate(t);return pe(r)===Kt?new le("",r,null,null,null):new le(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},xe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},_e.prototype.eachChild=function(t){t(this.input)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return["image",this.input.serialize()]};var be={"to-boolean":Zt,"to-color":Wt,"to-number":Ht,"to-string":Gt},we=function(t,e){this.type=t,this.args=e};we.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=be[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":he(e[0],e[1],e[2],e[3])))return new oe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ge(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ie(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,e.z);return[Math.round(n*a*Se),Math.round(i*a*Se)]}function Le(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Pe(t,e){for(var r,n,i,a,o,s,l,c=!1,u=0,h=e.length;u0&&h<0||u<0&&h>0}function Oe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a}Ee(e,t)}function Ue(t,e,r,n){for(var i=Math.pow(2,n.z)*Se,a=[n.x*Se,n.y*Se],o=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ze(t,e)&&(r=!1)})),r}qe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(fe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ge("Input is not a number.");o=s-1}return 0}Ye.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ye.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ve(e,[t]):"coerce"===r?new we(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof me)&&"resolvedImage"!==a.type.kind&&Xe(a)){var l=new ke;try{a=new me(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Ye.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ye(this.registry,n,e||null,i,this.errors)},Ye.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ut(n,t))},Ye.prototype.checkSubtype=function(t,e){var r=re(t,e);return r&&this.error(r),r};var Je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Je(i,r,n)},Je.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[$e(e,n)].evaluate(t)},Je.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Qe=Object.freeze({__proto__:null,number:Ke,color:function(t,e,r){return new oe(Ke(t.r,e.r,r),Ke(t.g,e.g,r),Ke(t.b,e.b,r),Ke(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ke(t,e[n],r)}))}}),tr=.95047,er=1.08883,rr=4/29,nr=6/29,ir=3*nr*nr,ar=nr*nr*nr,or=Math.PI/180,sr=180/Math.PI;function lr(t){return t>ar?Math.pow(t,1/3):t/ir+rr}function cr(t){return t>nr?t*t*t:ir*(t-rr)}function ur(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function hr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fr(t){var e=hr(t.r),r=hr(t.g),n=hr(t.b),i=lr((.4124564*e+.3575761*r+.1804375*n)/tr),a=lr((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-lr((.0193339*e+.119192*r+.9503041*n)/er)),alpha:t.a}}function pr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*cr(e),r=tr*cr(r),n=er*cr(n),new oe(ur(3.2404542*r-1.5371385*e-.4985314*n),ur(-.969266*r+1.8760108*e+.041556*n),ur(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function dr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var mr={forward:fr,reverse:pr,interpolate:function(t,e,r){return{l:Ke(t.l,e.l,r),a:Ke(t.a,e.a,r),b:Ke(t.b,e.b,r),alpha:Ke(t.alpha,e.alpha,r)}}},gr={forward:function(t){var e=fr(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*sr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*or,r=t.c;return pr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:dr(t.h,e.h,r),c:Ke(t.c,e.c,r),l:Ke(t.l,e.l,r),alpha:Ke(t.alpha,e.alpha,r)}}},yr=Object.freeze({__proto__:null,lab:mr,hcl:gr}),vr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ht)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Wt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=e.parse(f,d,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new vr(c,r,n,i,l):e.error("Type "+te(c)+" is not interpolatable.")},vr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=$e(e,n),o=e[a],s=e[a+1],l=vr.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(t),u=r[a+1].evaluate(t);return"interpolate"===this.operator?Qe[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?gr.reverse(gr.interpolate(gr.forward(c),gr.forward(u),l)):mr.reverse(mr.interpolate(mr.forward(c),mr.forward(u),l))},vr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ge("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ge("Array index must be an integer, but found "+e+" instead.");return r[e]},wr.prototype.eachChild=function(t){t(this.index),t(this.input)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Tr=function(t,e){this.type=Zt,this.needle=t,this.haystack=e};Tr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);return r&&n?ne(r.type,[Zt,Gt,Ht,qt,Xt])?new Tr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},Tr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(pe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(pe(r))+" instead.");return r.indexOf(e)>=0},Tr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Tr.prototype.outputDefined=function(){return!0},Tr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var kr=function(t,e,r){this.type=Ht,this.needle=t,this.haystack=e,this.fromIndex=r};kr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Xt);if(!r||!n)return null;if(!ne(r.type,[Zt,Gt,Ht,qt,Xt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new kr(r,n,i):null}return new kr(r,n)},kr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ie(e,["boolean","string","number","null"]))throw new ge("Expected first argument to be of type boolean, string, number or null, but found "+te(pe(e))+" instead.");if(!ie(r,["string","array"]))throw new ge("Expected second argument to be of type array or string, but found "+te(pe(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},kr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},kr.prototype.outputDefined=function(){return!1},kr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ar=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Ar.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,pe(f)))return null}else r=pe(f);if(void 0!==i[String(f)])return c.error("Branch labels must be unique.");i[String(f)]=a.length}var p=e.parse(l,o,n);if(!p)return null;n=n||p.type,a.push(p)}var d=e.parse(t[1],1,Xt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Ar(r,n,d,i,a,m):null},Ar.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(pe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ar.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ar.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Ar.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Xt),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!ne(r.type,[Qt(Xt),Gt,Xt]))return e.error("Expected first argument to be of type array or string, but found "+te(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ht);return i?new Sr(r.type,r,n,i):null}return new Sr(r.type,r,n)},Sr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ie(e,["string","array"]))throw new ge("Expected first argument to be of type array or string, but found "+te(pe(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Sr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Lr=Ir("==",(function(t,e,r){return e===r}),Cr),Pr=Ir("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Cr(0,e,r,n)})),zr=Ir("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Or=Ir("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Rr=Ir(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Fr=function(t,e,r,n,i){this.type=Gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Fr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ht);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Gt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Gt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Ht)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ht))?null:new Fr(r,i,a,o,s)},Fr.prototype.evaluate=function(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))},Fr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Fr.prototype.outputDefined=function(){return!1},Fr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var jr=function(t){this.type=Ht,this.input=t};jr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+te(r.type)+" instead."):new jr(r):null},jr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ge("Expected value to be of type string or array, but found "+te(pe(e))+" instead.")},jr.prototype.eachChild=function(t){t(this.input)},jr.prototype.outputDefined=function(){return!1},jr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Br={"==":Lr,"!=":Pr,">":Dr,"<":zr,">=":Rr,"<=":Or,array:ve,at:wr,boolean:ve,case:Mr,coalesce:_r,collator:Me,format:xe,image:_e,in:Tr,"index-of":kr,interpolate:vr,"interpolate-hcl":vr,"interpolate-lab":vr,length:jr,let:br,literal:me,match:Ar,number:ve,"number-format":Fr,object:ve,slice:Sr,step:Je,string:ve,"to-boolean":we,"to-color":we,"to-number":we,"to-string":we,var:We,within:qe};function Nr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=he(r,n,i,o);if(s)throw new ge(s);return new oe(r/255*o,n/255*o,i/255*o,o)}function Ur(t,e){return t in e}function Vr(t,e){var r=e[t];return void 0===r?null:r}function qr(t){return{type:t}}function Hr(t){return{result:"success",value:t}}function Gr(t){return{result:"error",value:t}}function Zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Wr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Yr(t){return!!t.expression&&t.expression.interpolated}function Xr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function $r(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Jr(t){return t}function Kr(t,e){var r,n,i,a="color"===e.type,o=t.stops&&"object"==typeof t.stops[0][0],s=o||void 0!==t.property,l=o||!s,c=t.type||(Yr(e)?"exponential":"interval");if(a&&((t=jt({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],oe.parse(t[1])]}))),t.default?t.default=oe.parse(t.default):t.default=oe.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!yr[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===c)r=rn;else if("interval"===c)r=en;else if("categorical"===c){r=tn,n=Object.create(null);for(var u=0,h=t.stops;u=t.stops[n-1][0])return t.stops[n-1][1];var i=$e(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function rn(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Xr(r))return Qr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=$e(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Qe[e.type]||Jr;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=yr[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function nn(t,e,r){return"color"===e.type?r=oe.parse(r):"formatted"===e.type?r=ce.fromString(r.toString()):"resolvedImage"===e.type?r=ue.fromString(r.toString()):Xr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Qr(r,t.default,e.default)}Ae.register(Br,{error:[{kind:"error"},[Gt],function(t,e){var r=e[0];throw new ge(r.evaluate(t))}],typeof:[Gt,[Xt],function(t,e){return te(pe(e[0].evaluate(t)))}],"to-rgba":[Qt(Ht,4),[Wt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Wt,[Ht,Ht,Ht],Nr],rgba:[Wt,[Ht,Ht,Ht,Ht],Nr],has:{type:Zt,overloads:[[[Gt],function(t,e){return Ur(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return Ur(r.evaluate(t),n.evaluate(t))}]]},get:{type:Xt,overloads:[[[Gt],function(t,e){return Vr(e[0].evaluate(t),t.properties())}],[[Gt,Yt],function(t,e){var r=e[0],n=e[1];return Vr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Xt,[Gt],function(t,e){return Vr(e[0].evaluate(t),t.featureState||{})}],properties:[Yt,[],function(t){return t.properties()}],"geometry-type":[Gt,[],function(t){return t.geometryType()}],id:[Xt,[],function(t){return t.id()}],zoom:[Ht,[],function(t){return t.globals.zoom}],"heatmap-density":[Ht,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ht,[],function(t){return t.globals.lineProgress||0}],accumulated:[Xt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ht,qr(Ht),function(t,e){for(var r=0,n=0,i=e;n":[Zt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Zt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Zt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Zt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Zt,[Gt,Xt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Zt,[Xt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Zt,[Xt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Zt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Zt,[Qt(Gt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Zt,[Qt(Xt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Zt,[Gt,Qt(Xt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Zt,[Gt,Qt(Xt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[qr(Zt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Br}function sn(t,e){var r,n,i=new Ye(Br,[],e?(n={color:Wt,string:Gt,number:Ht,enum:Gt,boolean:Zt,formatted:Jt,resolvedImage:Kt},"array"===(r=e).type?Qt(n[r.value]||Xt,r.length):n[r.type]):void 0),a=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return a?Hr(new an(a,e)):Gr(i.errors)}an.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},an.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ge("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ln=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ge(e.expression)};ln.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},ln.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var cn=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ge(e.expression),this.interpolationType=n};function un(t,e){if("error"===(t=sn(t,e)).result)return t;var r=t.value.expression,n=He(r);if(!n&&!Zr(e))return Gr([new Ut("","data expressions not supported")]);var i=Ze(r,["zoom"]);if(!i&&!Wr(e))return Gr([new Ut("","zoom expressions not supported")]);var a=fn(r);if(!a&&!i)return Gr([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ut)return Gr([a]);if(a instanceof vr&&!Yr(e))return Gr([new Ut("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Hr(new ln(n?"constant":"source",t.value));var o=a instanceof vr?a.interpolation:void 0;return Hr(new cn(n?"camera":"composite",t.value,a.labels,o))}cn.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},cn.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},cn.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?vr.interpolationFactor(this.interpolationType,t,e,r):0};var hn=function(t,e){this._parameters=t,this._specification=e,jt(this,Kr(this._parameters,this._specification))};function fn(t){var e=null;if(t instanceof br)e=fn(t.result);else if(t instanceof _r)for(var r=0,n=t.args;rn.maximum?[new Rt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function gn(t){var e,r,n,i=t.valueSpec,a=Bt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,c="array"===Xr(t.value.stops)&&"array"===Xr(t.value.stops[0])&&"object"===Xr(t.value.stops[0][0]),u=pn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new Rt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(dn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Xr(r)&&0===r.length&&e.push(new Rt(t.key,r,"array must have at least one stop")),e},default:function(t){return Nn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&u.push(new Rt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||u.push(new Rt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Yr(t.valueSpec)&&u.push(new Rt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Zr(t.valueSpec)?u.push(new Rt(t.key,t.value,"property functions not supported")):s&&!Wr(t.valueSpec)&&u.push(new Rt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==t.value.property||u.push(new Rt(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],a=t.value,s=t.key;if("array"!==Xr(a))return[new Rt(s,a,"array expected, "+Xr(a)+" found")];if(2!==a.length)return[new Rt(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Xr(a[0]))return[new Rt(s,a,"object expected, "+Xr(a[0])+" found")];if(void 0===a[0].zoom)return[new Rt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Rt(s,a,"object stop key must have value")];if(n&&n>Bt(a[0].zoom))return[new Rt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Bt(a[0].zoom)!==n&&(n=Bt(a[0].zoom),r=void 0,o={}),e=e.concat(pn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:mn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return on(Nt(a[1]))?e.concat([new Rt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Nn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,n){var s=Xr(t.value),l=Bt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Rt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Rt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Zr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Rt(t.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function Tn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===r||"<="===r||">="===r?An(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(kn))):"all"===r?["all"].concat(t.slice(1).map(kn)):"none"===r?["all"].concat(t.slice(1).map(kn).map(En)):"in"===r?Mn(t[1],t.slice(2)):"!in"===r?En(Mn(t[1],t.slice(2))):"has"===r?Sn(t[1]):"!has"===r?En(Sn(t[1])):"within"!==r||t}function An(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Mn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(wn)]]:["filter-in-small",t,["literal",e]]}}function Sn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function En(t){return["!",t]}function Cn(t){return xn(Nt(t.value))?yn(jt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):In(t)}function In(t){var e=t.value,r=t.key;if("array"!==Xr(e))return[new Rt(r,e,"array expected, "+Xr(e)+" found")];var n,i=t.styleSpec,a=[];if(e.length<1)return[new Rt(r,e,"filter array must have at least 1 element")];switch(a=a.concat(vn({key:r+"[0]",value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Bt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Bt(e[1])&&a.push(new Rt(r,e,'"$type" cannot be use with operator "'+e[0]+'"'));case"==":case"!=":3!==e.length&&a.push(new Rt(r,e,'filter array for operator "'+e[0]+'" must have 3 elements'));case"in":case"!in":e.length>=2&&"string"!==(n=Xr(e[1]))&&a.push(new Rt(r+"[1]",e[1],"string expected, "+n+" found"));for(var o=2;o=u[p+0]&&n>=u[p+1])?(o[f]=!0,a.push(c[f])):o[f]=!1}}},Kn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),f=l;f<=u;f++)for(var p=c;p<=h;p++){var d=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},Kn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Kn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Kn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Jn+this.cells.length+1+1,r=0,n=0;n=0)){var h=t[u];c[u]=ei[l].shallow.indexOf(u)>=0?h:oi(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof t)}function si(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||ii(t)||ai(t)||ArrayBuffer.isView(t)||t instanceof Qn)return t;if(Array.isArray(t))return t.map(si);if("object"==typeof t){var e=t.$name||"Object",r=ei[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i=0?s:si(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var li=function(){this.first=!0};li.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function ui(t){for(var e=0,r=t;e=65097&&t<=65103)||ci["CJK Compatibility Ideographs"](t)||ci["CJK Compatibility"](t)||ci["CJK Radicals Supplement"](t)||ci["CJK Strokes"](t)||!(!ci["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||ci["CJK Unified Ideographs Extension A"](t)||ci["CJK Unified Ideographs"](t)||ci["Enclosed CJK Letters and Months"](t)||ci["Hangul Compatibility Jamo"](t)||ci["Hangul Jamo Extended-A"](t)||ci["Hangul Jamo Extended-B"](t)||ci["Hangul Jamo"](t)||ci["Hangul Syllables"](t)||ci.Hiragana(t)||ci["Ideographic Description Characters"](t)||ci.Kanbun(t)||ci["Kangxi Radicals"](t)||ci["Katakana Phonetic Extensions"](t)||ci.Katakana(t)&&12540!==t||!(!ci["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!ci["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ci["Unified Canadian Aboriginal Syllabics"](t)||ci["Unified Canadian Aboriginal Syllabics Extended"](t)||ci["Vertical Forms"](t)||ci["Yijing Hexagram Symbols"](t)||ci["Yi Syllables"](t)||ci["Yi Radicals"](t))))}function pi(t){return!(fi(t)||function(t){return!!(ci["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||ci["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||ci["Letterlike Symbols"](t)||ci["Number Forms"](t)||ci["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||ci["Control Pictures"](t)&&9251!==t||ci["Optical Character Recognition"](t)||ci["Enclosed Alphanumerics"](t)||ci["Geometric Shapes"](t)||ci["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||ci["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||ci["CJK Symbols and Punctuation"](t)||ci.Katakana(t)||ci["Private Use Area"](t)||ci["CJK Compatibility Forms"](t)||ci["Small Form Variants"](t)||ci["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function di(t){return ci.Arabic(t)||ci["Arabic Supplement"](t)||ci["Arabic Extended-A"](t)||ci["Arabic Presentation Forms-A"](t)||ci["Arabic Presentation Forms-B"](t)}function mi(t){return t>=1424&&t<=2303||ci["Arabic Presentation Forms-A"](t)||ci["Arabic Presentation Forms-B"](t)}function gi(t,e){return!(!e&&mi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||ci.Khmer(t))}function yi(t){for(var e=0,r=t;e-1&&(Ti=bi),wi&&wi(t)};function Mi(){Si.fire(new Pt("pluginStateChange",{pluginStatus:Ti,pluginURL:ki}))}var Si=new Dt,Ei=function(){return Ti},Ci=function(){if(Ti!==vi||!ki)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ti=xi,Mi(),ki&&Mt({url:ki},(function(t){t?Ai(t):(Ti=_i,Mi())}))},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ti===_i||null!=Ii.applyArabicShaping},isLoading:function(){return Ti===xi},setState:function(t){Ti=t.pluginStatus,ki=t.pluginURL},isParsed:function(){return null!=Ii.applyArabicShaping&&null!=Ii.processBidirectionalText&&null!=Ii.processStyledBidirectionalText},getPluginURL:function(){return ki}},Li=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new li,this.transition={})};Li.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Pi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if($r(t))return new hn(t,e);if(on(t)){var r=un(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=oe.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Pi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Pi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var zi=function(t){this.property=t,this.value=new Pi(t,void 0)};zi.prototype.transitioned=function(t,e){return new Oi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},zi.prototype.untransitioned=function(){return new Oi(this.property,this.value,null,{},0)};var Di=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Di.prototype.getValue=function(t){return w(this._values[t].value.value)},Di.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new zi(this._values[t].property)),this._values[t].value=new Pi(this._values[t].property,null===e?void 0:w(e))},Di.prototype.getTransition=function(t){return w(this._values[t].transition)},Di.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new zi(this._values[t].property)),this._values[t].transition=w(e)||void 0},Di.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var Ri=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Ri.prototype.possiblyEvaluate=function(t,e,r){for(var n=new Bi(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Ui),qi=function(t){this.specification=t};qi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Li(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Li(Math.floor(e.zoom),e)),t.expression.evaluate(new Li(Math.floor(e.zoom+1),e)),e)}},qi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},qi.prototype.interpolate=function(t){return t};var Hi=function(t){this.specification=t};Hi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Hi.prototype.interpolate=function(){return!1};var Gi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Pi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new zi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ri("DataDrivenProperty",Ui),ri("DataConstantProperty",Ni),ri("CrossFadedDataDrivenProperty",Vi),ri("CrossFadedProperty",qi),ri("ColorRampProperty",Hi);var Zi="-transition",Wi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Di(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Bi(r.paint)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(Yn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return x(t,Zi)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(Wn,n,t,e,r))return!1}if(x(t,Zi))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var 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),b(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Xn(this,t.call(Gn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Ot,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof ji&&Zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Dt),Yi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xi=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},$i=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ji(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,a=(i=t.type,Yi[i].BYTES_PER_ELEMENT),o=r=Ki(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Ki(r,Math.max(n,e)),alignment:e}}function Ki(t,e){return Math.ceil(t/e)*e}$i.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},$i.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},$i.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},$i.prototype.clear=function(){this.length=0},$i.prototype.resize=function(t){this.reserve(t),this.length=t},$i.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},$i.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}($i);Qi.prototype.bytesPerElement=4,ri("StructArrayLayout2i4",Qi);var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}($i);ta.prototype.bytesPerElement=8,ri("StructArrayLayout4i8",ta);var ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}($i);ea.prototype.bytesPerElement=12,ri("StructArrayLayout2i4i12",ea);var ra=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}($i);ra.prototype.bytesPerElement=8,ri("StructArrayLayout2i4ub8",ra);var na=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}($i);na.prototype.bytesPerElement=8,ri("StructArrayLayout2f8",na);var ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}($i);ia.prototype.bytesPerElement=20,ri("StructArrayLayout10ui20",ia);var aa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t},e}($i);aa.prototype.bytesPerElement=24,ri("StructArrayLayout4i4ui4i24",aa);var oa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}($i);oa.prototype.bytesPerElement=12,ri("StructArrayLayout3f12",oa);var sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}($i);sa.prototype.bytesPerElement=4,ri("StructArrayLayout1ul4",sa);var la=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}($i);la.prototype.bytesPerElement=20,ri("StructArrayLayout6i1ul2ui20",la);var ca=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}($i);ca.prototype.bytesPerElement=12,ri("StructArrayLayout2i2i2i12",ca);var ua=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,a){var o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t},e}($i);ua.prototype.bytesPerElement=16,ri("StructArrayLayout2f1f2i16",ua);var ha=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}($i);ha.prototype.bytesPerElement=12,ri("StructArrayLayout2ub2f12",ha);var fa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}($i);fa.prototype.bytesPerElement=6,ri("StructArrayLayout3ui6",fa);var pa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){var v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t},e}($i);pa.prototype.bytesPerElement=48,ri("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",pa);var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){var E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){var C=34*t,I=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.float32[I+15]=S,this.float32[I+16]=E,t},e}($i);da.prototype.bytesPerElement=68,ri("StructArrayLayout8i15ui1ul4f68",da);var ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}($i);ma.prototype.bytesPerElement=4,ri("StructArrayLayout1f4",ma);var ga=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}($i);ga.prototype.bytesPerElement=6,ri("StructArrayLayout3i6",ga);var ya=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}($i);ya.prototype.bytesPerElement=8,ri("StructArrayLayout1ul2ui8",ya);var va=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}($i);va.prototype.bytesPerElement=4,ri("StructArrayLayout2ui4",va);var xa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}($i);xa.prototype.bytesPerElement=2,ri("StructArrayLayout1ui2",xa);var _a=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}($i);_a.prototype.bytesPerElement=16,ri("StructArrayLayout4f16",_a);var ba=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Xi);ba.prototype.size=20;var wa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ba(this,t)},e}(la);ri("CollisionBoxArray",wa);var Ta=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Xi);Ta.prototype.size=48;var ka=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ta(this,t)},e}(pa);ri("PlacedSymbolArray",ka);var Aa=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Xi);Aa.prototype.size=68;var Ma=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Aa(this,t)},e}(da);ri("SymbolInstanceArray",Ma);var Sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(ma);ri("GlyphOffsetArray",Sa);var Ea=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(ga);ri("SymbolLineVertexArray",Ea);var Ca=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Xi);Ca.prototype.size=8;var Ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ca(this,t)},e}(ya);ri("FeatureIndexArray",Ia);var La=Ji([{name:"a_pos",components:2,type:"Int16"}],4).members,Pa=function(t){void 0===t&&(t=[]),this.segments=t};function za(t,e){return 256*(t=h(Math.floor(t),0,255))+(e=h(Math.floor(e),0,255))}Pa.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Pa.MAX_VERTEX_ARRAY_LENGTH&&k("Max vertices per segment is "+Pa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Pa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Pa.prototype.get=function(){return this.segments},Pa.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Ra=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),Fa=Oa,ja=Oa,Ba=Ra;Fa.murmur3=ja,Fa.murmur2=Ba;var Na=function(){this.ids=[],this.positions=[],this.indexed=!1};Na.prototype.add=function(t,e,r,n){this.ids.push(Va(t)),this.positions.push(e,r,n)},Na.prototype.getPositions=function(t){for(var e=Va(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var a=[];this.ids[r]===e;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Na.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return qa(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},Na.deserialize=function(t){var e=new Na;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var Ua=Math.pow(2,53)-1;function Va(t){var e=+t;return!isNaN(e)&&e<=Ua?e:Fa(String(t))}function qa(t,e,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(t[a]i);if(a>=o)break;Ha(t,a,o),Ha(e,3*a,3*o),Ha(e,3*a+1,3*o+1),Ha(e,3*a+2,3*o+2)}o-ro.x+1||lo.y+1)&&k("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function mo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?po(t):[]}}function go(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var yo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Qi,this.indexArray=new fa,this.segments=new Pa,this.programConfigurations=new so(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function vo(t,e){for(var r=0;r1){if(wo(t,e))return!0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Mo(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function So(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Eo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var a=A(t,e,r[0]);return a!==A(t,e,r[1])||a!==A(t,e,r[2])||a!==A(t,e,r[3])}function Co(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Io(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Lo(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=uo||u<0||u>=uo)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;go(this.layoutVertexArray,c,u,-1,-1),go(this.layoutVertexArray,c,u,1,-1),go(this.layoutVertexArray,c,u,1,1),go(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},ri("CircleBucket",yo,{omit:["layers"]});var Po=new Gi({"circle-sort-key":new Ui(Ot.layout_circle["circle-sort-key"])}),zo={paint:new Gi({"circle-radius":new Ui(Ot.paint_circle["circle-radius"]),"circle-color":new Ui(Ot.paint_circle["circle-color"]),"circle-blur":new Ui(Ot.paint_circle["circle-blur"]),"circle-opacity":new Ui(Ot.paint_circle["circle-opacity"]),"circle-translate":new Ni(Ot.paint_circle["circle-translate"]),"circle-translate-anchor":new Ni(Ot.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ni(Ot.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ni(Ot.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ui(Ot.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ui(Ot.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ui(Ot.paint_circle["circle-stroke-opacity"])}),layout:Po},Do="undefined"!=typeof Float32Array?Float32Array:Array;function Oo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ro(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],m=e[12],g=e[13],y=e[14],v=e[15],x=r[0],_=r[1],b=r[2],w=r[3];return t[0]=x*n+_*s+b*h+w*m,t[1]=x*i+_*l+b*f+w*g,t[2]=x*a+_*c+b*p+w*y,t[3]=x*o+_*u+b*d+w*v,x=r[4],_=r[5],b=r[6],w=r[7],t[4]=x*n+_*s+b*h+w*m,t[5]=x*i+_*l+b*f+w*g,t[6]=x*a+_*c+b*p+w*y,t[7]=x*o+_*u+b*d+w*v,x=r[8],_=r[9],b=r[10],w=r[11],t[8]=x*n+_*s+b*h+w*m,t[9]=x*i+_*l+b*f+w*g,t[10]=x*a+_*c+b*p+w*y,t[11]=x*o+_*u+b*d+w*v,x=r[12],_=r[13],b=r[14],w=r[15],t[12]=x*n+_*s+b*h+w*m,t[13]=x*i+_*l+b*f+w*g,t[14]=x*a+_*c+b*p+w*y,t[15]=x*o+_*u+b*d+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var Fo,jo=Ro,Bo=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};function No(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Fo=new Do(3),Do!=Float32Array&&(Fo[0]=0,Fo[1]=0,Fo[2]=0),function(){var t=new Do(4);Do!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Uo=function(t){var e=t[0],r=t[1];return e*e+r*r},Vo=(function(){var t=new Do(2);Do!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,zo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new yo(t)},e.prototype.queryRadius=function(t){var e=t;return Co("circle-radius",this,e)+Co("circle-stroke-width",this,e)+Io(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=Lo(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return qo(t,e)}))}(l,s),f=u?c*o:c,p=0,d=n;pt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l80*r){n=a=t[0],i=o=t[1];for(var d=r;da&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ss(f,p,r,n,i,c),p}function as(t,e,r,n,i){var a,o;if(i===Cs(t,e,r,n)>0)for(a=e;a=e;a-=n)o=Ms(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function os(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==xs(n.prev,n,n.next))n=n.next;else{if(Ss(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ss(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ms(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?cs(t,n,i,a):ls(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ss(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?ss(t=us(os(t),e,r),e,r,n,i,a,2):2===o&&hs(t,e,r,n,i,a):ss(os(t),e,r,n,i,a,1);break}}}function ls(t){var e=t.prev,r=t,n=t.next;if(xs(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ys(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cs(t,e,r,n){var i=t.prev,a=t,o=t.next;if(xs(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=ms(s,l,e,r,n),f=ms(c,u,e,r,n),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&xs(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&ys(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&xs(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function us(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!_s(i,a)&&bs(i,n,n.next,a)&&ks(i,a)&&ks(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ss(n),Ss(n.next),n=t=a),n=n.next}while(n!==t);return os(n)}function hs(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&vs(o,s)){var l=As(o,s);return o=os(o,o.next),l=os(l,l.next),ss(o,e,r,n,i,a),void ss(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function fs(t,e){return t.x-e.x}function ps(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&ys(ar.x||n.x===r.x&&ds(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e),e){var r=As(e,t);os(e,e.next),os(r,r.next)}}function ds(t,e){return xs(t.prev,t,e.prev)<0&&xs(e.next,t,t.next)<0}function ms(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function gs(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function vs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&bs(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ks(t,e)&&ks(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(xs(t.prev,t,e.prev)||xs(t,e.prev,e))||_s(t,e)&&xs(t.prev,t,t.next)>0&&xs(e.prev,e,e.next)>0)}function xs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function bs(t,e,r,n){var i=Ts(xs(t,e,r)),a=Ts(xs(t,e,n)),o=Ts(xs(r,n,t)),s=Ts(xs(r,n,e));return i!==a&&o!==s||!(0!==i||!ws(t,r,e))||!(0!==a||!ws(t,n,e))||!(0!==o||!ws(r,t,n))||!(0!==s||!ws(r,e,n))}function ws(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ts(t){return t>0?1:t<0?-1:0}function ks(t,e){return xs(t.prev,t,t.next)<0?xs(t,e,t.next)>=0&&xs(t,t.prev,e)>=0:xs(t,e,t.prev)<0||xs(t,t.next,e)<0}function As(t,e){var r=new Es(t.i,t.x,t.y),n=new Es(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(t,e,r,n){var i=new Es(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ss(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Es(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cs(t,e,r,n){for(var i=0,a=e,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ls(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,f=n;for(Ps(t,r,e),i(t[n],u)>0&&Ps(t,r,n);h0;)f--}0===i(t[r],u)?Ps(t,r,f):Ps(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function Ps(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function zs(t,e){return te?1:0}function Ds(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=t[i-1].length,r.holes.push(n))}return r},rs.default=ns;var js=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Qi,this.indexArray=new fa,this.indexArray2=new va,this.programConfigurations=new so(t.layers,t.zoom),this.segments=new Pa,this.segments2=new Pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};js.prototype.populate=function(t,e,r){this.hasPattern=Rs("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},Hs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Hs.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Hs.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function $s(t,e,r){if(3===t){var n=new Ws(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Ys.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new qs(this._pbf,e,this.extent,this._keys,this._values)};var Js={VectorTile:function(t,e){this.layers=t.readFields($s,{},e)},VectorTileFeature:qs,VectorTileLayer:Ws},Ks=Js.VectorTileFeature.types,Qs=Math.pow(2,13);function tl(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Qs)+o,i*Qs*2,a*Qs*2,Math.round(s))}var el=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ea,this.indexArray=new fa,this.programConfigurations=new so(t.layers,t.zoom),this.segments=new Pa,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function rl(t,e){return t.x===e.x&&(t.x<0||t.x>uo)||t.y===e.y&&(t.y<0||t.y>uo)}function nl(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>uo}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>uo}))}el.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Rs("fill-extrusion",this.layers,e);for(var n=0,i=t;n=1){var v=d[g-1];if(!rl(y,v)){h.vertexLength+4>Pa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),_=v.dist(y);m+_>32768&&(m=0),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=_,tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Pa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Ks[t.type]){for(var w=[],T=[],k=h.vertexLength,A=0,M=s;A=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c0;if(T&&y>c){var A=u.dist(p);if(A>2*h){var M=u.sub(u.sub(p)._mult(h/A)._round());this.updateDistance(p,M),this.addCurrentVertex(M,m,0,0,f),p=M}}var S=p&&d,E=S?r:s?"butt":n;if(S&&"round"===E&&(bi&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b100)v=g.mult(-1);else{var C=b*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(k?-1:1))}this.addCurrentVertex(u,v,0,0,f),this.addCurrentVertex(u,v.mult(-1),0,0,f)}else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(b*b-1),L=k?I:0,P=k?0:I;if(p&&this.addCurrentVertex(u,m,L,P,f),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),D=1;D2*h){var N=u.add(d.sub(u)._mult(h/B)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,f),u=N}}}}},pl.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,c=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,c,a,!0,-n,i),this.distance>fl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},pl.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,c=.5*(this.lineClips?this.scaledDistance*(fl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},pl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},pl.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},ri("LineBucket",pl,{omit:["layers","patternFeatures"]});var dl=new Gi({"line-cap":new Ni(Ot.layout_line["line-cap"]),"line-join":new Ui(Ot.layout_line["line-join"]),"line-miter-limit":new Ni(Ot.layout_line["line-miter-limit"]),"line-round-limit":new Ni(Ot.layout_line["line-round-limit"]),"line-sort-key":new Ui(Ot.layout_line["line-sort-key"])}),ml={paint:new Gi({"line-opacity":new Ui(Ot.paint_line["line-opacity"]),"line-color":new Ui(Ot.paint_line["line-color"]),"line-translate":new Ni(Ot.paint_line["line-translate"]),"line-translate-anchor":new Ni(Ot.paint_line["line-translate-anchor"]),"line-width":new Ui(Ot.paint_line["line-width"]),"line-gap-width":new Ui(Ot.paint_line["line-gap-width"]),"line-offset":new Ui(Ot.paint_line["line-offset"]),"line-blur":new Ui(Ot.paint_line["line-blur"]),"line-dasharray":new qi(Ot.paint_line["line-dasharray"]),"line-pattern":new Vi(Ot.paint_line["line-pattern"]),"line-gradient":new Hi(Ot.paint_line["line-gradient"])}),layout:dl},gl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Li(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Ui),yl=new gl(ml.paint.properties["line-width"].specification);yl.useIntegerZoom=!0;var vl=function(t){function e(e){t.call(this,e,ml),this.gradientVersion=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){if("line-gradient"===t){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof Je,this.gradientVersion=(this.gradientVersion+1)%l}},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=yl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new pl(t)},e.prototype.queryRadius=function(t){var e=t,r=xl(Co("line-width",this,e),Co("line-gap-width",this,e)),n=Co("line-offset",this,e);return r/2+Math.abs(n)+Io(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var l=Lo(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*xl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i=3)for(var a=0;a0?e+2*t:t}var _l=Ji([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bl=Ji([{name:"a_projected_pos",components:3,type:"Float32"}],4),wl=(Ji([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ji([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Ji([{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"}]),Ji([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),kl=Ji([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Al(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Ii.applyArabicShaping&&(t=Ii.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ji([{name:"triangle",components:3,type:"Uint16"}]),Ji([{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"}]),Ji([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ji([{type:"Float32",name:"offsetX"}]),Ji([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Sl=24,El=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Cl=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m},Il=Ll;function Ll(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ll.Varint=0,Ll.Fixed64=1,Ll.Bytes=2,Ll.Fixed32=5;var Pl=4294967296,zl=1/Pl,Dl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ol(t){return t.type===Ll.Bytes?t.readVarint()+t.pos:t.pos+1}function Rl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Fl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function jl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Xl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function $l(t,e,r){1===t&&r.readMessage(Jl,e)}function Jl(t,e,r){if(3===t){var n=r.readMessage(Kl,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;e.push({id:i,bitmap:new Yo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Kl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function Ql(t){for(var e=0,r=0,n=0,i=t;n=0;f--){var p=o[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=o.pop();f>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Wl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Xl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Wl(this.buf,this.pos)+Wl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readSFixed64:function(){var t=Wl(this.buf,this.pos)+Xl(this.buf,this.pos+4)*Pl;return this.pos+=8,t},readFloat:function(){var t=El(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=El(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return Rl(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return Rl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Dl?function(t,e,r){return Dl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ll.Bytes)return t.push(this.readVarint(e));var r=Ol(this);for(t=t||[];this.pos127;);else if(e===Ll.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ll.Fixed32)this.pos+=4;else{if(e!==Ll.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Fl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Cl(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cl(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Fl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ll.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,jl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Vl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zl,e)},writeBytesField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ll.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ll.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ll.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ll.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var tc=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},ec={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ec.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ec.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ec.tlbr.get=function(){return this.tl.concat(this.br)},ec.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(tc.prototype,ec);var rc=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=Ql(i),o=a.w,s=a.h,l=new Xo({width:o||1,height:s||1});for(var c in t){var u=t[c],h=r[c].paddedRect;Xo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var f in e){var p=e[f],d=n[f].paddedRect,m=d.x+1,g=d.y+1,y=p.data.width,v=p.data.height;Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g},p.data),Xo.copy(p.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Xo.copy(p.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Xo.copy(p.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Xo.copy(p.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};rc.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new tc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},rc.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},rc.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],a=n[1];r.update(e.data,void 0,{x:i,y:a})}},ri("ImagePosition",tc),ri("ImageAtlas",rc);var nc={horizontal:1,vertical:2,horizontalOnly:3},ic=-17,ac=function(){this.scale=1,this.fontStack="",this.imageName=null};ac.forText=function(t,e){var r=new ac;return r.scale=t||1,r.fontStack=e,r},ac.forImage=function(t){var e=new ac;return e.imageName=t,e};var oc=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function sc(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g,y=oc.fromFeature(t,i);h===nc.vertical&&y.verticalizePunctuation();var v=Ii.processBidirectionalText,x=Ii.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var _=0,b=v(y.toString(),mc(y,c,a,e,n,p,d));_0&&j>A&&(A=j)}else{var B=r[S.fontStack],N=B&&B[C];if(N&&N.rect)P=N.rect,L=N.metrics;else{var U=e[S.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}I=(b-S.scale)*Sl}O?(t.verticalizable=!0,k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=D*S.scale+c):(k.push({glyph:C,imageName:z,x:f,y:p+I,vertical:O,scale:S.scale,fontStack:S.fontStack,sectionIndex:E,metrics:L,rect:P}),f+=L.advance*S.scale+c)}if(0!==k.length){var q=f-c;d=Math.max(q,d),yc(k,0,k.length-1,g,A)}f=0;var H=a*b+A;T.lineOffset=Math.max(A,w),p+=H,m=Math.max(H,m),++y}else p+=a,++y}var G=p-ic,Z=gc(o),W=Z.horizontalAlign,Y=Z.verticalAlign;(function(t,e,r,n,i,a,o,s,l){var c=(e-r)*i,u=0;u=a!==o?-s*n-ic:(-n*l+.5)*o;for(var h=0,f=t;h=0&&n>=t&&lc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},oc.prototype.substring=function(t,e){var r=new oc;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},oc.prototype.toString=function(){return this.text},oc.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},oc.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(ac.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var lc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},cc={};function uc(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*Sl/a+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function hc(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,f=0;f-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}function Mc(t){for(var e=0,r=0;rc){var d=(c-l)/p,m=Ke(h.x,f.x,d),g=Ke(h.y,f.y,d),y=new xc(m,g,f.angleTo(h),u);return y._round(),!o||Ac(t,y,s,o,e)?y:void 0}l+=p}}function Ic(t,e,r,n,i,a,o,s,l){var c=Sc(n,a,o),u=Ec(n,i),h=u*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&_=0&&b=0&&f+c<=u){var w=new xc(_,b,v,d);w._round(),n&&!Ac(t,w,a,n,i)||p.push(w)}}h+=y}return s||p.length||o||(p=Lc(t,h/2,r,n,i,a,o,!0,l)),p}function Pc(t,e,r,n,i){for(var o=[],s=0;s=n&&f.x>=n||(h.x>=n?h=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new a(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=i&&f.y>=i||(h.y>=i?h=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round():f.y>=i&&(f=new a(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(f)))))}return o}function zc(t,e,r,n){var i=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,f=o.stretchX||[[0,l]],p=o.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},m=f.reduce(d,0),g=p.reduce(d,0),y=l-m,v=c-g,x=0,_=m,b=0,w=g,T=0,k=y,A=0,M=v;if(o.content&&n){var S=o.content;x=Dc(f,0,S[0]),b=Dc(p,0,S[1]),_=Dc(f,S[0],S[2]),w=Dc(p,S[1],S[3]),T=S[0]-x,A=S[1]-b,k=S[2]-S[0]-_,M=S[3]-S[1]-w}var E=function(n,i,l,c){var f=Rc(n.stretch-x,_,u,t.left),p=Fc(n.fixed-T,k,n.stretch,m),d=Rc(i.stretch-b,w,h,t.top),y=Fc(i.fixed-A,M,i.stretch,g),v=Rc(l.stretch-x,_,u,t.left),S=Fc(l.fixed-T,k,l.stretch,m),E=Rc(c.stretch-b,w,h,t.top),C=Fc(c.fixed-A,M,c.stretch,g),I=new a(f,d),L=new a(v,d),P=new a(v,E),z=new a(f,E),D=new a(p/s,y/s),O=new a(S/s,C/s),R=e*Math.PI/180;if(R){var F=Math.sin(R),j=Math.cos(R),B=[j,-F,F,j];I._matMult(B),L._matMult(B),z._matMult(B),P._matMult(B)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:I,tr:L,bl:z,br:P,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:k/s/u,minFontScaleY:M/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Oc(f,y,m),I=Oc(p,v,g),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var _=new a(y,m),b=new a(v,m),w=new a(y,g),T=new a(v,g),k=u*Math.PI/180;_._rotate(k),b._rotate(k),w._rotate(k),T._rotate(k),y=Math.min(_.x,b.x,w.x,T.x),v=Math.max(_.x,b.x,w.x,T.x),m=Math.min(_.y,b.y,w.y,T.y),g=Math.max(_.y,b.y,w.y,T.y)}t.emplaceBack(e.x,e.y,y,m,v,g,r,n,i)}this.boxEndIndex=t.length},Bc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Nc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Nc(t,e){return te?1:0}function Uc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=t[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,f=s-i,p=Math.min(h,f),d=p/2,m=new Bc([],Vc);if(0===p)return new a(n,i);for(var g=n;gv.d||!v.d)&&(v=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,x)),_.max-v.d<=e||(d=_.h/2,m.push(new qc(_.p.x-d,_.p.y-d,d,t)),m.push(new qc(_.p.x+d,_.p.y-d,d,t)),m.push(new qc(_.p.x-d,_.p.y+d,d,t)),m.push(new qc(_.p.x+d,_.p.y+d,d,t)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function Vc(t,e){return e.max-t.max}function qc(t,e,r,n){this.p=new a(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Ao(t,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Bc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Bc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Bc.prototype.peek=function(){return this.data[0]},Bc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},Bc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a}e[t]=i};var Hc=Number.POSITIVE_INFINITY;function Gc(t,e){return e[1]!==Hc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Zc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Wc=255,Yc=Wc*_c;function Xc(t,e,r,n,i,o,s,l,c,u,h,f,p,d,m){var g=function(t,e,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,f=e.positionedLines;hYc&&k(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[_c*d.compositeTextSizes[0].evaluate(s,{},m),_c*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>Yc||v[1]>Yc)&&k(t.layerIds[0]+': Value for "text-size" is >= '+Wc+'. Reduce your "text-size".'),t.addSymbols(t.text,g,v,l,o,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(var x=0,_=h;x<_.length;x+=1)f[_[x]]=t.text.placedSymbolArray.length-1;return 4*g.length}function $c(t){for(var e in t)return t[e];return null}function Jc(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new Li(this.zoom),m=0,g=t;m=0;for(var z=0,D=k.sections;z=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l0},au.prototype.hasIconData=function(){return this.icon.segments.get().length>0},au.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},au.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},au.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},au.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||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(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),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)}},ri("SymbolBucket",au,{omit:["layers","collisionBoxArray","features","compareText"]}),au.MAX_GLYPHS=65535,au.addDynamicAttributes=eu;var ou=new Gi({"symbol-placement":new Ni(Ot.layout_symbol["symbol-placement"]),"symbol-spacing":new Ni(Ot.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ni(Ot.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ui(Ot.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ni(Ot.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ni(Ot.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ni(Ot.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ni(Ot.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ni(Ot.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ui(Ot.layout_symbol["icon-size"]),"icon-text-fit":new Ni(Ot.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ni(Ot.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ui(Ot.layout_symbol["icon-image"]),"icon-rotate":new Ui(Ot.layout_symbol["icon-rotate"]),"icon-padding":new Ni(Ot.layout_symbol["icon-padding"]),"icon-keep-upright":new Ni(Ot.layout_symbol["icon-keep-upright"]),"icon-offset":new Ui(Ot.layout_symbol["icon-offset"]),"icon-anchor":new Ui(Ot.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ni(Ot.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ni(Ot.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ni(Ot.layout_symbol["text-rotation-alignment"]),"text-field":new Ui(Ot.layout_symbol["text-field"]),"text-font":new Ui(Ot.layout_symbol["text-font"]),"text-size":new Ui(Ot.layout_symbol["text-size"]),"text-max-width":new Ui(Ot.layout_symbol["text-max-width"]),"text-line-height":new Ni(Ot.layout_symbol["text-line-height"]),"text-letter-spacing":new Ui(Ot.layout_symbol["text-letter-spacing"]),"text-justify":new Ui(Ot.layout_symbol["text-justify"]),"text-radial-offset":new Ui(Ot.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ni(Ot.layout_symbol["text-variable-anchor"]),"text-anchor":new Ui(Ot.layout_symbol["text-anchor"]),"text-max-angle":new Ni(Ot.layout_symbol["text-max-angle"]),"text-writing-mode":new Ni(Ot.layout_symbol["text-writing-mode"]),"text-rotate":new Ui(Ot.layout_symbol["text-rotate"]),"text-padding":new Ni(Ot.layout_symbol["text-padding"]),"text-keep-upright":new Ni(Ot.layout_symbol["text-keep-upright"]),"text-transform":new Ui(Ot.layout_symbol["text-transform"]),"text-offset":new Ui(Ot.layout_symbol["text-offset"]),"text-allow-overlap":new Ni(Ot.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ni(Ot.layout_symbol["text-ignore-placement"]),"text-optional":new Ni(Ot.layout_symbol["text-optional"])}),su={paint:new Gi({"icon-opacity":new Ui(Ot.paint_symbol["icon-opacity"]),"icon-color":new Ui(Ot.paint_symbol["icon-color"]),"icon-halo-color":new Ui(Ot.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ui(Ot.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ui(Ot.paint_symbol["icon-halo-blur"]),"icon-translate":new Ni(Ot.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ni(Ot.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ui(Ot.paint_symbol["text-opacity"]),"text-color":new Ui(Ot.paint_symbol["text-color"],{runtimeType:Wt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ui(Ot.paint_symbol["text-halo-color"]),"text-halo-width":new Ui(Ot.paint_symbol["text-halo-width"]),"text-halo-blur":new Ui(Ot.paint_symbol["text-halo-blur"]),"text-translate":new Ni(Ot.paint_symbol["text-translate"]),"text-translate-anchor":new Ni(Ot.paint_symbol["text-translate-anchor"])}),layout:ou},lu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t};lu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},lu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},lu.prototype.outputDefined=function(){return!1},lu.prototype.serialize=function(){return null},ri("FormatSectionOverride",lu,{omit:["defaultValue"]});var cu=function(t){function e(e){t.call(this,e,su)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else S()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Tu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Tu.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(si(e.error)):n(null,si(e.data)))}else{var i=!1,a=I(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?oi(e):null,data:oi(n,a)},a)}:function(t){i=!0},s=null,l=si(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Au.prototype.setNorthEast=function(t){return this._ne=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},Au.prototype.setSouthWest=function(t){return this._sw=t instanceof Su?new Su(t.lng,t.lat):Su.convert(t),this},Au.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Su)e=t,r=t;else{if(!(t instanceof Au)){if(Array.isArray(t)){if(4===t.length||t.every(Array.isArray)){var a=t;return this.extend(Au.convert(a))}var o=t;return this.extend(Su.convert(o))}return this}if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Su(e.lng,e.lat),this._ne=new Su(r.lng,r.lat)),this},Au.prototype.getCenter=function(){return new Su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Au.prototype.getSouthWest=function(){return this._sw},Au.prototype.getNorthEast=function(){return this._ne},Au.prototype.getNorthWest=function(){return new Su(this.getWest(),this.getNorth())},Au.prototype.getSouthEast=function(){return new Su(this.getEast(),this.getSouth())},Au.prototype.getWest=function(){return this._sw.lng},Au.prototype.getSouth=function(){return this._sw.lat},Au.prototype.getEast=function(){return this._ne.lng},Au.prototype.getNorth=function(){return this._ne.lat},Au.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Au.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Au.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Au.prototype.contains=function(t){var e=Su.convert(t),r=e.lng,n=e.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Au.convert=function(t){return!t||t instanceof Au?t:new Au(t)};var Mu=6371008.8,Su=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Su.prototype.wrap=function(){return new Su(f(this.lng,-180,180),this.lat)},Su.prototype.toArray=function(){return[this.lng,this.lat]},Su.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Su.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Mu*Math.acos(Math.min(i,1))},Su.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Au(new Su(this.lng-r,this.lat-e),new Su(this.lng+r,this.lat+e))},Su.convert=function(t){if(t instanceof Su)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Su(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Su(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 [, ]")};var Eu=2*Math.PI*Mu;function Cu(t){return Eu*Math.cos(t*Math.PI/180)}function Iu(t){return(180+t)/360}function Lu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pu(t,e){return t/Cu(e)}function zu(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Du=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Du.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Su.convert(t);return new Du(Iu(r.lng),Lu(r.lat),Pu(e,r.lat))},Du.prototype.toLngLat=function(){return new Su(360*this.x-180,zu(this.y))},Du.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Cu(zu(e));var t,e},Du.prototype.meterInMercatorCoordinateUnits=function(){return 1/Eu*(t=zu(this.y),1/Math.cos(t*Math.PI/180));var t};var Ou=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ju(0,t,t,e,r)};Ou.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Ou.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=ku(256*r,256*(n=Math.pow(2,i)-n-1),i),o=ku(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Fu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Fu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?ju(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ju(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Fu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Fu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Fu(e,this.wrap,e,r,n),new Fu(e,this.wrap,e,r+1,n),new Fu(e,this.wrap,e,r,n+1),new Fu(e,this.wrap,e,r+1,n+1)]},Fu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Bu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bu.prototype.getPixels=function(){return new Xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Hu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Js.VectorTile(new Il(this.rawTileData)).layers,this.sourceLayerCoder=new Nu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hu.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var o=t.params||{},s=uo/t.tileSize/t.scale,l=bn(o.filter),c=t.queryGeometry,u=t.queryPadding*s,h=Zu(c),f=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=Zu(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,r,n,i){return function(t,e,r,n,i){for(var o=0,s=t;o=l.x&&i>=l.y)return!0}var c=[new a(e,r),new a(e,i),new a(n,i),new a(n,r)];if(t.length>2)for(var u=0,h=c;u=0)return!0;return!1}(a,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var m=mo(d,!0);if(!i.filter(new Li(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new Li(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,f),y=0;yn)i=!1;else if(e)if(this.expirationTimeht&&(t.getActor().send("enforceCacheSizeLimit",ut),yt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete(ct);t&&e.catch(t).then((function(){return t()}))},t.clipLine=Pc,t.clone=function(t){var e=new Do(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=w,t.clone$2=function(t){var e=new Do(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=kl,t.config=N,t.create=function(){var t=new Do(16);return Do!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Do(9);return Do!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new Do(4);return Do!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=sn,t.createLayout=Ji,t.createStyleLayer=function(t){return"custom"===t.type?new du(t):new mu[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=Ke,t.offscreenCanvasSupported=vt,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Il(t).readFields($l,[])},t.pbf=Il,t.performSymbolLayout=function(t,e,r,n,i,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=uo/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new Li(f),o),c["text-size"].possiblyEvaluate(new Li(p),o)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,g=d.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new Li(m),o),c["icon-size"].possiblyEvaluate(new Li(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new Li(t.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new Li(t.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new Li(18));for(var y=l.get("text-line-height")*Sl,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),_=l.get("text-size"),b=function(){var a=T[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=_.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),f=u.layoutIconSize.evaluate(a,{},o),p={horizontal:{},vertical:void 0},d=a.text,m=[0,0];if(d){var g=d.toString(),b=l.get("text-letter-spacing").evaluate(a,{},o)*Sl,A=function(t){for(var e=0,r=t;e=uo||h.y<0||h.y>=uo||function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,A){var M,S,E,C,I,L=t.addToLineVertexArray(e,r),P=0,z=0,D=0,O=0,R=-1,F=-1,j={},B=Fa(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(M=s.layout.get("text-offset").evaluate(_,{},T).map((function(t){return t*Sl})))[0],U=M[1]):(N=s.layout.get("text-radial-offset").evaluate(_,{},T)*Sl,U=Hc),t.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(_,{},T)+90,q=n.vertical;C=new jc(l,e,c,u,h,q,f,p,d,V),o&&(I=new jc(l,e,c,u,h,o,g,y,d,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),G="none"!==s.layout.get("icon-text-fit"),Z=zc(i,H,w,G),W=o?zc(o,H,w,G):void 0;E=new jc(l,e,c,u,h,i,g,y,!1,H),P=4*Z.length;var Y=t.iconSizeData,X=null;"source"===Y.kind?(X=[_c*s.layout.get("icon-size").evaluate(_,{})])[0]>Yc&&k(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[_c*b.compositeIconSizes[0].evaluate(_,{},T),_c*b.compositeIconSizes[1].evaluate(_,{},T)])[0]>Yc||X[1]>Yc)&&k(t.layerIds[0]+': Value for "icon-size" is >= '+Wc+'. Reduce your "icon-size".'),t.addSymbols(t.icon,Z,X,x,v,_,!1,e,L.lineStartIndex,L.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,W&&(z=4*W.length,t.addSymbols(t.icon,W,X,x,v,_,nc.vertical,e,L.lineStartIndex,L.lineLength,-1,T),F=t.icon.placedSymbolArray.length-1)}for(var $ in n.horizontal){var J=n.horizontal[$];if(!S){B=Fa(J.text);var K=s.layout.get("text-rotate").evaluate(_,{},T);S=new jc(l,e,c,u,h,J,f,p,d,K)}var Q=1===J.positionedLines.length;if(D+=Xc(t,e,J,a,s,d,_,m,L,n.vertical?nc.horizontal:nc.horizontalOnly,Q?Object.keys(n.horizontal):[$],j,R,b,T),Q)break}n.vertical&&(O+=Xc(t,e,n.vertical,a,s,d,_,m,L,nc.vertical,["vertical"],j,F,b,T));var tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=C?C.boxStartIndex:t.collisionBoxArray.length,nt=C?C.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,lt=-1,ct=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};lt=ct(S,lt),lt=ct(C,lt),lt=ct(E,lt);var ut=(lt=ct(I,lt))>-1?1:0;ut&&(lt*=A/Sl),t.glyphOffsetArray.length>=au.MAX_GLYPHS&&k("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical||-1,R,F,B,tt,et,rt,nt,it,at,ot,st,c,D,O,P,z,ut,0,f,N,U,lt)}(t,h,s,r,n,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,w,M,l,_,T,S,d,e,a,c,u,o)};if("line"===E)for(var P=0,z=Pc(e.geometry,0,0,uo,uo);P1){var U=Cc(N,A,r.vertical||m,n,g,x);U&&L(N,U)}}else if("Polygon"===e.type)for(var V=0,q=Ds(e.geometry,0);V=E.maxzoom||"none"!==E.visibility&&(o(S,this.zoom,n),(m[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var C=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},(function(t,e){h||(h=t,f=e,P.call(l))})):f={};var I=Object.keys(g.iconDependencies);I.length?a.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,P.call(l))})):p={};var L=Object.keys(g.patternDependencies);function P(){if(h)return s(h);if(f&&p&&d){var e=new i(f),r=new t.ImageAtlas(p,d);for(var a in m){var l=m[a];l instanceof t.SymbolBucket?(o(l.layers,this.zoom,n),t.performSymbolLayout(l,f,e.positions,p,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,P.call(l))})):d={},P.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),e(t,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new t.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var h=function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0!=!!e&&t.reverse()}var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function L(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s>1;D(t,e,o,n,i,a%2),z(t,e,r,n,o-1,a+1),z(t,e,r,o+1,i,a+1)}}function D(t,e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);D(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=e[2*r+a],f=n,p=i;for(O(t,e,n,r),e[2*i+a]>h&&O(t,e,n,i);fh;)p--}e[2*n+a]===h?O(t,e,n,p):O(t,e,++p,i),p<=r&&(n=p+1),r<=p&&(i=p-1)}}function O(t,e,r,n){R(t,r,n),R(e,2*r,2*n),R(e,2*r+1,2*n+1)}function R(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function F(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}b.fromVectorTileJs=w,b.fromGeojsonVt=T,b.GeoJSONWrapper=k;var j=function(t){return t[0]},B=function(t){return t[1]},N=function(t,e,r,n,i){void 0===e&&(e=j),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(t[d]);else{var m=Math.floor((p+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(p),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)},N.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var f=h;f<=u;f++)F(e[2*f],e[2*f+1],r,n)<=l&&s.push(t[f]);else{var p=Math.floor((h+u)/2),d=e[2*p],m=e[2*p+1];F(d,m,r,n)<=l&&s.push(t[p]);var g=(c+1)%2;(0===c?r-i<=d:n-i<=m)&&(o.push(h),o.push(p-1),o.push(g)),(0===c?r+i>=d:n+i>=m)&&(o.push(p+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},V=function(t){this.options=X(Object.create(U),t),this.trees=new Array(this.options.maxZoom+1)};function q(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function H(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:W(n),y:Y(i),zoom:1/0,index:e,parentId:-1}}function G(t){return{type:"Feature",id:t.id,properties:Z(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Z(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return X(X({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function W(t){return t/360+.5}function Y(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function X(t,e){for(var r in e)t[r]=e[r];return t}function $(t){return t.x}function J(t){return t.y}function K(t,e,r,n){for(var i,a=n,o=r-e>>1,s=r-e,l=t[e],c=t[e+1],u=t[r],h=t[r+1],f=e+3;fa)i=f,a=p;else if(p===a){var d=Math.abs(f-o);dn&&(i-e>3&&K(t,e,i,n),t[i+2]=a,r-i>3&&K(t,i,r,n))}function Q(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function tt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)et(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=e.length-3;e[2]=1,K(e,0,u,r),e[u+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function at(t,e,r,n){for(var i=0;i1?1:r}function lt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;for(var l=[],c=0;c=r&&d=n)){var m=[];if("Point"===f||"MultiPoint"===f)ct(h,m,r,n,i);else if("LineString"===f)ut(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===f)ft(h,m,r,n,i,!1);else if("Polygon"===f)ft(h,m,r,n,i,!0);else if("MultiPolygon"===f)for(var g=0;g=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ut(t,e,r,n,i,a,o){for(var s,l,c=ht(t),u=0===i?dt:mt,h=t.start,f=0;fr&&(l=u(c,p,d,g,y,r),o&&(c.start=h+s*l)):v>n?x=r&&(l=u(c,p,d,g,y,r),_=!0),x>n&&v<=n&&(l=u(c,p,d,g,y,n),_=!0),!a&&_&&(o&&(c.end=h+s*l),e.push(c),c=ht(t)),o&&(h+=s)}var b=t.length-3;p=t[b],d=t[b+1],m=t[b+2],(v=0===i?p:d)>=r&&v<=n&&pt(c,p,d,m),b=c.length-3,a&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&pt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ht(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ft(t,e,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function bt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,$,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(W(r),Y(a),W(i),Y(n));ue&&(d+=v.numPoints||1)}if(d>=s){for(var x=u.x*p,_=u.y*p,b=o&&p>1?this._map(u,!0):null,w=(c<<5)+(e+1)+this.points.length,T=0,k=f;T1)for(var E=0,C=f;E>5},V.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},V.prototype._map=function(t,e){if(t.numPoints)return e?X({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?X({},n):n},Tt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Tt.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var u=1<1&&console.time("creation"),f=this.tiles[h]=_t(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var m,g,y,v,x,_,b=.5*l.buffer/l.extent,w=.5-b,T=.5+b,k=1+b;m=g=y=v=null,x=lt(t,u,r-b,r+T,0,f.minX,f.maxX,l),_=lt(t,u,r+w,r+k,0,f.minX,f.maxX,l),t=null,x&&(m=lt(x,u,n-b,n+T,1,f.minY,f.maxY,l),g=lt(x,u,n+w,n+k,1,f.minY,f.maxY,l),x=null),_&&(y=lt(_,u,n-b,n+T,1,f.minY,f.maxY,l),v=lt(_,u,n+w,n+k,1,f.minY,f.maxY,l),_=null),c>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(g||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},Tt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,c=t,u=e,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[kt(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?vt(this.tiles[s],i):null):null};var Mt=function(e){function r(t,r,n,i){e.call(this,t,r,n,At),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=o.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));o={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new V(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,a,o){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=void 0,d=i/r*(n+1);if(l.isDash){var m=n-Math.abs(d);p=Math.sqrt(f*f+m*m)}else p=n-Math.sqrt(f*f+d*d);this.data[o+c]=Math.max(0,Math.min(255,p+128))}},k.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],a=t[t.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),f=Math.min(u,h),p=l.isDash?f:-f;this.data[o+c]=Math.max(0,Math.min(255,p+128))}},k.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&e.x=i&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(i,a,(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;or.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),O=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,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 t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.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())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var 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()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},N.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var a=e.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Dt(this._source.type)){for(var c={},u={},h=0,f=Object.keys(l);hthis._source.maxzoom){var g=d.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),_=d.overscaledZ-1;_>=a;--_){var b=d.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(m=this.getTile(b))&&x&&(m=this._addTile(b)),m&&(n[b.key]=b,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map((function(t){return o.pointCoordinate(t)})),c=s.map((function(t){return o.pointCoordinate(t)})),u=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,m=0,g=c;m=0&&y[1].y+g>=0){var v=l.map((function(t){return s.getTilePoint(t)})),x=c.map((function(t){return s.getTilePoint(t)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function zt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Ot(){return new t.window.Worker(aa.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={}};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ae(e,r,n,i,a,o,s,l){var c=i?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function le(e,r,n,i,a,o,s,l,c,u,h,f,p,d){var m,g=r/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=oe(g,l,y,v,n,h,f,e,c,o,p);if(!w)return{notEnoughRoom:!0};var T=re(w.first.point,s).point,k=re(w.last.point,s).point;if(i&&!n){var A=se(e.writingMode,T,k,d);if(A)return A}m=[w.first];for(var M=e.glyphStartIndex+1;M0?I.point:ce(f,C,S,1,a),P=se(e.writingMode,S,L,d);if(P)return P}var z=ue(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,o,p);if(!z)return{notEnoughRoom:!0};m=[z]}for(var D=0,O=m;D0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var g=d>0?l+s:l+s+1,y=a,v=a,x=0,_=0,b=Math.abs(p),w=[];x+_<=b;){if((g+=d)=c)return null;if(v=y,w.push(y),void 0===(y=f[g])){var T=new t.Point(u.getx(g),u.gety(g)),k=re(T,h);if(k.signedDistanceFromCamera>0)y=f[g]=k.point;else{var A=g-d;y=ce(0===x?o:new t.Point(u.getx(A),u.gety(A)),T,v,b-x+1,h)}}x+=_,_=v.dist(y)}var M=(b-x)/_,S=y.sub(v),E=S.mult(M)._add(v);E._add(S._unit()._perp()._mult(n*d));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Qt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Qt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Qt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Qt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Qt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Qt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Qt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Qt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,f=c;h=u[d+0]&&n>=u[d+1]&&(!s||s(this.boxKeys[p]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[p],x1:u[d],y1:u[d+1],x2:u[d+2],y2:u[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;yo*o+s*s},Qt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,f=u-c;return h*h+f*f<=r*r};var he=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function fe(t,e){for(var r=0;r=1;L--)I.push(E.path[L]);for(var P=1;P0){for(var R=I[0].clone(),F=I[0].clone(),j=1;j=A.x&&F.x<=M.x&&R.y>=A.y&&F.y<=M.y?[I]:F.xM.x||F.yM.y?[]:t.clipLine([I],A.x,A.y,M.x,M.y)}for(var B=0,N=O;B=this.screenRightBoundary||nthis.screenBottomBoundary},me.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(f,t,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:y,placedGlyphBoxes:v}):void 0},Ae.prototype.placeLayerBucketPart=function(e,r,n){var i=this,a=e.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,f=a.holdingForFade,p=a.collisionBoxArray,d=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),T="viewport-y"===s.get("symbol-z-order"),k=v&&(x||!o.hasIconData()||y),A=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p);var M=function(e,a){if(!r[e.crossTileID])if(f)i.placements[e.crossTileID]=new xe(!1,!1,!1);else{var p,T=!1,M=!1,S=!0,E=null,C={box:null,offscreen:null},I={box:null,offscreen:null},L=null,P=null,z=0,D=0,O=0;a.textFeatureIndex?z=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),a.verticalTextFeatureIndex&&(D=a.verticalTextFeatureIndex);var R=a.textBox;if(R){var F=function(r){var n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[e.crossTileID];a&&(i.placedOrientations[e.crossTileID]=a,n=a,i.markUsedOrientation(o,n,e))}return n},j=function(r,n){if(o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(B=B.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,u=w&&!x?r:null,f={box:[],offscreen:!1},p=v?2*B.length:B.length,d=0;d=B.length,k=i.attemptAnchorPlacement(g,t,a,s,c,_,b,h,l,m,y,e,o,n,u);if(k&&(f=k.placedGlyphBoxes)&&f.box&&f.box.length){T=!0,E=k.shift;break}}return f};j((function(){return U(R,a.iconBox,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&e.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(T=C.box,S=C.offscreen);var V=F(C&&C.box);if(!T&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[e.crossTileID];q&&(i.variableOffsets[e.crossTileID]=q,i.markUsedJustification(o,q.anchor,e,V))}}else{var H=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,e),i.placedOrientations[e.crossTileID]=r),n};j((function(){return H(R,t.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?H(r,t.WritingMode.vertical):{box:null,offscreen:null}})),F(C&&C.box&&C.box.length)}}if(T=(p=C)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(o.textSizeData,d,G),W=s.get("text-padding"),Y=e.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,Z,l,c,u,n,b,m.predicate,Y,W),T=v||L.circles.length>0&&!L.collisionDetected,S=S&&L.offscreen}if(a.iconFeatureIndex&&(O=a.iconFeatureIndex),a.iconBox){var X=function(t){var e=w&&E?ke(t,E.x,E.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,x,h,l,m.predicate)};M=I&&I.box&&I.box.length&&a.verticalIconBox?(P=X(a.verticalIconBox)).box.length>0:(P=X(a.iconBox)).box.length>0,S=S&&P.offscreen}var $=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,J=y||0===e.numIconVertices;if($||J?J?$||(M=M&&T):T=M&&T:M=T=M&&T,T&&p&&p.box&&(I&&I.box&&D?i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,D,m.ID):i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),M&&P&&i.collisionIndex.insertCollisionBox(P.box,s.get("icon-ignore-placement"),o.bucketInstanceId,O,m.ID),L&&(T&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var K=o.bucketInstanceId,Q=i.collisionCircleArrays[K];void 0===Q&&(Q=i.collisionCircleArrays[K]=new _e);for(var tt=0;tt=0;--E){var C=S[E];M(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var I=e.symbolInstanceStart;I=0&&(e.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},Ae.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,_=i.placedOrientations[a.crossTileID],b=_===t.WritingMode.vertical,w=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(v){var T=De(y.text),k=b?Oe:T;d(e.text,s,k);var A=w?Oe:T;d(e.text,l,A);var M=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=M||b?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=M||w?1:0);var S=i.variableOffsets[a.crossTileID];S&&i.markUsedJustification(e,S.anchor,a,_);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(e,"left",a,E),i.markUsedOrientation(e,E,a))}if(x){var C=De(y.icon),I=!(f&&a.verticalPlacedIconSymbolIndex&&b);if(a.placedIconSymbolIndex>=0){var L=I?C:Oe;d(e.icon,a.numIconVertices,L),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var P=I?Oe:C;d(e.icon,a.numVerticalIconVertices,P),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var z=e.collisionArrays[n];if(z){var D=new t.Point(0,0);if(z.textBox||z.verticalTextBox){var O=!0;if(c){var R=i.variableOffsets[m];R?(D=Te(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),u&&D._rotate(h?i.transform.angle:-i.transform.angle)):O=!1}z.textBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||b,D.x,D.y),z.verticalTextBox&&Me(e.textCollisionBox.collisionVertexArray,y.text.placed,!O||w,D.x,D.y)}var F=Boolean(!w&&z.verticalIconBox);z.iconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,F,f?D.x:0,f?D.y:0),z.verticalIconBox&&Me(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!F,f?D.x:0,f?D.y:0)}}},g=0;gt},Ae.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Ce=Math.pow(2,17),Ie=Math.pow(2,16),Le=Math.pow(2,9),Pe=Math.pow(2,8),ze=Math.pow(2,1);function De(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Se+e*Ee+r*Ce+e*Ie+r*Le+e*Pe+r*ze+e}var Oe=0,Re=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Re.prototype.continuePlacement=function(t,e,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Re(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Fe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var je=512/t.EXTENT/2,Be=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var c=o[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var u=0;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,o||(o=t,i=e,u())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,o||(o=t,a=e,u())}));function u(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,f=l.y,p=l.sdf,d=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,v,{x:h,y:f},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:d,sdf:p,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Pt(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(qe(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s=0;d--){var m=this._order[d];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id] 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,0.0,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;}"),nr=br("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);}"),ir=br("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,0,1);}"),ar=br("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=br("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=br("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),lr=br("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),cr=br("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);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;}"),ur=br("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);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\n? a_pos\n: 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;}"),hr=br("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),fr=br("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),pr=br("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_width2=vec2(outset,inset);}"),dr=br("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_width2=vec2(outset,inset);}"),mr=br("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),gr=br("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;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;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);}"),yr=br("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),vr=br("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);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),0.0,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;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),xr=br("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),_r=br("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,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);}");function br(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var wr=Object.freeze({__proto__:null,prelude:Xe,background:$e,backgroundPattern:Je,circle:Ke,clippingMask:Qe,heatmap:tr,heatmapTexture:er,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:cr,fillExtrusionPattern:ur,hillshadePrepare:hr,hillshade:fr,line:pr,lineGradient:dr,linePattern:mr,lineSDF:gr,raster:yr,symbolIcon:vr,symbolSDF:xr,symbolTextAndIcon:_r}),Tr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function kr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Ar.prototype.draw=function(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){var g,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[e],_=0,b=u.get();_0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Wr(i.paint.get("raster-hue-rotate"))};var a,o};function Wr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Yr,Xr=function(t,e,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},$r=function(e,r,n,i,a,o,s,l,c,u,h){var f=a.transform;return t.extend(Xr(e,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Jr=function(e,r,n,i,a,o,s,l,c,u){return t.extend($r(e,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Kr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Qr=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),f=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ge(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},tn={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function en(e,r,n,i,a,o,s){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d0){var b=t.create(),w=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:w,invTransform:b}),p=f+=_.length/4}x&&u.draw(l,c.LINES,Mt.disabled,Et.disabled,e.colorModeForRenderPass(),It.disabled,Dr(v,e.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,e.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var T=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*f),k._trim();for(var A=0,M=0,S=h;M=0&&(m[y.associatedIconIndex]={shiftedAnchor:S,angle:E})}else fe(y.numGlyphs,p)}if(h){d.clear();for(var I=e.icon.placedSymbolArray,L=0;L0){var s=t.browser.now(),l=(s-e.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.clamp(f?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var dn=new t.Color(1,0,0,1),mn=new t.Color(0,1,0,1),gn=new t.Color(0,0,1,1),yn=new t.Color(1,0,1,1),vn=new t.Color(0,1,1,1);function xn(t){var e=t.transform.padding;_n(t,t.transform.height-(e.top||0),3,dn),_n(t,e.bottom||0,3,mn),bn(t,e.left||0,3,gn),bn(t,t.transform.width-(e.right||0),3,yn);var r=t.transform.centerPoint;!function(t,e,r,n){var i=20,a=2;wn(t,e-a/2,r-i/2,a,i,n),wn(t,e-i/2,r-a/2,i,a,n)}(t,r.x,t.transform.height-r.y,vn)}function _n(t,e,r,n){wn(t,0,e+r/2,t.transform.width,r,n)}function bn(t,e,r,n){wn(t,e-r/2,0,r,t.transform.height,n)}function wn(e,r,n,i,a,o){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function Tn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Mt.disabled,c=Et.disabled,u=e.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,It.disabled,Rr(o,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=r.getTileByID(n.key).latestRawTileData,p=f&&f.byteLength||0,d=Math.floor(p/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,y+" "+d+"kb"),s.draw(i,a.TRIANGLES,l,c,Ct.alphaBlended,It.disabled,Rr(o,t.Color.transparent,g),h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var kn={symbol:function(e,r,n,i,a){if("translucent"===e.renderPass){var o=Et.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,f=e;h256&&this.clearStencil(),r.setColorMode(Ct.disabled),r.setDepthMode(Mt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},An.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],T=a[w.source],k=u[w.source];this._renderTileClippingMasks(w,k),this.renderLayer(this,T,w,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},An.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},An.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Ar(this.context,t,wr[t],e,tn[t],this._showOverdrawInspector)),this.cache[r]},An.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},An.prototype.setBaseState=function(){var 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)},An.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var e=this.context.gl;this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,e.RGBA)}},An.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Mn=function(t,e){this.points=t,this.planes=e};Mn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),a=[[-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((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],a[e[0]],a[e[1]]),n=t.sub([],a[e[2]],a[e[1]]),i=t.normalize([],t.cross([],r,n)),o=-t.dot(i,a[e[1]]);return i.concat(o)}));return new Mn(a,o)};var Sn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};Sn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;hthis.max[l]-this.min[l])return 0}return 1};var En=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};En.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},En.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},En.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},En.prototype.clone=function(){return new En(this.top,this.bottom,this.left,this.right)},En.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cn=function(e,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new En,this._posMatrixCache={},this._alignedPosMatrixCache={}},In={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Cn.prototype.clone=function(){var t=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},In.minZoom.get=function(){return this._minZoom},In.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},In.maxZoom.get=function(){return this._maxZoom},In.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},In.minPitch.get=function(){return this._minPitch},In.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},In.maxPitch.get=function(){return this._maxPitch},In.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},In.renderWorldCopies.get=function(){return this._renderWorldCopies},In.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},In.worldSize.get=function(){return this.tileSize*this.scale},In.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},In.size.get=function(){return new t.Point(this.width,this.height)},In.bearing.get=function(){return-this.angle/Math.PI*180},In.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},In.pitch.get=function(){return this._pitch/Math.PI*180},In.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},In.fov.get=function(){return this._fov/Math.PI*180},In.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},In.zoom.get=function(){return this._zoom},In.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},In.center.get=function(){return this._center},In.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},In.padding.get=function(){return this._edgeInsets.toJSON()},In.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},In.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Cn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Cn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Cn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Cn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=Mn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(t){return{aabb:new Sn([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],f=r,p=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)u.push(c(-d)),u.push(c(d));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var _=m.aabb.distanceX(o),b=m.aabb.distanceY(o),w=Math.max(Math.abs(_),Math.abs(b)),T=3+(1<T&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===f?p:m.zoom,m.wrap,m.zoom,g,y),distanceSq:t.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var k=0;k<4;k++){var A=(g<<1)+k%2,M=(y<<1)+(k>>1);u.push({aabb:m.aabb.quadrant(k),zoom:m.zoom+1,x:A,y:M,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Cn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},In.unmodified.get=function(){return this._unmodified},Cn.prototype.zoomScale=function(t){return Math.pow(2,t)},Cn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Cn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Cn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},In.point.get=function(){return this.project(this.center)},Cn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Cn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Cn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Cn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Cn.prototype.coordinateLocation=function(t){return t.toLngLat()},Cn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,f=u===h?0:(0-u)/(h-u);return new t.MercatorCoordinate(t.number(o,s,f)/this.worldSize,t.number(l,c,f)/this.worldSize)},Cn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Cn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Cn.prototype.setMaxBounds=function(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])},Cn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=t.mercatorYfromLat(h[1])*this.worldSize,e=(o=t.mercatorYfromLat(h[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var y=p.x,v=c.x/2;y-vl&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==i?i:p.y))),this._unmodified=u,this._constraining=!1}},Cn.prototype._calcMatrices=function(){if(this.height){var e=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(e)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-s,-l,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),t.scale(h,h,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var f=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+d*f+m*p,y=l-Math.round(l)+d*p+m*f,v=new Float64Array(h);if(t.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Cn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},Cn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Ln.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Pn={linearity:.3,easing:t.bezier(0,0,.3,1)},zn=t.extend({deceleration:2500,maxSpeed:1400},Pn),Dn=t.extend({deceleration:20,maxSpeed:1400},Pn),On=t.extend({deceleration:1e3,maxSpeed:360},Pn),Rn=t.extend({deceleration:1e3,maxSpeed:90},Pn),Fn=function(t){this._map=t,this.clear()};function jn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Fn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.dblclick=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},qn.prototype.mouseover=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.mouseout=function(t){this._map.fire(new Nn(t.type,this._map,t))},qn.prototype.touchstart=function(t){return this._firePreventable(new Un(t.type,this._map,t))},qn.prototype.touchmove=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype.touchend=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype.touchcancel=function(t){this._map.fire(new Un(t.type,this._map,t))},qn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(t){this._map=t};Hn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Hn.prototype.mousemove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Hn.prototype.mousedown=function(){this._delayContextMenu=!0},Hn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Hn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Nn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Hn.prototype.isEnabled=function(){return!0},Hn.prototype.isActive=function(){return!1},Hn.prototype.enable=function(){},Hn.prototype.disable=function(){};var Gn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Zn(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Wn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Yn=function(t){this.singleTap=new Wn(t),this.numTaps=t.numTaps,this.reset()};Yn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Yn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Yn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Yn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Xn=function(){this._zoomIn=new Yn({numTouches:1,numTaps:2}),this._zoomOut=new Yn({numTouches:2,numTaps:1}),this.reset()};Xn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Xn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Xn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Xn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),a=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var $n={0:1,2:2},Jn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Jn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Jn.prototype._correctButton=function(t,e){return!1},Jn.prototype._move=function(t,e){return{}},Jn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Jn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=$n[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Zn(n,r),a=new t.Point(0,0),o=new t.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,li(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return li(t)&&li(e)&&a}},e}(ri),ui={panStep:100,bearingStep:15,pitchStep:10},hi=function(){var t=ui;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function fi(t){return t*(2-t)}hi.prototype.reset=function(){this._active=!1},hi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:fi,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-a*e._panStep,-o*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active},hi.prototype.disableRotation=function(){this._rotationDisabled=!0},hi.prototype.enableRotation=function(){this._rotationDisabled=!1};var pi=4.000244140625,di=1/450,mi=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=di,t.bindAll(["_onTimeout"],this)};mi.prototype.setZoomRate=function(t){this._defaultZoomRate=t},mi.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},mi.prototype.isEnabled=function(){return!!this._enabled},mi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mi.prototype.isZooming=function(){return!!this._zooming},mi.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},mi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mi.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%pi==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},mi.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},mi.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mi.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>pi?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(h);o=t.number(l,s,f),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mi.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},mi.prototype.reset=function(){this._active=!1};var gi=function(t,e){this._clickZoom=t,this._tapZoom=e};gi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},gi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},gi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},gi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var yi=function(){this.reset()};yi.prototype.reset=function(){this._active=!1},yi.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(){this._tap=new Yn({numTouches:1,numTaps:1}),this.reset()};vi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},vi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},vi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},vi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var xi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};xi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var _i=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};_i.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},_i.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},_i.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},_i.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var bi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};bi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},bi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},bi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},bi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},bi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},bi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.Event);function ki(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Ai=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Fn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,b):Math.max(.5,b),w=Math.pow(g,1-e),T=i.unproject(x.add(_.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?T.wrap():T,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:a.padding,d=a.zoomScale(u-o),m=t.Point.convert(e.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var x=a.project(y),_=a.project(v).sub(x),b=e.curve,w=Math.max(a.width,a.height),T=w/d,k=_.mag();if("minZoom"in e){var A=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),M=w/a.zoomScale(A-o);b=Math.sqrt(M/k*2)}var S=b*b;function E(t){var e=(T*T-w*w+(t?-1:1)*S*S*k*k)/(2*(t?T:w)*S*k);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var L=E(0),P=function(t){return I(L)/I(L+b*t)},z=function(t){return w*((I(L)*(C(e=L+b*t)/I(e))-C(L))/S)/k;var e},D=(E(1)-L)/b;if(Math.abs(k)<1e-6||!isFinite(D)){if(Math.abs(w-T)<1e-6)return this.easeTo(e,r);var O=Te.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==l,this._padding=!a.isPaddingEqual(p),this._prepareEase(r,!1),this._ease((function(e){var i=e*D,d=1/P(i);a.zoom=1===e?u:o+a.scaleZoom(d),n._rotating&&(a.bearing=t.number(s,h,e)),n._pitching&&(a.pitch=t.number(l,f,e)),n._padding&&(a.interpolatePadding(c,p,e),g=a.centerPoint.add(m));var y=1===e?v:a.unproject(x.add(_.mult(z(i))).mult(d));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),Si=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Si.prototype.getDefaultPosition=function(){return"bottom-right"},Si.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Si.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Si.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},Si.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Si.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Si.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ei=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Ei.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ei.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ei.prototype.getDefaultPosition=function(){return"bottom-left"},Ei.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Ei.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},Ei.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Ci=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ci.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Ci.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>Di)throw new Error("maxPitch must be less than or equal to 60");var i=new Cn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ii,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Pi))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ai(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new Ln(a).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,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Si({customAttribution:e.customAttribution})),this.addControl(new Ei,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()Di)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new Nn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Nn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new Nn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var a=n[t],o=0;o180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Ni.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Ni.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ni.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ni.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Ni.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Ni.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Ni.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ni.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ni.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ni.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){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),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))},n.prototype.setDraggable=function(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},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Wi=0,Yi=!1,Xi=function(e){function n(r){e.call(this),this.options=t.extend({},Zi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Hi?n(Hi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Hi="denied"!==t.state,n(Hi)})):(Hi=!!t.window.navigator.geolocation,n(Hi)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Wi=0,Yi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("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("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Yi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");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=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Gi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gi({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",(function(e){var r=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Wi--,Yi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Wi>1?(e={maximumAge:6e5,timeout:0},Yi=!0):(e=this.options.positionOptions,Yi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),$i={maxWidth:100,unit:"metric"},Ji=function(e){this.options=t.extend({},$i,e),t.bindAll(["_onMove","setUnit"],this)};function Ki(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Qi(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Qi(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Qi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Qi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Qi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Qi(t,e,r,n){var i,a,o,s=(i=r,a=Math.pow(10,(""+Math.floor(i)).length-1),o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o),a*o),l=s/r;t.style.width=e*l+"px",t.innerHTML=s+" "+n}Ji.prototype.getDefaultPosition=function(){return"bottom-left"},Ji.prototype._onMove=function(){Ki(this._map,this._container,this.options)},Ji.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ji.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ji.prototype.setUnit=function(t){this.options.unit=t,Ki(this._map,this._container,this.options)};var ta=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};ta.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ta.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ta.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},ta.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ta.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},ta.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ta.prototype._isFullscreen=function(){return this._fullscreen},ta.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ta.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ea={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ra=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(ea),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.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 t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-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))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(t){var e=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return e._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),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=Ui(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||t)){var i=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=ia(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Vi[a]+" translate("+u.x+"px,"+u.y+"px)"),qi(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(ra);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function ia(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.Point(0,0),top:new t.Point(0,e),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-e),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(e,0),right:new t.Point(-e,0)}}if(e instanceof t.Point||Array.isArray(e)){var n=t.Point.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.Point.convert(e.center||[0,0]),top:t.Point.convert(e.top||[0,0]),"top-left":t.Point.convert(e["top-left"]||[0,0]),"top-right":t.Point.convert(e["top-right"]||[0,0]),bottom:t.Point.convert(e.bottom||[0,0]),"bottom-left":t.Point.convert(e["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(e["bottom-right"]||[0,0]),left:t.Point.convert(e.left||[0,0]),right:t.Point.convert(e.right||[0,0])}}return ia(new t.Point(0,0))}var aa={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ri,NavigationControl:Bi,GeolocateControl:Xi,AttributionControl:Si,ScaleControl:Ji,FullscreenControl:ta,Popup:na,Marker:Gi,Style:We,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Nt().acquire(Rt)},clearPrewarmedResources:function(){var t=jt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),jt=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()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return aa})),r},"object"==typeof t&&void 0!==e?e.exports=n():(r=r||self).mapboxgl=n()}}),w_=f({"src/plots/mapbox/layers.js"(t,e){var r=se(),n=Me().sanitizeHTML,i=m_(),a=c_();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e1&&r.warn(f.multipleTokensErrorMsg),a[0]):(o.length&&r.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);e.accessToken=s;for(var l=0;lw/2){var T=v.split("|").join("
");_.text(T).attr("data-unformatted",T).call(c.convertToTspans,t),b=l.bBox(_.node())}_.attr("transform",n(-3,8-b.height)),x.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var k=1;b.width+6>w&&(k=w/(b.width+6));var A=[a.l+a.w*d.x[1],a.t+a.h*(1-d.y[0])];x.attr("transform",n(A[0],A[1])+i(k))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[h],n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),P_=f({"src/traces/choroplethmapbox/index.js"(t,e){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:E_(),supplyDefaults:C_(),colorbar:No(),calc:kg(),plot:L_(),hoverPoints:Sg(),eventData:Eg(),selectPoints:Cg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),B_=f({"src/traces/densitymapbox/hover.js"(t,e){var r=nr(),n=v_().hoverPoints,i=v_().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),N_=f({"src/traces/densitymapbox/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),U_=f({"src/traces/densitymapbox/index.js"(t,e){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),e.exports={attributes:D_(),supplyDefaults:O_(),colorbar:No(),formatLabels:d_(),calc:R_(),plot:j_(),hoverPoints:B_(),eventData:N_(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;nESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),H_=f({"src/plots/map/styles/arcgis-sat.js"(t,e){e.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),G_=f({"src/plots/map/constants.js"(t,e){var r=Zt(),n=q_(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:H_(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'© OpenStreetMap contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);e.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),Z_=f({"src/plots/map/layout_attributes.js"(t,e){var r=se(),n=q().defaultLine,i=Ta().attributes,a=R(),o=wn().textposition,s=Lt().overrideAll,l=ge().templatedArray,c=G_(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),W_=f({"src/traces/scattermap/attributes.js"(t,e){var r=Dt().hovertemplateAttrs,n=Dt().texttemplateAttrs,i=bn(),a=Zm(),o=wn(),s=Z_(),l=N(),c=Le(),u=O().extendFlat,h=Lt().overrideAll,f=Z_(),p=a.line,d=a.marker;e.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},d.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:d.opacity,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),Y_=f({"src/traces/scattermap/constants.js"(t,e){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];e.exports={isSupportedFont:function(t){return-1!==r.indexOf(t)}}}}),X_=f({"src/traces/scattermap/defaults.js"(t,e){var r=se(),n=We(),i=Zn(),a=Wn(),o=Xn(),s=$n(),l=W_(),c=Y_().isSupportedFont;e.exports=function(t,e,u,h){function f(n,i){return r.coerce(t,e,l,n,i)}function p(n,i){return r.coerce2(t,e,l,n,i)}var d=function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,f);if(d){if(f("text"),f("texttemplate"),f("hovertext"),f("hovertemplate"),f("mode"),f("below"),n.hasMarkers(e)){i(t,e,u,h,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m=e.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(e)&&(a(t,e,u,h,f,{noDash:!0}),f("connectgaps"));var g=p("cluster.maxzoom"),y=p("cluster.step"),v=p("cluster.color",e.marker&&e.marker.color||u),x=p("cluster.size"),_=p("cluster.opacity");if(f("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==_)||n.hasText(e)){var b=h.font.family;o(t,e,h,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(b)?b:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}f("fill"),"none"!==e.fill&&s(t,e,u,f),r.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}}}),$_=f({"src/traces/scattermap/format_labels.js"(t,e){var r=nr();e.exports=function(t,e,n){var i={},a=n[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),J_=f({"src/plots/map/convert_text_opts.js"(t,e){var r=se();e.exports=function(t,e){var n=t.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(e)?r.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),K_=f({"src/traces/scattermap/convert.js"(t,e){var r=T(),n=se(),i=k().BADNUM,a=Qm(),o=Ze(),s=Ke(),l=Ye(),c=We(),u=Y_().isSupportedFont,h=J_(),f=Xe().appendArrayPointValue,p=Me().NEWLINES,d=Me().BR_TAG_ALL;function m(t){return{type:t,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(t,e){return n.isArrayOrTypedArray(t)?e?function(e){return r(t[e])?+t[e]:0}:function(e){return t[e]}:t?function(){return t}:y}function y(){return""}function v(t){return t[0]===i}function x(t,e){var r;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(e)){r=["step",["get","point_count"],t[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}e.exports=function(t,e){var i,u=e[0].trace,b=!0===u.visible&&0!==u._length,w="none"!==u.fill,T=c.hasLines(u),k=c.hasMarkers(u),A=c.hasText(u),M=k&&"circle"===u.marker.symbol,S=k&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),I=m("line"),L=m("circle"),P=m("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!b)return z;if((w||T)&&(i=a.calcTraceToLineCoords(e)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),T&&(I.geojson=a.makeLine(i),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),M){var D=function(t){var e,i,a,c,u=t[0].trace,h=u.marker,f=u.selectedpoints,p=n.isArrayOrTypedArray(h.color),d=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(t){return u.opacity*t}function y(t){return t/2}p&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),d&&(a=l(u)),m&&(c=function(t){return g(r(t)?+n.constrain(t,0,1):0)});var x,_=[];for(e=0;e=0;r--){var n=e[r];i.removeLayer(u.layerIds[n])}t||i.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=a.nonCluster,r=e.length-1;r>=0;r--){var n=e[r];i.removeLayer(u.layerIds[n]),t||i.removeSource(u.sourceIds[n])}}(t)}function f(t){l?function(t){t||u.addSource("circle",o.circle,e.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,i,s,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(t,l.uid,c,u),f=n(t.gd,e),p=h.below=t.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",f.circle,l.cluster),r=0;r")}function u(t){return t+"°"}}e.exports={hoverPoints:function(t,e,a){var c=t.cd,u=c[0].trace,h=t.xa,f=t.ya,p=t.subplot,d=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=p.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-v;if(r.getClosest(c,(function(t){var e=t.lonlat;if(e[0]===o)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var r=n.modHalf(e[0],360),i=e[1],s=p.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-f.c2p([r,a]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var _=c[t.index],b=_.lonlat,w=[n.modHalf(b[0],360)+v,b[1]],T=h.c2p(w),k=f.c2p(w),A=_.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(_,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(u,_),t.extraText=l(u,_,c[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:l}}}),eb=f({"src/traces/scattermap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}}}),rb=f({"src/traces/scattermap/select.js"(t,e){var r=se(),n=We(),i=k().BADNUM;e.exports=function(t,e){var a,o=t.cd,s=t.xaxis,l=t.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===e)for(a=0;a1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var d=n(f);let m,g;function y(){return null==m&&(m="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;ri.solve(t)}const _=x(.25,.1,.25,1);function b(t,e,r){return Math.min(r,Math.max(e,t))}function w(t,e,r){const n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function T(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}let k=1;function A(t,e,r){const n={};for(const r in t)n[r]=e.call(this,t[r],r,t);return n}function M(t,e,r){const n={};for(const r in t)e.call(this,t[r],r,t)&&(n[r]=t[r]);return n}function S(t){return Array.isArray(t)?t.map(S):"object"==typeof t&&t?A(t,S):t}const E={};function C(t){E[t]||("undefined"!=typeof console&&console.warn(t),E[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function L(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let P=null;function z(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(t,r,n,i,a){return e(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const o=null==e?void 0:e.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);const s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield e.copyTo(l,function(t,e,r,n,i){const a=4*Math.max(-e,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,e),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(t.width,e+n)-l,height:Math.min(t.height,r+i)-c},layout:[{offset:o,stride:s}]}}(t,r,n,i,a)),s)for(let t=0;tL(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,G=function(t,r){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=U(t.url);if(e)return e(t,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:V},r)}if(!(/^file:/.test(n=t.url)||/^file:/.test(H())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,r){return e(this,void 0,void 0,(function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:H(),signal:r.signal});"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");const n=yield fetch(e);if(!n.ok){const e=yield n.blob();throw new q(n.status,n.statusText,t.url,e)}let i;i="arrayBuffer"===t.type||"image"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text();const a=yield i;if(r.signal.aborted)throw B();return{data:a,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}))}(t,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:V},r)}var n,i,a;return i=t,a=r,new Promise(((t,e)=>{var r;const n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(const t in i.headers)n.setRequestHeader(t,i.headers[t]);"json"===i.type&&(n.responseType="text",(null===(r=i.headers)||void 0===r?void 0:r.Accept)||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{e(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let r=n.response;if("json"===i.type)try{r=JSON.parse(n.response)}catch(t){return void e(t)}t({data:r,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{const t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});e(new q(n.status,n.statusText,i.url,t))}},a.signal.addEventListener("abort",(()=>{n.abort(),e(B())})),n.send(i.body)}))};function Z(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function W(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Y(t,e,r){if(r&&r[t]){const n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}class X{constructor(t,e={}){T(this,e),this.type=t}}class $ extends X{constructor(t,e={}){super("error",T({error:t},e))}}class J{on(t,e){return this._listeners=this._listeners||{},W(t,e,this._listeners),this}off(t,e){return Y(t,e,this._listeners),Y(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},W(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new X(t,e||{}));const r=t.type;if(this.listens(r)){t.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of e)r.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const e of n)Y(r,e,this._oneTimeListeners),e.call(this,t);const i=this._eventedParent;i&&(T(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(t))}else t instanceof $&&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,e){return this._eventedParent=t,this._eventedParentData=e,this}}var K={$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"}}};const Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tt(t,e){const r={};for(const e in t)"ref"!==e&&(r[e]=t[e]);return Q.forEach((t=>{t in e&&(r[t]=e[t])})),r}function et(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Et=[dt,mt,gt,yt,vt,wt,xt,Mt(_t),Tt,kt,At];function Ct(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ct(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of Et)if(!Ct(t,e))return null}return`Expected ${St(t)} but found ${St(e)} instead.`}function It(t,e){return e.some((e=>e.kind===t.kind))}function Lt(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function Pt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const zt=.96422,Dt=.82521,Ot=4/29,Rt=6/29,Ft=3*Rt*Rt,jt=Rt*Rt*Rt,Bt=Math.PI/180,Nt=180/Math.PI;function Ut(t){return(t%=360)<0&&(t+=360),t}function Vt([t,e,r,n]){let i,a;const o=Ht((.2225045*(t=qt(t))+.7168786*(e=qt(e))+.0606169*(r=qt(r)))/1);t===e&&e===r?i=a=o:(i=Ht((.4360747*t+.3850649*e+.1430804*r)/zt),a=Ht((.0139322*t+.0971045*e+.7141733*r)/Dt));const s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),n]}function qt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ht(t){return t>jt?Math.pow(t,1/3):t/Ft+Ot}function Gt([t,e,r,n]){let i=(t+16)/116,a=isNaN(e)?i:i+e/500,o=isNaN(r)?i:i-r/200;return i=1*Wt(i),a=zt*Wt(a),o=Dt*Wt(o),[Zt(3.1338561*a-1.6168667*i-.4906146*o),Zt(-.9787684*a+1.9161415*i+.033454*o),Zt(.0719453*a-.2289914*i+1.4052427*o),n]}function Zt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Wt(t){return t>Rt?t*t*t:Ft*(t-Ot)}function Yt(t){return parseInt(t.padEnd(2,t),16)/255}function Xt(t,e){return $t(e?t/100:t,0,1)}function $t(t,e,r){return Math.min(Math.max(e,t),r)}function Jt(t){return!t.some(Number.isNaN)}const Kt={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 Qt{constructor(t,e,r,n=1,i=!0){this.r=t,this.g=e,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,e,r,n]))}static parse(t){if(t instanceof Qt)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=Kt[t];if(e){const[t,r,n]=e;return[t/255,r/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let r=1;return[Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+=e)),Yt(t.slice(r,r+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,r,n,i,a,o,s,l,c,u,h,f]=e,p=[i||" ",s||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const t=[n,o,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[$t(+r/e,0,1),$t(+a/e,0,1),$t(+l/e,0,1),h?Xt(+h,f):1];if(Jt(t))return t}}return}}const r=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[t,e,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const t=[+e,$t(+i,0,100),$t(+o,0,100),l?Xt(+l,c):1];if(Jt(t))return function([t,e,r,n]){function i(n){const i=(n+t/30)%12,a=e*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=Ut(t),e/=100,r/=100,[i(0),i(8),i(4),n]}(t)}}}(t);return e?new Qt(...e,!1):void 0}get rgb(){const{r:t,g:e,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[t/i,e/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,r,n,i]=Vt(t),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ut(Math.atan2(n,r)*Nt):NaN,a,e,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Vt(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,r,n]=this.rgb;return`rgba(${[t,e,r].map((t=>Math.round(255*t))).join(",")},${n})`}}Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);class te{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ee{constructor(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i}}class re{constructor(t){this.sections=t}static fromString(t){return new re([new ee(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof re?t:re.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class ne{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ne)return t;if("number"==typeof t)return new ne([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)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 ne(t)}}toString(){return JSON.stringify(this.values)}}const ie=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ae{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ae)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function le(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Qt||t instanceof te||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe)return!0;if(Array.isArray(t)){for(const e of t)if(!le(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!le(t[e]))return!1;return!0}return!1}function ce(t){if(null===t)return dt;if("string"==typeof t)return gt;if("boolean"==typeof t)return yt;if("number"==typeof t)return mt;if(t instanceof Qt)return vt;if(t instanceof te)return bt;if(t instanceof re)return wt;if(t instanceof ne)return Tt;if(t instanceof ae)return At;if(t instanceof oe)return kt;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=ce(e);if(r){if(r===t)continue;r=_t;break}r=t}return Mt(r||_t,e)}return xt}function ue(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof re||t instanceof ne||t instanceof ae||t instanceof oe?t.toString():JSON.stringify(t)}class he{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!le(t[1]))return e.error("invalid value");const r=t[1];let n=ce(r);const i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new he(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class fe{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const pe={string:gt,number:mt,boolean:yt,object:xt};class de{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1;const i=t[0];if("array"===i){let i,a;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in pe)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=pe[r],n++}else i=_t;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Mt(i,a)}else{if(!pe[i])throw new Error(`Types doesn't contain name = ${i}`);r=pe[i]}const a=[];for(;nt.outputDefined()))}}const me={"to-boolean":yt,"to-color":vt,"to-number":mt,"to-string":gt};class ge{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(!me[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const n=me[r],i=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:se(e[0],e[1],e[2],e[3]),!r))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new fe(r||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const r of this.args){e=r.evaluate(t);const n=ne.parse(e);if(n)return n}throw new fe(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const r of this.args){e=r.evaluate(t);const n=ae.parse(e);if(n)return n}throw new fe(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new fe(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return re.fromString(ue(this.args[0].evaluate(t)));case"resolvedImage":return oe.fromString(ue(this.args[0].evaluate(t)));default:return ue(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const ye=["Unknown","Point","LineString","Polygon"];class ve{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?"number"==typeof this.feature.type?ye[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 e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e}}class xe{constructor(t,e,r=[],n,i=new pt,a=[]){this.registry=t,this.path=r,this.key=r.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=e}parse(t,e,r,n,i={}){return e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}_parse(t,e){function r(t,e,r){return"assert"===r?new de(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,i=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind)if("padding"!==t.kind||"value"!==i.kind&&"number"!==i.kind&&"array"!==i.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==i.kind&&"array"!==i.kind){if(this.checkSubtype(t,i))return null}else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"assert")}if(!(n instanceof he)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const t=new ve;try{n=new he(n.type,n.evaluate(t))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new xe(this.registry,this._isConstant,n,e||null,i,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new ft(r,t))}checkSubtype(t,e){const r=Ct(t,e);return r&&this.error(r),r}}class _e{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let n=1;n=r.length)throw new fe(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new fe(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Te{constructor(t,e){this.type=yt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);return r&&n?It(r.type,[yt,gt,mt,dt,_t])?new Te(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Lt(e,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ce(e))} instead.`);if(!Lt(r,["string","array"]))throw new fe(`Expected second argument to be of type array or string, but found ${St(ce(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ke{constructor(t,e,r){this.type=mt,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,_t),n=e.parse(t[2],2,_t);if(!r||!n)return null;if(!It(r.type,[yt,gt,mt,dt,_t]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${St(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,mt);return i?new ke(r,n,i):null}return new ke(r,n)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Lt(e,["boolean","string","number","null"]))throw new fe(`Expected first argument to be of type boolean, string, number or null, but found ${St(ce(e))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(t)),Lt(r,["string"])){const t=r.indexOf(e,n);return-1===t?-1:[...r.slice(0,t)].length}if(Lt(r,["array"]))return r.indexOf(e,n);throw new fe(`Expected second argument to be of type array or string, but found ${St(ce(r))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Ae{constructor(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i={},a=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ce(t)))return null}else r=ce(t);if(void 0!==i[String(t)])return c.error("Branch labels must be unique.");i[String(t)]=a.length}const u=e.parse(l,o,n);if(!u)return null;n=n||u.type,a.push(u)}const o=e.parse(t[1],1,_t);if(!o)return null;const s=e.parse(t[t.length-1],t.length-1,n);return s?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ae(r,n,o,i,a,s):null}evaluate(t){const e=this.input.evaluate(t);return(ce(e)===this.inputType&&this.outputs[this.cases[e]]||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 Me{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n=[];for(let i=1;ie.outputDefined()))&&this.otherwise.outputDefined()}}class Se{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,_t),n=e.parse(t[2],2,mt);if(!r||!n)return null;if(!It(r.type,[Mt(_t),gt,_t]))return e.error(`Expected first argument to be of type array or string, but found ${St(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,mt);return i?new Se(r.type,r,n,i):null}return new Se(r.type,r,n)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);let n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),Lt(e,["string"]))return[...e].slice(r,n).join("");if(Lt(e,["array"]))return e.slice(r,n);throw new fe(`Expected first argument to be of type array or string, but found ${St(ce(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ee(t,e){const r=t.length-1;let n,i,a=0,o=r,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),n=t[s],i=t[s+1],n<=e){if(s===r||ee))throw new fe("Input is not a number.");o=s-1}return 0}class Ce{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,mt);if(!r)return null;const n=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let r=1;r=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=e.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new Ce(i,r,n)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ee(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}var Ie=Le;function Le(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}Le.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Pe,ze=(Pe=Ie)&&Pe.__esModule&&Object.prototype.hasOwnProperty.call(Pe,"default")?Pe.default:Pe;function De(t,e,r){return t+r*(e-t)}function Oe(t,e,r){return t.map(((t,n)=>De(t,e[n],r)))}const Re={number:De,color:function(t,e,r,n="rgb"){switch(n){case"rgb":{const[n,i,a,o]=Oe(t.rgb,e.rgb,r);return new Qt(n,i,a,o,!1)}case"hcl":{const[n,i,a,o]=t.hcl,[s,l,c,u]=e.hcl;let h,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?h=NaN:(h=s,1!==a&&0!==a||(f=l)):(h=n,1!==c&&0!==c||(f=i));else{let t=s-n;s>n&&t>180?t-=360:s180&&(t+=360),h=n+r*t}const[p,d,m,g]=function([t,e,r,n]){return t=isNaN(t)?0:t*Bt,Gt([r,Math.cos(t)*e,Math.sin(t)*e,n])}([h,null!=f?f:De(i,l,r),De(a,c,r),De(o,u,r)]);return new Qt(p,d,m,g,!1)}case"lab":{const[n,i,a,o]=Gt(Oe(t.lab,e.lab,r));return new Qt(n,i,a,o,!1)}}},array:Oe,padding:function(t,e,r){return new ne(Oe(t.values,e.values,r))},variableAnchorOffsetCollection:function(t,e,r){const n=t.values,i=e.values;if(n.length!==i.length)throw new fe(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const a=[];for(let t=0;t"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,mt),!i)return null;const o=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=vt:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=e.parse(n,l,s);if(!c)return null;s=s||c.type,o.push([r,c])}return Pt(s,mt)||Pt(s,vt)||Pt(s,Tt)||Pt(s,At)||Pt(s,Mt(mt))?new Fe(s,r,n,i,o):e.error(`Type ${St(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);const a=Ee(e,n),o=Fe.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),l=r[a+1].evaluate(t);switch(this.operator){case"interpolate":return Re[this.type.kind](s,l,o);case"interpolate-hcl":return Re.color(s,l,o,"hcl");case"interpolate-lab":return Re.color(s,l,o,"lab")}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function je(t,e,r,n){const i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}class Be{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null;const n=e.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of t.slice(1)){const t=e.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t)}if(!r)throw new Error("No output type");const a=n&&i.some((t=>Ct(n,t.type)));return new Be(a?_t:r,i)}evaluate(t){let e,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(t),r&&r instanceof oe&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null!==r)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function Ne(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ue(t,e,r,n){return 0===n.compare(e,r)}function Ve(t,e,r){const n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=yt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let a=e.parse(t[1],1,_t);if(!a)return null;if(!Ne(r,a.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${St(a.type)}'.`);let o=e.parse(t[2],2,_t);if(!o)return null;if(!Ne(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${St(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${St(a.type)}' and '${St(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new de(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new de(a.type,[o])));let s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,bt),!s)return null}return new i(a,o,s)}evaluate(i){const a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const e=ce(a),r=ce(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new fe(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=ce(a),r=ce(o);if("string"!==t.kind||"string"!==r.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const qe=Ve("==",(function(t,e,r){return e===r}),Ue),He=Ve("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Ue(0,e,r,n)})),Ge=Ve("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),We=Ve("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Ye=Ve(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0}));class Xe{constructor(t,e,r){this.type=bt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,yt);if(!n)return null;const i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,yt);if(!i)return null;let a=null;return r.locale&&(a=e.parse(r.locale,1,gt),!a)?null:new Xe(n,i,a)}evaluate(t){return new te(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 $e{constructor(t,e,r,n,i){this.type=gt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,mt);if(!r)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parse(n.locale,1,gt),!i))return null;let a=null;if(n.currency&&(a=e.parse(n.currency,1,gt),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=e.parse(n["min-fraction-digits"],1,mt),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=e.parse(n["max-fraction-digits"],1,mt),!s)?null:new $e(r,i,a,o,s)}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 Je{constructor(t){this.type=wt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=t.length-1;++r){const a=t[r];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;let t=null;if(a["font-scale"]&&(t=e.parse(a["font-scale"],1,mt),!t))return null;let r=null;if(a["text-font"]&&(r=e.parse(a["text-font"],1,Mt(gt)),!r))return null;let o=null;if(a["text-color"]&&(o=e.parse(a["text-color"],1,vt),!o))return null;const s=n[n.length-1];s.scale=t,s.font=r,s.textColor=o}else{const a=e.parse(t[r],1,_t);if(!a)return null;const o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:a,scale:null,font:null,textColor:null})}}return new Je(n)}evaluate(t){return new re(this.sections.map((e=>{const r=e.content.evaluate(t);return ce(r)===kt?new ee("",r,null,null,null):new ee(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}}class Ke{constructor(t){this.type=kt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,gt);return r?new Ke(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=oe.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}}class Qe{constructor(t){this.type=mt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${St(r.type)} instead.`):new Qe(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new fe(`Expected value to be of type string or array, but found ${St(ce(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const tr=8192;function er(t,e){const r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*tr),Math.round(n*i*tr)]}function rr(t,e){const r=Math.pow(2,e.z);return[(i=(t[0]/tr+e.x)/r,360*i-180),(n=(t[1]/tr+e.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ar(t,e,r){const n=t[0]-e[0],i=t[1]-e[1],a=t[0]-r[0],o=t[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(t,e,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-i[1]*a[0]&&!(!fr(t,e,r,n)||!fr(r,n,t,e));var i,a}function sr(t,e,r){for(const n of r)for(let r=0;r(i=t)[1]!=(o=s[e+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function cr(t,e){for(const r of e)if(lr(t,r))return!0;return!1}function ur(t,e){for(const r of t)if(!lr(r,e))return!1;for(let r=0;r0&&s<0||o<0&&s>0}function pr(t,e,r){const n=[];for(let i=0;ir[2]){const e=.5*n;let i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i}nr(e,t)}function gr(t,e,r,n){const i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(const n of t)for(const t of n){const n=[t.x+a[0],t.y+a[1]];mr(n,e,r,i),o.push(n)}return o}function yr(t,e,r,n){const i=Math.pow(2,n.z)*tr,a=[n.x*tr,n.y*tr],o=[];for(const r of t){const t=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];nr(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of o)for(const n of t)mr(n,e,r,i)}var s;return o}class vr{constructor(t,e){this.type=yt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const r of e.features){const{type:e,coordinates:n}=r.geometry;"Polygon"===e&&t.push(n),"MultiPolygon"===e&&t.push(...n)}if(t.length)return new vr(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new vr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new vr(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const a=pr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!lr(t,a))return!1}if("MultiPolygon"===e.type){const a=dr(e.coordinates,n,i),o=gr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!cr(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const a=pr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!ur(t,a))return!1}if("MultiPolygon"===e.type){const a=dr(e.coordinates,n,i),o=yr(t.geometry(),r,n,i);if(!ir(r,n))return!1;for(const t of o)if(!hr(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(t=[],e=(t,e)=>te?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=e[n],t=n}e[t]=i}};function _r(t,e,r,n,i){br(t,e,r,n||t.length-1,i||Tr)}function br(t,e,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);br(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}var u=t[e],h=r,f=n;for(wr(t,r,e),i(t[n],u)>0&&wr(t,r,n);h0;)f--}0===i(t[r],u)?wr(t,r,f):wr(t,++f,n),f<=e&&(r=f+1),e<=f&&(n=f-1)}}function wr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Tr(t,e){return te?1:0}function kr(t,e){if(t.length<=1)return[t];const r=[];let n,i;for(const e of t){const t=Mr(e);0!==t&&(e.area=Math.abs(t),void 0===i&&(i=t<0),i===t<0?(n&&r.push(n),n=[e]):n.push(e))}if(n&&r.push(n),e>1)for(let t=0;t1?(l=t[s+1][0],c=t[s+1][1]):f>0&&(l+=u/this.kx*f,c+=h/this.ky*f)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;const p=u*u+h*h;p180;)t-=360;return t}}function Lr(t,e){return e[0]-t[0]}function Pr(t){return t[1]-t[0]+1}function zr(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];const r=Pr(t);if(e){if(2===r)return[t,null];const e=Math.floor(r/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===r)return[t,null];const n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function Or(t,e){if(!zr(e,t.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)nr(r,t[n]);return r}function Rr(t){const e=[1/0,1/0,-1/0,-1/0];for(const r of t)for(const t of r)nr(e,t);return e}function Fr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function jr(t,e,r){if(!Fr(t)||!Fr(e))return NaN;let n=0,i=0;return t[2]e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]=n)return n;if(ir(i,a)){if(Gr(t,e))return 0}else if(Gr(e,t))return 0;let o=1/0;for(const n of t)for(let t=0,i=n.length,a=i-1;t0;){const i=o.pop();if(i[0]>=a)continue;const l=i[1],c=e?50:100;if(Pr(l)<=c){if(!zr(l,t.length))return NaN;if(e){const e=Hr(t,l,r,n);if(isNaN(e)||0===e)return e;a=Math.min(a,e)}else for(let e=l[0];e<=l[1];++e){const i=qr(t[e],r,n);if(a=Math.min(a,i),0===a)return 0}}else{const r=Dr(l,e);Wr(o,a,n,t,s,r[0]),Wr(o,a,n,t,s,r[1])}}return a}function $r(t,e,r,n,i,a=1/0){let o=Math.min(a,i.distance(t[0],r[0]));if(0===o)return o;const s=new xr([[0,[0,t.length-1],[0,r.length-1]]],Lr);for(;s.length>0;){const a=s.pop();if(a[0]>=o)continue;const l=a[1],c=a[2],u=e?50:100,h=n?50:100;if(Pr(l)<=u&&Pr(c)<=h){if(!zr(l,t.length)&&zr(c,r.length))return NaN;let a;if(e&&n)a=Ur(t,l,r,c,i),o=Math.min(o,a);else if(e&&!n){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(a=Br(r[t],e,i),o=Math.min(o,a),0===o)return o}else if(!e&&n){const e=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Br(t[r],e,i),o=Math.min(o,a),0===o)return o}else a=Vr(t,l,r,c,i),o=Math.min(o,a)}else{const a=Dr(l,e),u=Dr(c,n);Yr(s,o,i,t,r,a[0],u[0]),Yr(s,o,i,t,r,a[0],u[1]),Yr(s,o,i,t,r,a[1],u[0]),Yr(s,o,i,t,r,a[1],u[1])}}return o}function Jr(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class Kr{constructor(t,e){this.type=mt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(le(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Kr(e,e.features.map((t=>Jr(t.geometry))).flat());if("Feature"===e.type)return new Kr(e,Jr(e.geometry));if("type"in e&&"coordinates"in e)return new Kr(e,Jr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;const i=new Ir(n[0][1]);let a=1/0;for(const t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!1,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!1,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!1,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=t.geometry(),n=r.flat().map((e=>rr([e.x,e.y],t.canonical)));if(0===r.length)return NaN;const i=new Ir(n[0][1]);let a=1/0;for(const t of e){switch(t.type){case"Point":a=Math.min(a,$r(n,!0,[t.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,$r(n,!0,t.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!0,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const r=t.geometry();if(0===r.length||0===r[0].length)return NaN;const n=kr(r,0).map((e=>e.map((e=>e.map((e=>rr([e.x,e.y],t.canonical))))))),i=new Ir(n[0][0][0][1]);let a=1/0;for(const t of e)for(const e of n){switch(t.type){case"Point":a=Math.min(a,Xr([t.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Xr(t.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Zr(e,t.coordinates,i,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Qr={"==":qe,"!=":He,">":Ze,"<":Ge,">=":Ye,"<=":We,array:de,at:we,boolean:de,case:Me,coalesce:Be,collator:Xe,format:Je,image:Ke,in:Te,"index-of":ke,interpolate:Fe,"interpolate-hcl":Fe,"interpolate-lab":Fe,length:Qe,let:_e,literal:he,match:Ae,number:de,"number-format":$e,object:de,slice:Se,step:Ce,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:be,within:vr,distance:Kr};class tn{constructor(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const r=t[0],n=tn.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[n,a]of o){s=new xe(e.registry,on,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(St).join(", ")})`:`(${St(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r{r=e?r&&on(t):r&&t instanceof he})),!!r&&sn(t)&&cn(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(t){if(t instanceof tn){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof vr)return!1;if(t instanceof Kr)return!1;let e=!0;return t.eachChild((t=>{e&&!sn(t)&&(e=!1)})),e}function ln(t){if(t instanceof tn&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!ln(t)&&(e=!1)})),e}function cn(t,e){if(t instanceof tn&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!cn(t,e)&&(r=!1)})),r}function un(t){return{result:"success",value:t}}function hn(t){return{result:"error",value:t}}function fn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function pn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function dn(t){return!!t.expression&&t.expression.interpolated}function mn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function gn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function yn(t){return t}function vn(t,e){const r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),a=t.type||(dn(e)?"exponential":"interval");if(r||"padding"===e.type){const n=r?Qt.parse:ne.parse;(t=ht({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],n(t[1])]))),t.default=n(t.default?t.default:e.default)}if(t.colorSpace&&"rgb"!==(o=t.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${t.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=wn;else if("interval"===a)s=bn;else if("categorical"===a){s=_n,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=Tn}if(n){const r={},n=[];for(let e=0;et[0])),evaluate:({zoom:r},n)=>wn({stops:i,base:t.base},e,r).evaluate(r,n)}}if(i){const r="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Fe.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>s(t,e,r,l,c)}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?xn(t.default,e.default):s(t,e,i,l,c)}}}function xn(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function _n(t,e,r,n,i){return xn(typeof r===i?n[r]:void 0,t.default,e.default)}function bn(t,e,r){if("number"!==mn(r))return xn(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const i=Ee(t.stops.map((t=>t[0])),r);return t.stops[i][1]}function wn(t,e,r){const n=void 0!==t.base?t.base:1;if("number"!==mn(r))return xn(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const a=Ee(t.stops.map((t=>t[0])),r),o=function(t,e,r,n){const i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=Re[e.type]||yn;return"function"==typeof s.evaluate?{evaluate(...e){const r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o,t.colorSpace)}}:c(s,l,o,t.colorSpace)}function Tn(t,e,r){switch(e.type){case"color":r=Qt.parse(r);break;case"formatted":r=re.fromString(r.toString());break;case"resolvedImage":r=oe.fromString(r.toString());break;case"padding":r=ne.parse(r);break;default:mn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0)}return xn(r,t.default,e.default)}tn.register(Qr,{error:[{kind:"error"},[gt],(t,[e])=>{throw new fe(e.evaluate(t))}],typeof:[gt,[_t],(t,[e])=>St(ce(e.evaluate(t)))],"to-rgba":[Mt(mt,4),[vt],(t,[e])=>{const[r,n,i,a]=e.evaluate(t).rgb;return[255*r,255*n,255*i,a]}],rgb:[vt,[mt,mt,mt],en],rgba:[vt,[mt,mt,mt,mt],en],has:{type:yt,overloads:[[[gt],(t,[e])=>rn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>rn(e.evaluate(t),r.evaluate(t))]]},get:{type:_t,overloads:[[[gt],(t,[e])=>nn(e.evaluate(t),t.properties())],[[gt,xt],(t,[e,r])=>nn(e.evaluate(t),r.evaluate(t))]]},"feature-state":[_t,[gt],(t,[e])=>nn(e.evaluate(t),t.featureState||{})],properties:[xt,[],t=>t.properties()],"geometry-type":[gt,[],t=>t.geometryType()],id:[_t,[],t=>t.id()],zoom:[mt,[],t=>t.globals.zoom],"heatmap-density":[mt,[],t=>t.globals.heatmapDensity||0],"line-progress":[mt,[],t=>t.globals.lineProgress||0],accumulated:[_t,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[mt,an(mt),(t,e)=>{let r=0;for(const n of e)r+=n.evaluate(t);return r}],"*":[mt,an(mt),(t,e)=>{let r=1;for(const n of e)r*=n.evaluate(t);return r}],"-":{type:mt,overloads:[[[mt,mt],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[mt],(t,[e])=>-e.evaluate(t)]]},"/":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[mt,[mt,mt],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[mt,[],()=>Math.LN2],pi:[mt,[],()=>Math.PI],e:[mt,[],()=>Math.E],"^":[mt,[mt,mt],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[mt,[mt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))],log2:[mt,[mt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[mt,[mt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[mt,[mt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[mt,[mt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[mt,[mt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[mt,[mt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[mt,[mt],(t,[e])=>Math.atan(e.evaluate(t))],min:[mt,an(mt),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[mt,an(mt),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[mt,[mt],(t,[e])=>Math.abs(e.evaluate(t))],round:[mt,[mt],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[mt,[mt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[mt,[mt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[yt,[gt,_t],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[yt,[_t],(t,[e])=>t.id()===e.value],"filter-type-==":[yt,[gt],(t,[e])=>t.geometryType()===e.value],"filter-<":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n{const r=t.id(),n=e.value;return typeof r==typeof n&&r":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[yt,[_t],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[yt,[_t],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[yt,[gt,_t],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[yt,[_t],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[yt,[_t],(t,[e])=>e.value in t.properties()],"filter-has-id":[yt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[yt,[Mt(gt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[yt,[Mt(_t)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[yt,[gt,Mt(_t)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[yt,[gt,Mt(_t)],(t,[e,r])=>function(t,e,r,n){for(;r<=n;){const i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[an(yt),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:yt,overloads:[[[yt,yt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[an(yt),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[yt,[yt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[yt,[gt],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[gt,[gt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[gt,[gt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[gt,an(_t),(t,e)=>e.map((e=>ue(e.evaluate(t)))).join("")],"resolved-locale":[gt,[bt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class kn{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new ve,this._defaultValue=e?"color"===(r=e).type&&gn(r.default)?new Qt(0,0,0,0):"color"===r.type?Qt.parse(r.default)||null:"padding"===r.type?ne.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?ae.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new fe(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function An(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Qr}function Mn(t,e){const r=new xe(Qr,on,[],e?function(t){const e={color:vt,string:gt,number:mt,enum:gt,boolean:yt,formatted:wt,padding:Tt,resolvedImage:kt,variableAnchorOffsetCollection:At};return"array"===t.type?Mt(e[t.value]||_t,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?un(new kn(n,e)):hn(r.errors)}class Sn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ln(e.expression)}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}}class En{constructor(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ln(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)}evaluate(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)}interpolationFactor(t,e,r){return this.interpolationType?Fe.interpolationFactor(this.interpolationType,t,e,r):0}}function Cn(t,e){const r=Mn(t,e);if("error"===r.result)return r;const n=r.value.expression,i=sn(n);if(!i&&!fn(e))return hn([new ft("","data expressions not supported")]);const a=cn(n,["zoom"]);if(!a&&!pn(e))return hn([new ft("","zoom expressions not supported")]);const o=Ln(n);return o||a?o instanceof ft?hn([o]):o instanceof Fe&&!dn(e)?hn([new ft("",'"interpolate" expressions cannot be used with this property')]):un(o?new En(i?"camera":"composite",r.value,o.labels,o instanceof Fe?o.interpolation:void 0):new Sn(i?"constant":"source",r.value)):hn([new ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class In{constructor(t,e){this._parameters=t,this._specification=e,ht(this,vn(this._parameters,this._specification))}static deserialize(t){return new In(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ln(t){let e=null;if(t instanceof _e)e=Ln(t.result);else if(t instanceof Be){for(const r of t.args)if(e=Ln(r),e)break}else(t instanceof Ce||t instanceof Fe)&&t.input instanceof tn&&"zoom"===t.input.name&&(e=t);return e instanceof ft||t.eachChild((t=>{const r=Ln(t);r instanceof ft?e=r:!e&&r?e=new ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new ft("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Pn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Pn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Dn(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Pn(t)||(t=Fn(t));const e=Mn(t,zn);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,r,n)=>e.value.evaluate(t,r,{},n),needGeometry:Rn(t)}}function On(t,e){return te?1:0}function Rn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?jn(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fn))):"all"===e?["all"].concat(t.slice(1).map(Fn)):"none"===e?["all"].concat(t.slice(1).map(Fn).map(Un)):"in"===e?Bn(t[1],t.slice(2)):"!in"===e?Un(Bn(t[1],t.slice(2))):"has"===e?Nn(t[1]):"!has"!==e||Un(Nn(t[1]));var r}function jn(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Bn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(On)]]:["filter-in-small",t,["literal",e]]}}function Nn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Un(t){return["!",t]}function Vn(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const r of t)e+=`${Vn(r)},`;return`${e}]`}const r=Object.keys(t).sort();let n="{";for(let e=0;en.maximum?[new ut(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function $n(t){const e=t.valueSpec,r=Gn(t.value.type);let n,i,a,o={};const s="categorical"!==r&&void 0===t.value.property,l=!s,c="array"===mn(t.value.stops)&&"array"===mn(t.value.stops[0])&&"object"===mn(t.value.stops[0][0]),u=Wn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===r)return[new ut(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(Yn({key:t.key,value:n,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===mn(n)&&0===n.length&&e.push(new ut(t.key,n,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===r&&s&&u.push(new ut(t.key,t.value,'missing required property "property"')),"identity"===r||t.value.stops||u.push(new ut(t.key,t.value,'missing required property "stops"')),"exponential"===r&&t.valueSpec.expression&&!dn(t.valueSpec)&&u.push(new ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!fn(t.valueSpec)?u.push(new ut(t.key,t.value,"property functions not supported")):s&&!pn(t.valueSpec)&&u.push(new ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==t.value.property||u.push(new ut(t.key,t.value,'"property" property is required')),u;function h(t){let r=[];const n=t.value,s=t.key;if("array"!==mn(n))return[new ut(s,n,`array expected, ${mn(n)} found`)];if(2!==n.length)return[new ut(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==mn(n[0]))return[new ut(s,n,`object expected, ${mn(n[0])} found`)];if(void 0===n[0].zoom)return[new ut(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ut(s,n,"object stop key must have value")];if(a&&a>Gn(n[0].zoom))return[new ut(s,n[0].zoom,"stop zoom values must appear in ascending order")];Gn(n[0].zoom)!==a&&(a=Gn(n[0].zoom),i=void 0,o={}),r=r.concat(Wn({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Xn,value:f}}))}else r=r.concat(f({key:`${s}[0]`,value:n[0],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},n));return An(Zn(n[1]))?r.concat([new ut(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(t.validateSpec({key:`${s}[1]`,value:n[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function f(t,a){const s=mn(t.value),l=Gn(t.value),c=null!==t.value?t.value:a;if(n){if(s!==n)return[new ut(t.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ut(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let n=`number expected, ${s} found`;return fn(e)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(t.key,c,n)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==i&&lnew ut(`${t.key}${e.key}`,t.value,e.message)));const r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new ut(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ln(r))return[new ut(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ut(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!sn(r))return[new ut(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Kn(t){const e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ut(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(t){return Pn(Zn(t.value))?Jn(ht({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ti(t)}function ti(t){const e=t.value,r=t.key;if("array"!==mn(e))return[new ut(r,e,`array expected, ${mn(e)} found`)];const n=t.styleSpec;let i,a=[];if(e.length<1)return[new ut(r,e,"filter array must have at least 1 element")];switch(a=a.concat(Kn({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Gn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Gn(e[1])&&a.push(new ut(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new ut(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=mn(e[1]),"string"!==i&&a.push(new ut(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let o=2;o{t in r&&e.push(new ut(n,r[t],`"${t}" is prohibited for ref layers`))})),i.layers.forEach((e=>{Gn(e.id)===s&&(t=e)})),t?t.ref?e.push(new ut(n,r.ref,"ref cannot reference another ref layer")):o=Gn(t.type):e.push(new ut(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){const t=i.sources&&i.sources[r.source],a=t&&Gn(t.type);t?"vector"===a&&"raster"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?e.push(new ut(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?e.push(new ut(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?e.push(new ut(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&t.lineMetrics||e.push(new ut(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ut(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new ut(n,r.source,`source "${r.source}" not found`))}else e.push(new ut(n,r,'missing required property "source"'));return e=e.concat(Wn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:t=>Wn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ni(ht({layerType:o},t))}}),paint:t=>Wn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>ri(ht({layerType:o},t))}})}})),e}function ai(t){const e=t.value,r=t.key,n=mn(e);return"string"!==n?[new ut(r,e,`string expected, ${n} found`)]:[]}const oi={promoteId:function({key:t,value:e}){if("string"===mn(e))return ai({key:t,value:e});{const r=[];for(const n in e)r.push(...ai({key:`${t}.${n}`,value:e[n]}));return r}}};function si(t){const e=t.value,r=t.key,n=t.styleSpec,i=t.style,a=t.validateSpec;if(!e.type)return[new ut(r,e,'"type" is required')];const o=Gn(e.type);let s;switch(o){case"vector":case"raster":return s=Wn({key:r,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),s;case"raster-dem":return s=function(t){var e;const r=null!==(e=t.sourceName)&&void 0!==e?e:"",n=t.value,i=t.styleSpec,a=i.source_raster_dem,o=t.style;let s=[];const l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ut("source_raster_dem",n,`object expected, ${l} found`)),s;const c="custom"===Gn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const e in n)!c&&u.includes(e)?s.push(new ut(e,n[e],`In "${r}": "${e}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[e]?s=s.concat(t.validateSpec({key:e,value:n[e],valueSpec:a[e],validateSpec:t.validateSpec,style:o,styleSpec:i})):s.push(new ut(e,n[e],`unknown property "${e}"`));return s}({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:a}),s;case"geojson":if(s=Wn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),e.cluster)for(const t in e.clusterProperties){const[n,i]=e.clusterProperties[t],o="string"==typeof n?[n,["accumulated"],["get",t]]:n;s.push(...Jn({key:`${r}.${t}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Jn({key:`${r}.${t}.reduce`,value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return Wn({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return Wn({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ut(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Kn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function li(t){const e=t.value,r=t.styleSpec,n=r.light,i=t.style;let a=[];const o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("light",e,`object expected, ${o} found`)]),a;for(const o in e){const s=o.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r}):n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(o,e[o],`unknown property "${o}"`)])}return a}function ci(t){const e=t.value,r=t.styleSpec,n=r.sky,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("sky",e,`object expected, ${a} found`)];let o=[];for(const a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ut(a,e[a],`unknown property "${a}"`)]);return o}function ui(t){const e=t.value,r=t.styleSpec,n=r.terrain,i=t.style;let a=[];const o=mn(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new ut("terrain",e,`object expected, ${o} found`)]),a;for(const o in e)a=a.concat(n[o]?t.validateSpec({key:o,value:e[o],valueSpec:n[o],validateSpec:t.validateSpec,style:i,styleSpec:r}):[new ut(o,e[o],`unknown property "${o}"`)]);return a}function hi(t){let e=[];const r=t.value,n=t.key;if(Array.isArray(r)){const i=[],a=[];for(const o in r)r[o].id&&i.includes(r[o].id)&&e.push(new ut(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&e.push(new ut(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),e=e.concat(Wn({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return ai({key:n,value:r})}const fi={"*":()=>[],array:Yn,boolean:function(t){const e=t.value,r=t.key,n=mn(e);return"boolean"!==n?[new ut(r,e,`boolean expected, ${n} found`)]:[]},number:Xn,color:function(t){const e=t.key,r=t.value,n=mn(r);return"string"!==n?[new ut(e,r,`color expected, ${n} found`)]:Qt.parse(String(r))?[]:[new ut(e,r,`color expected, "${r}" found`)]},constants:Hn,enum:Kn,filter:Qn,function:$n,layer:ii,object:Wn,source:si,light:li,sky:ci,terrain:ui,projection:function(t){const e=t.value,r=t.styleSpec,n=r.projection,i=t.style,a=mn(e);if(void 0===e)return[];if("object"!==a)return[new ut("projection",e,`object expected, ${a} found`)];let o=[];for(const a in e)o=o.concat(n[a]?t.validateSpec({key:a,value:e[a],valueSpec:n[a],style:i,styleSpec:r}):[new ut(a,e[a],`unknown property "${a}"`)]);return o},string:ai,formatted:function(t){return 0===ai(t).length?[]:Jn(t)},resolvedImage:function(t){return 0===ai(t).length?[]:Jn(t)},padding:function(t){const e=t.key,r=t.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ut(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let i=[];for(let a=0;a[]}})),t.constants&&(r=r.concat(Hn({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:pi}))),yi(r)}function gi(t){return function(e){return t(((t,e)=>r(t,i(e)))(((t,e)=>{for(var r in e||(e={}))l.call(e,r)&&u(t,r,e[r]);if(o)for(var r of o(e))c.call(e,r)&&u(t,r,e[r]);return t})({},e),{validateSpec:pi}))}}function yi(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function vi(t){return function(...e){return yi(t.apply(this,e))}}mi.source=vi(gi(si)),mi.sprite=vi(gi(hi)),mi.glyphs=vi(gi(di)),mi.light=vi(gi(li)),mi.sky=vi(gi(ci)),mi.terrain=vi(gi(ui)),mi.layer=vi(gi(ii)),mi.filter=vi(gi(Qn)),mi.paintProperty=vi(gi(ri)),mi.layoutProperty=vi(gi(ni));const xi=mi,_i=xi.light,bi=xi.sky,wi=xi.paintProperty,Ti=xi.layoutProperty;function ki(t,e){let r=!1;if(e&&e.length)for(const n of e)t.fire(new $(new Error(n.message))),r=!0;return r}class Ai{constructor(t,e,r){const n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(let t=0;t=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(t,e,r,n,i,a,o,s){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++){const c=this.d*l+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(l),this._convertFromCellCoord(f+1),this._convertFromCellCoord(l+1)))&&i.call(this,t,e,r,n,c,a,o,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let r=0;for(let t=0;t=0)continue;const a=t[n];i[n]=Mi[r].shallow.indexOf(n)>=0?a:Li(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Pi(t){if(Ii(t))return t;if(Array.isArray(t))return t.map(Pi);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=Ci(t)||"Object";if(!Mi[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Mi[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);const n=Object.create(r.prototype);for(const r of Object.keys(t)){if("$name"===r)continue;const i=t[r];n[r]=Mi[e].shallow.indexOf(r)>=0?i:Pi(i)}return n}class zi{constructor(){this.first=!0}update(t,e){const r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomt>=128&&t<=255,Oi=t=>t>=6016&&t<=6143,Ri=t=>t>=8192&&t<=8303,Fi=t=>t>=8448&&t<=8527,ji=t=>t>=8528&&t<=8591,Bi=t=>t>=8960&&t<=9215,Ni=t=>t>=9216&&t<=9279,Ui=t=>t>=9280&&t<=9311,Vi=t=>t>=9312&&t<=9471,qi=t=>t>=9632&&t<=9727,Hi=t=>t>=9728&&t<=9983,Gi=t=>t>=11008&&t<=11263,Zi=t=>t>=12272&&t<=12287,Wi=t=>t>=12288&&t<=12351,Yi=t=>t>=12448&&t<=12543,Xi=t=>t>=12688&&t<=12703,$i=t=>t>=12736&&t<=12783,Ji=t=>t>=12800&&t<=13055,Ki=t=>t>=13056&&t<=13311,Qi=t=>t>=19904&&t<=19967,ta=t=>t>=57344&&t<=63743,ea=t=>t>=65040&&t<=65055,ra=t=>t>=65072&&t<=65103,na=t=>t>=65104&&t<=65135,ia=t=>t>=65280&&t<=65519;function aa(t){for(const e of t)if(ha(e.charCodeAt(0)))return!0;return!1}function oa(t){for(const e of t)if(!ca(e.charCodeAt(0)))return!1;return!0}function sa(t){const e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}const la=sa(["Arab","Dupl","Mong","Ougr","Syrc"]);function ca(t){return!la.test(String.fromCodePoint(t))}const ua=sa(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ha(t){return!(746!==t&&747!==t&&(t<4352||!(ra(t)&&!(t>=65097&&t<=65103)||Ki(t)||$i(t)||!(!Wi(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ji(t)||Zi(t)||Xi(t)||Yi(t)&&12540!==t||!(!ia(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!na(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ea(t)||Qi(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||ua.test(String.fromCodePoint(t)))))}function fa(t){return!(ha(t)||(e=t,Di(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Ri(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Fi(e)||ji(e)||Bi(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ni(e)&&9251!==e||Ui(e)||Vi(e)||qi(e)||Hi(e)&&!(e>=9754&&e<=9759)||Gi(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Wi(e)||Yi(e)||ta(e)||ra(e)||na(e)||ia(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}const pa=sa(["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 da(t){return pa.test(String.fromCodePoint(t))}function ma(t,e){return!(!e&&da(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Oi(t))}function ga(t){for(const e of t)if(da(e.charCodeAt(0)))return!0;return!1}const ya=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class va{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(t){return function(t,e){for(const r of t)if(!ma(r.charCodeAt(0),e))return!1;return!0}(t,"loaded"===ya.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}}class xa{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new In(t,e);if(An(t)){const r=Cn(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"color"===e.type&&"string"==typeof t?r=Qt.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(r=ae.parse(t)):r=ne.parse(t),{kind:"constant",evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class _a{constructor(t){this.property=t,this.value=new xa(t,void 0)}transitioned(t,e){return new wa(this.property,this.value,e,T({},t.transition,this.transition),t.now)}untransitioned(){return new wa(this.property,this.value,null,{},0)}}class ba{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return S(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _a(this._values[t].property)),this._values[t].value=new xa(this._values[t].property,null===e?void 0:S(e))}getTransition(t){return S(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _a(this._values[t].property)),this._values[t].transition=S(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const r=new Ta(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){const t=new Ta(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class wa{constructor(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){const n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}}return i}}class Ta{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){const n=new Ma(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class ka{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return S(this._values[t].value)}setValue(t,e){this._values[t]=new xa(this._values[t].property,null===e?void 0:S(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){const n=new Ma(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class Aa{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class Ma{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Sa{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,r){const n=Re[this.specification.type];return n?n(t,e,r):t}}class Ea{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,r,n){return new Aa(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Aa(this,{kind:"constant",value:void 0},t.parameters);const n=Re[this.specification.type];if(n){const i=n(t.value.value,e.value.value,r);return new Aa(this,{kind:"constant",value:i},t.parameters)}return t}evaluate(t,e,r,n,i,a){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)}}class Ca extends Ea{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new Aa(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new Aa(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){const r=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Aa(this,{kind:"constant",value:r},e)}return new Aa(this,t.expression,e)}evaluate(t,e,r,n,i,a){if("source"===t.kind){const o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class Ia{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new va(Math.floor(e.zoom-1),e)),t.expression.evaluate(new va(Math.floor(e.zoom),e)),t.expression.evaluate(new va(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class La{constructor(t){this.specification=t}possiblyEvaluate(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)}interpolate(){return!1}}class Pa{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const r=t[e];r.specification.overridable&&this.overridableProperties.push(e);const n=this.defaultPropertyValues[e]=new xa(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new _a(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}Si("DataDrivenProperty",Ea),Si("DataConstantProperty",Sa),Si("CrossFadedDataDrivenProperty",Ca),Si("CrossFadedProperty",Ia),Si("ColorRampProperty",La);const za="-transition";class Da extends J{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ka(e.layout)),e.paint)){this._transitionablePaint=new ba(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ma(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,r={}){null!=e&&this._validate(Ti,`layers.${this.id}.layout.${t}`,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(za)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(null!=e&&this._validate(wi,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(za))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const o=this._transitionablePaint._values[t].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(t,a,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),M(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,r,n,i={}){return(!i||!1!==i.validate)&&ki(this,t.call(xi,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:K,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof Aa&&fn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const Oa={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ra{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ja(t,e=1){let r=0,n=0;return{members:t.map((t=>{const i=Oa[t.type].BYTES_PER_ELEMENT,a=r=Ba(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:Ba(r,Math.max(n,e)),alignment:e}}function Ba(t,e){return Math.ceil(t/e)*e}class Na extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}Na.prototype.bytesPerElement=4,Si("StructArrayLayout2i4",Na);class Ua extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Ua.prototype.bytesPerElement=6,Si("StructArrayLayout3i6",Ua);class Va extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t}}Va.prototype.bytesPerElement=8,Si("StructArrayLayout4i8",Va);class qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}qa.prototype.bytesPerElement=12,Si("StructArrayLayout2i4i12",qa);class Ha extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t}}Ha.prototype.bytesPerElement=8,Si("StructArrayLayout2i4ub8",Ha);class Ga extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}Ga.prototype.bytesPerElement=8,Si("StructArrayLayout2f8",Ga);class Za extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s,l,c)}emplace(t,e,r,n,i,a,o,s,l,c,u){const h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t}}Za.prototype.bytesPerElement=20,Si("StructArrayLayout10ui20",Za);class Wa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a,o,s,l,c,u,h){const f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,a,o,s,l,c,u,h)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=f,t}}Wa.prototype.bytesPerElement=24,Si("StructArrayLayout4i4ui4i24",Wa);class Ya extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}Ya.prototype.bytesPerElement=12,Si("StructArrayLayout3f12",Ya);class Xa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Xa.prototype.bytesPerElement=4,Si("StructArrayLayout1ul4",Xa);class $a extends Fa{_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,e,r,n,i,a,o,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,l)}emplace(t,e,r,n,i,a,o,s,l,c){const u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t}}$a.prototype.bytesPerElement=20,Si("StructArrayLayout6i1ul2ui20",$a);class Ja extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t}}Ja.prototype.bytesPerElement=12,Si("StructArrayLayout2i2i2i12",Ja);class Ka extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i)}emplace(t,e,r,n,i,a){const o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,t}}Ka.prototype.bytesPerElement=16,Si("StructArrayLayout2f1f2i16",Ka);class Qa extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)}emplace(t,e,r,n,i,a,o){const s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,t}}Qa.prototype.bytesPerElement=16,Si("StructArrayLayout2ub2f2i16",Qa);class to extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}to.prototype.bytesPerElement=6,Si("StructArrayLayout3ui6",to);class eo extends Fa{_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,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y){const v=24*t,x=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,t}}eo.prototype.bytesPerElement=48,Si("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",eo);class ro extends Fa{_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,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S){const E=this.length;return this.resize(E+1),this.emplace(E,t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S)}emplace(t,e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A,M,S,E){const C=32*t,I=16*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=f,this.uint16[C+12]=p,this.uint16[C+13]=d,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=_,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=k,this.float32[I+13]=A,this.float32[I+14]=M,this.uint16[C+30]=S,this.uint16[C+31]=E,t}}ro.prototype.bytesPerElement=64,Si("StructArrayLayout8i15ui1ul2f2ui64",ro);class no extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}no.prototype.bytesPerElement=4,Si("StructArrayLayout1f4",no);class io extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[6*t+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}io.prototype.bytesPerElement=12,Si("StructArrayLayout1ui2f12",io);class ao extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t}}ao.prototype.bytesPerElement=8,Si("StructArrayLayout1ul2ui8",ao);class oo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}oo.prototype.bytesPerElement=4,Si("StructArrayLayout2ui4",oo);class so extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}so.prototype.bytesPerElement=2,Si("StructArrayLayout1ui2",so);class lo extends Fa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t}}lo.prototype.bytesPerElement=16,Si("StructArrayLayout4f16",lo);class co extends Ra{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 h(this.anchorPointX,this.anchorPointY)}}co.prototype.size=20;class uo extends $a{get(t){return new co(this,t)}}Si("CollisionBoxArray",uo);class ho extends Ra{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]}}ho.prototype.size=48;class fo extends eo{get(t){return new ho(this,t)}}Si("PlacedSymbolArray",fo);class po extends Ra{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]}}po.prototype.size=64;class mo extends ro{get(t){return new po(this,t)}}Si("SymbolInstanceArray",mo);class go extends no{getoffsetX(t){return this.float32[1*t+0]}}Si("GlyphOffsetArray",go);class yo extends Ua{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Si("SymbolLineVertexArray",yo);class vo extends Ra{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]}}vo.prototype.size=12;class xo extends io{get(t){return new vo(this,t)}}Si("TextAnchorOffsetArray",xo);class _o extends Ra{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]}}_o.prototype.size=8;class bo extends ao{get(t){return new _o(this,t)}}Si("FeatureIndexArray",bo);class wo extends Na{}class To extends Na{}class ko extends Na{}class Ao extends qa{}class Mo extends Ha{}class So extends Ga{}class Eo extends Za{}class Co extends Wa{}class Io extends Ya{}class Lo extends Xa{}class Po extends Ja{}class zo extends Qa{}class Do extends to{}class Oo extends oo{}const Ro=ja([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fo}=Ro;class jo{constructor(t=[]){this.segments=t}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>jo.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${jo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>jo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,r,n){return new jo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function Bo(t,e){return 256*(t=b(Math.floor(t),0,255))+b(Math.floor(e),0,255)}jo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Si("SegmentVector",jo);const No=ja([{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 Uo={exports:{}},Vo={exports:function(t,e){var r,n,i,a,o,s,l,c;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,c=0;c>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}},qo={exports:function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}},Ho=Vo.exports,Go=qo.exports;Uo.exports=Ho,Uo.exports.murmur3=Ho,Uo.exports.murmur2=Go;var Zo=n(Uo.exports);class Wo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,r,n){this.ids.push(Yo(t)),this.positions.push(e,r,n)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=Yo(t);let r=0,n=this.ids.length-1;for(;r>1;this.ids[t]>=e?n=t:r=t+1}const i=[];for(;this.ids[r]===e;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(t,e){const r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Xo(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){const e=new Wo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Yo(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Zo(String(t))}function Xo(t,e,r,n){for(;r>1];let a=r-1,o=n+1;for(;;){do{a++}while(t[a]i);if(a>=o)break;$o(t,a,o),$o(e,3*a,3*o),$o(e,3*a+1,3*o+1),$o(e,3*a+2,3*o+2)}o-r`u_${t}`)),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return"color"===this.type?new ts(t,e):new Ko(t,e)}}class is{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)}getBinding(t,e,r){return"u_pattern"===r.substr(0,9)?new Qo(t,e):new Ko(t,e)}}class as{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,r,n,i){const a=this.paintVertexArray.length,o=this.expression.evaluate(new va(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o)}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)}_setPaintValue(t,e,r){if("color"===this.type){const n=rs(r);for(let r=t;r`u_${t}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(t,e,r,n,i){const a=this.expression.evaluate(new va(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new va(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o)}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a)}_setPaintValue(t,e,r,n){if("color"===this.type){const i=rs(r),a=rs(n);for(let r=t;r`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof as||r instanceof os)for(let e=0;e!0){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new ls(n,e,r);this.needsUpload=!1,this._featureMap=new Wo,this._bufferOffset=0}populatePaintArrays(t,e,r,n,i,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(t,this._featureMap,e,i,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function us(t,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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function hs(t,e,r){const n={color:{source:Ga,composite:lo},number:{source:no,composite:Ga}},i={"line-pattern":{source:Eo,composite:Eo},"fill-pattern":{source:Eo,composite:Eo},"fill-extrusion-pattern":{source:Eo,composite:Eo}}[t];return i&&i[r]||n[e][r]}Si("ConstantBinder",ns),Si("CrossFadedConstantBinder",is),Si("SourceExpressionBinder",as),Si("CrossFadedCompositeBinder",ss),Si("CompositeExpressionBinder",os),Si("ProgramConfiguration",ls,{omit:["_buffers"]}),Si("ProgramConfigurationSet",cs);const fs=8192,ps=Math.pow(2,14)-1,ds=-ps-1;function ms(t){const e=fs/t.extent,r=t.loadGeometry();for(let t=0;tr.x+1||ar.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function gs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ms(t):[]}}function ys(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}class vs{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new To,this.indexArray=new Do,this.segments=new jo,this.programConfigurations=new cs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){const n=this.layers[0],i=[];let a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(const{feature:e,id:n,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=gs(e,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),c,r))continue;const u=o?a.evaluate(c,{},r):void 0,h={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ms(e),patterns:{},sortKey:u};i.push(h)}o&&i.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of i){const{geometry:i,index:a,sourceLayerIndex:o}=n,s=t[a].feature;this.addFeature(n,i,a,r),e.featureIndex.insert(s,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fo),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,e,r,n){for(const r of e)for(const e of r){const r=e.x,n=e.y;if(r<0||r>=fs||n<0||n>=fs)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=i.vertexLength;ys(this.layoutVertexArray,r,n,-1,-1),ys(this.layoutVertexArray,r,n,1,-1),ys(this.layoutVertexArray,r,n,1,1),ys(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)}}function xs(t,e){for(let r=0;r1){if(Ts(t,e))return!0;for(let n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Ss(t,e){let r,n,i,a=!1;for(let o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Es(t,e){let r=!1;for(let n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Cs(t,e,r){const n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;const a=I(t,e,r[0]);return a!==I(t,e,r[1])||a!==I(t,e,r[2])||a!==I(t,e,r[3])}function Is(t,e,r){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ls(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ps(t,e,r,n,i){if(!e[0]&&!e[1])return t;const a=h.convert(e)._mult(i);"viewport"===r&&a._rotate(-n);const o=[];for(let e=0;eHs(t,p)))),f=u?c*o:c;var p;for(const t of n)for(const e of t){const t=u?e:Hs(e,s);let r=f;const n=Vs([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),_s(h,t,r))return!0}return!1}}function Hs(t,e){const r=Vs([],[t.x,t.y,0,1],e);return new h(r[0]/r[3],r[1]/r[3])}class Gs extends vs{}let Zs;Si("HeatmapBucket",Gs,{omit:["layers"]});var Ws={get paint(){return Zs=Zs||new Pa({"heatmap-radius":new Ea(K.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ea(K.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Sa(K.paint_heatmap["heatmap-intensity"]),"heatmap-color":new La(K.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Sa(K.paint_heatmap["heatmap-opacity"])})}};function Ys(t,{width:e,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`)}else i=new Uint8Array(e*r*n);return t.width=e,t.height=r,t.data=i,t}function Xs(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;const i=Ys({},{width:e,height:r},n);$s(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function $s(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=a;const o=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(t.clips)for(let e=0,i=0;e80*r){s=1/0,l=1/0;let e=-1/0,n=-1/0;for(let a=r;ae&&(e=r),i>n&&(n=i)}c=Math.max(e-s,n-l),c=0!==c?32767/c:0}return ul(a,o,r,s,l,c,0),o}function ll(t,e,r,n,i){let a;if(i===function(t,e,r,n){let i=0;for(let a=e,o=r-n;a0)for(let i=e;i=e;i-=n)a=Cl(i/n|0,t[i],t[i+1],a);return a&&Tl(a,a.next)&&(Il(a),a=a.next),a}function cl(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!Tl(n,n.next)&&0!==wl(n.prev,n,n.next))n=n.next;else{if(Il(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function ul(t,e,r,n,i,a,o){if(!t)return;!o&&a&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=vl(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let a=null;for(e=0;i;){e++;let o=i,s=0;for(let t=0;t0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,a);let s=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?fl(t,n,i,a):hl(t))e.push(l.i,t.i,c.i),Il(t),t=c.next,s=c.next;else if((t=c)===s){o?1===o?ul(t=pl(cl(t),e),e,r,n,i,a,2):2===o&&dl(t,e,r,n,i,a):ul(cl(t),e,r,n,i,a,1);break}}}function hl(t){const e=t.prev,r=t,n=t.next;if(wl(e,r,n)>=0)return!1;const i=e.x,a=r.x,o=n.x,s=e.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,p=s>l?s>c?s:c:l>c?l:c;let d=n.next;for(;d!==e;){if(d.x>=u&&d.x<=f&&d.y>=h&&d.y<=p&&_l(i,s,a,l,o,c,d.x,d.y)&&wl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function fl(t,e,r,n){const i=t.prev,a=t,o=t.next;if(wl(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,f=o.y,p=sl?s>c?s:c:l>c?l:c,g=u>h?u>f?u:f:h>f?h:f,y=vl(p,d,e,r,n),v=vl(m,g,e,r,n);let x=t.prevZ,_=t.nextZ;for(;x&&x.z>=y&&_&&_.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,f,x.x,x.y)&&wl(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&_l(s,u,l,h,c,f,_.x,_.y)&&wl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,f,x.x,x.y)&&wl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=v;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=g&&_!==i&&_!==o&&_l(s,u,l,h,c,f,_.x,_.y)&&wl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function pl(t,e){let r=t;do{const n=r.prev,i=r.next.next;!Tl(n,i)&&kl(n,r,r.next,i)&&Sl(n,i)&&Sl(i,n)&&(e.push(n.i,r.i,i.i),Il(r),Il(r.next),r=t=i),r=r.next}while(r!==t);return cl(r)}function dl(t,e,r,n,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&bl(o,t)){let s=El(o,t);return o=cl(o,o.next),s=cl(s,s.next),ul(o,e,r,n,i,a,0),void ul(s,e,r,n,i,a,0)}t=t.next}o=o.next}while(o!==t)}function ml(t,e){return t.x-e.x}function gl(t,e){const r=function(t,e){let r=e;const n=t.x,i=t.y;let a,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>o&&(o=t,a=r.x=r.x&&r.x>=l&&n!==r.x&&_l(ia.x||r.x===a.x&&yl(a,r)))&&(a=r,u=e)}r=r.next}while(r!==s);return a}(t,e);if(!r)return e;const n=El(r,t);return cl(n,n.next),cl(r,r.next)}function yl(t,e){return wl(t.prev,t,e.prev)<0&&wl(e.next,t,t.next)<0}function vl(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function xl(t){let e=t,r=t;do{(e.x=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function bl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&kl(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Sl(t,e)&&Sl(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(wl(t.prev,t,e.prev)||wl(t,e.prev,e))||Tl(t,e)&&wl(t.prev,t,t.next)>0&&wl(e.prev,e,e.next)>0)}function wl(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Tl(t,e){return t.x===e.x&&t.y===e.y}function kl(t,e,r,n){const i=Ml(wl(t,e,r)),a=Ml(wl(t,e,n)),o=Ml(wl(r,n,t)),s=Ml(wl(r,n,e));return i!==a&&o!==s||!(0!==i||!Al(t,r,e))||!(0!==a||!Al(t,n,e))||!(0!==o||!Al(r,t,n))||!(0!==s||!Al(r,e,n))}function Al(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ml(t){return t>0?1:t<0?-1:0}function Sl(t,e){return wl(t.prev,t,t.next)<0?wl(t,e,t.next)>=0&&wl(t,t.prev,e)>=0:wl(t,e,t.prev)<0||wl(t,t.next,e)<0}function El(t,e){const r=Ll(t.i,t.x,t.y),n=Ll(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Cl(t,e,r,n){const i=Ll(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Il(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ll(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Pl(t,e,r){const n=r.patternDependencies;let i=!1;for(const r of e){const e=r.paint.get(`${t}-pattern`);e.isConstant()||(i=!0);const a=e.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function zl(t,e,r,n,i){const a=i.patternDependencies;for(const o of e){const e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},r,{},i.availableImages),s=e.evaluate({zoom:n},r,{},i.availableImages),l=e.evaluate({zoom:n+1},r,{},i.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[t]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:t,mid:s,max:l}}}return r}class Dl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ko,this.indexArray=new Do,this.indexArray2=new Oo,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new jo,this.segments2=new jo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=Pl("fill",this.layers,e);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,u=gs(o,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;const h=i?n.evaluate(u,{},r,e.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:ms(o),patterns:{},sortKey:h};a.push(f)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of a){const{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){const t=zl("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ol),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,e,r,n,i){for(const t of kr(e,500)){let e=0;for(const r of t)e+=r.length;const r=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],a=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&a.push(i.length/2);const r=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),i.push(e[0].x),i.push(e[0].y);for(let t=1;t>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new ql(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},Gl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Gl.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=Gl.types[this.type];function u(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}$l.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Yl(this._pbf,e,this.extent,this._keys,this._values)};var Kl=Xl;function Ql(t,e,r){if(3===t){var n=new Kl(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Vl.VectorTile=function(t,e){this.layers=t.readFields(Ql,{},e)},Vl.VectorTileFeature=Hl,Vl.VectorTileLayer=Xl;const tc=Vl.VectorTileFeature.types,ec=Math.pow(2,13);function rc(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*ec)+o,i*ec*2,a*ec*2,Math.round(s))}class nc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ao,this.centroidVertexArray=new wo,this.indexArray=new Do,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new jo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.features=[],this.hasPattern=Pl("fill-extrusion",this.layers,e);for(const{feature:n,id:i,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,s=gs(n,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),s,r))continue;const l={id:i,sourceLayerIndex:o,index:a,geometry:t?s.geometry:ms(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(zl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,a,r,{}),e.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(t,e,r){for(const t of this.features){const{geometry:n}=t;this.addFeature(t,n,t.index,e,r)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ul),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Nl.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,e,r,n,i){for(const r of kr(e,500)){const e={x:0,y:0,vertexCount:0};let n=0;for(const t of r)n+=t.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const t of r){if(0===t.length)continue;if(ac(t))continue;let r=0;for(let n=0;n=1){const o=t[n-1];if(!ic(a,o)){i.vertexLength+4>jo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=a.sub(o)._perp()._unit(),n=o.dist(a);r+n>32768&&(r=0),rc(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,r),rc(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,r),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2,r+=n,rc(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,r),rc(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,1,r),e.x+=2*o.x,e.y+=2*o.y,e.vertexCount+=2;const s=i.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+n>jo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(n,this.layoutVertexArray,this.indexArray)),"Polygon"!==tc[t.type])continue;const a=[],o=[],s=i.vertexLength;for(const t of r)if(0!==t.length){t!==r[0]&&o.push(a.length/2);for(let r=0;rfs)||t.y===e.y&&(t.y<0||t.y>fs)}function ac(t){return t.every((t=>t.x<0))||t.every((t=>t.x>fs))||t.every((t=>t.y<0))||t.every((t=>t.y>fs))}let oc;Si("FillExtrusionBucket",nc,{omit:["layers","features"]});var sc={get paint(){return oc=oc||new Pa({"fill-extrusion-opacity":new Sa(K["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ea(K["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Sa(K["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Sa(K["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ca(K["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ea(K["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ea(K["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Sa(K["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class lc extends Da{constructor(t){super(t,sc)}createBucket(t){return new nc(t)}queryRadius(){return Ls(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,r,n,i,a,o,s){const l=Ps(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),c=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),f=function(t,e){const r=[];for(const n of t){const t=[n.x,n.y,0,1];Vs(t,t,e),r.push(new h(t[0]/t[3],t[1]/t[3]))}return r}(l,s),p=function(t,e,r,n){const i=[],a=[],o=n[8]*e,s=n[9]*e,l=n[10]*e,c=n[11]*e,u=n[8]*r,f=n[9]*r,p=n[10]*r,d=n[11]*r;for(const e of t){const t=[],r=[];for(const i of e){const e=i.x,a=i.y,m=n[0]*e+n[4]*a+n[12],g=n[1]*e+n[5]*a+n[13],y=n[2]*e+n[6]*a+n[14],v=n[3]*e+n[7]*a+n[15],x=y+l,_=v+c,b=m+u,w=g+f,T=y+p,k=v+d,A=new h((m+o)/_,(g+s)/_);A.z=x/_,t.push(A);const M=new h(b/k,w/k);M.z=T/k,r.push(M)}i.push(t),a.push(r)}return[i,a]}(n,u,c,s);return function(t,e,r){let n=1/0;bs(r,e)&&(n=uc(r,e[0]));for(let i=0;it.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Mo,this.layoutVertexArray2=new So,this.indexArray=new Do,this.programConfigurations=new cs(t.layers,t.zoom),this.segments=new jo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,r){this.hasPattern=Pl("line",this.layers,e);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(const{feature:e,id:o,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=gs(e,t);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),c,r))continue;const u=i?n.evaluate(c,{},r):void 0,h={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:ms(e),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of a){const{geometry:i,index:a,sourceLayerIndex:o}=n;if(this.hasPattern){const t=zl("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,i,a,r,{});e.featureIndex.insert(t[a].feature,i,a,o,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)}addFeatures(t,e,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,dc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fc),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,e,r,n,i){const a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const r of e)this.addLine(r,t,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)}addLine(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l0;if(b&&e>l){const t=h.dist(f);if(t>2*c){const e=h.sub(h.sub(f)._mult(c/t)._round());this.updateDistance(f,e),this.addCurrentVertex(e,d,0,0,u),f=e}}const T=f&&p;let k=T?r:o?"butt":n;if(T&&"round"===k&&(xi&&(k="bevel"),"bevel"===k&&(x>2&&(k="flipbevel"),x100)g=m.mult(-1);else{const t=x*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===k||"fakeround"===k){const t=-Math.sqrt(x*x-1),e=w?t:0,r=w?0:t;if(f&&this.addCurrentVertex(h,d,e,r,u),"fakeround"===k){const t=Math.round(180*_/Math.PI/20);for(let e=1;e2*c){const e=h.add(p.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}}}addCurrentVertex(t,e,r,n,i,a=!1){const o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>yc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,n,i,a))}addHalfVertex({x:t,y:e},r,n,i,a,o,s){const l=.5*(this.lineClips?this.scaledDistance*(yc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),a?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}let xc,_c;Si("LineBucket",vc,{omit:["layers","patternFeatures"]});var bc={get paint(){return _c=_c||new Pa({"line-opacity":new Ea(K.paint_line["line-opacity"]),"line-color":new Ea(K.paint_line["line-color"]),"line-translate":new Sa(K.paint_line["line-translate"]),"line-translate-anchor":new Sa(K.paint_line["line-translate-anchor"]),"line-width":new Ea(K.paint_line["line-width"]),"line-gap-width":new Ea(K.paint_line["line-gap-width"]),"line-offset":new Ea(K.paint_line["line-offset"]),"line-blur":new Ea(K.paint_line["line-blur"]),"line-dasharray":new Ia(K.paint_line["line-dasharray"]),"line-pattern":new Ca(K.paint_line["line-pattern"]),"line-gradient":new La(K.paint_line["line-gradient"])})},get layout(){return xc=xc||new Pa({"line-cap":new Sa(K.layout_line["line-cap"]),"line-join":new Ea(K.layout_line["line-join"]),"line-miter-limit":new Sa(K.layout_line["line-miter-limit"]),"line-round-limit":new Sa(K.layout_line["line-round-limit"]),"line-sort-key":new Ea(K.layout_line["line-sort-key"])})}};class wc extends Ea{possiblyEvaluate(t,e){return e=new va(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=T({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}let Tc;class kc extends Da{constructor(t){super(t,bc),this.gradientVersion=0,Tc||(Tc=new wc(bc.paint.properties["line-width"].specification),Tc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!(void 0===t._styleExpression)&&t._styleExpression.expression instanceof Ce,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Tc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new vc(t)}queryRadius(t){const e=t,r=Ac(Is("line-width",this,e),Is("line-gap-width",this,e)),n=Is("line-offset",this,e);return r/2+Math.abs(n)+Ls(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,a,o){const s=Ps(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Ac(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){const r=[];for(let n=0;n=3)for(let e=0;e0?e+2*t:t}const Mc=ja([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Sc=ja([{name:"a_projected_pos",components:3,type:"Float32"}],4);ja([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ec=ja([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ja([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Cc=ja([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ic=ja([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Lc(t,e,r){return t.sections.forEach((t=>{t.text=function(t,e,r){const n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ya.applyArabicShaping&&(t=ya.applyArabicShaping(t)),t}(t.text,e,r)})),t}ja([{name:"triangle",components:3,type:"Uint16"}]),ja([{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"}]),ja([{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"}]),ja([{type:"Float32",name:"offsetX"}]),ja([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ja([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Pc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var zc=24,Dc=Fc,Oc=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},Rc=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m};function Fc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Fc.Varint=0,Fc.Fixed64=1,Fc.Bytes=2,Fc.Fixed32=5;var jc=4294967296,Bc=1/jc,Nc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Uc(t){return t.type===Fc.Bytes?t.readVarint()+t.pos:t.pos+1}function Vc(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function qc(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Hc(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function eu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Fc.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Qc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=eu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Qc(this.buf,this.pos)+Qc(this.buf,this.pos+4)*jc;return this.pos+=8,t},readSFixed64:function(){var t=Qc(this.buf,this.pos)+eu(this.buf,this.pos+4)*jc;return this.pos+=8,t},readFloat:function(){var t=Oc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Oc(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return Vc(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return Vc(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return Vc(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t,e,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Nc?(t=this.buf,e=i,r=n,Nc.decode(t.subarray(e,r))):function(t,e,r){for(var n="",i=e;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=t[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Fc.Bytes)return t.push(this.readVarint(e));var r=Uc(this);for(t=t||[];this.pos127;);else if(e===Fc.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Fc.Fixed32)this.pos+=4;else{if(e!==Fc.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n,i,a;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=r,(a=e).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&qc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Rc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Rc(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&qc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Fc.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Hc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Gc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Yc,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Zc,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Wc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Xc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,$c,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Jc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Kc,e)},writeBytesField:function(t,e){this.writeTag(t,Fc.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Fc.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Fc.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Fc.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Fc.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Fc.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Fc.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Fc.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Fc.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Fc.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ru,nu=n(Dc);function iu(t,e,r){1===t&&r.readMessage(au,e)}function au(t,e,r){if(3===t){const{id:t,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(ou,{});e.push({id:t,bitmap:new Js({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function ou(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function su(t){let e=0,r=0;for(const n of t)e+=n.w*n.h,r=Math.max(r,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let i=0,a=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const r=n[t];if(!(e.w>r.w||e.h>r.h)){if(e.x=r.x,e.y=r.y,a=Math.max(a,e.y+e.h),i=Math.max(i,e.x+e.w),e.w===r.w&&e.h===r.h){const e=n.pop();t=0&&r>=t&&du[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const r=new fu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(hu.forText(t.scale,t.fontStack||e));const r=this.sections.length-1;for(let e=0;e=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function pu(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m){const g=fu.fromFeature(e,a);let y;f===t.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:x}=ya;if(v&&1===g.sections.length){y=[];const t=v(g.toString(),wu(g,u,o,r,i,d));for(const e of t){const t=new fu;t.text=e,t.sections=g.sections;for(let r=0;r0&&n>w&&(w=n)}else{const t=n[m.fontStack],e=t&&t[y];if(e&&e.rect)T=e.rect,_=e.metrics;else{const t=r[m.fontStack],e=t&&t[y];if(!e)continue;_=e.metrics}v=(a-m.scale)*zc}M?(e.verticalizable=!0,b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=A*m.scale+u):(b.push({glyph:y,imageName:k,x:p,y:d+v,vertical:M,scale:m.scale,fontStack:m.fontStack,sectionIndex:g,metrics:_,rect:T}),p+=_.advance*m.scale+u)}0!==b.length&&(m=Math.max(p-u,m),ku(b,0,b.length-1,y,w)),p=0;const T=o*a+w;_.lineOffset=Math.max(w,l),d+=T,g=Math.max(T,g),++v}var x;const _=d-uu,{horizontalAlign:b,verticalAlign:w}=Tu(s);(function(t,e,r,n,i,a,o,s,l){const c=(e-r)*i;let u=0;u=a!==o?-s*n-uu:(-n*l+.5)*o;for(const e of t)for(const t of e.positionedGlyphs)t.x+=c,t.y+=u})(e.positionedLines,y,b,w,m,g,o,_,a.length),e.top+=-w*_,e.bottom=e.top+_,e.left+=-b*m,e.right=e.left+m}(b,r,n,i,y,s,l,c,f,u,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(_)&&b}const du={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},mu={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},gu={40:!0};function yu(t,e,r,n,i,a){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*zc/a+i:0}{const n=r[e.fontStack],a=n&&n[t];return a?a.metrics.advance*e.scale+i:0}}function vu(t,e,r,n){const i=Math.pow(t-e,2);return n?t=0;let c=0;for(let r=0;rc){const t=Math.ceil(a/c);i*=t/o,o=t}return{x1:n,y1:i,x2:n+a,y2:i+o}}function Su(t,e,r,n,i,a){const o=t.image;let s;if(o.content){const t=o.content,e=o.pixelRatio||1;s=[t[0]/e,t[1]/e,o.displaySize[0]-t[2]/e,o.displaySize[1]-t[3]/e]}const l=e.left*a,c=e.right*a;let u,h,f,p;"width"===r||"both"===r?(p=i[0]+l-n[3],h=i[0]+c+n[1]):(p=i[0]+(l+c-o.displaySize[0])/2,h=p+o.displaySize[0]);const d=e.top*a,m=e.bottom*a;return"height"===r||"both"===r?(u=i[1]+d-n[0],f=i[1]+m+n[2]):(u=i[1]+(d+m-o.displaySize[1])/2,f=u+o.displaySize[1]),{image:o,top:u,right:h,bottom:f,left:p,collisionPadding:s}}const Eu=128,Cu=32640;function Iu(t,e){const{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new va(t+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=r;let i=0;for(;it.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=js([]),this.placementViewportMatrix=js([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Iu(this.zoom,r["text-size"]),this.iconSizeData=Iu(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==Lu(n,"text-overlap","text-allow-overlap")||"never"!==Lu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((e=>t.ah[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Fu(new cs(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Fu(new cs(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new go,this.lineVertexArray=new yo,this.symbolInstances=new mo,this.textAnchorOffsets=new xo}calculateGlyphDependencies(t,e,r,n,i){for(let a=0;a0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const f=r.iconDependencies,p=r.glyphDependencies,d=r.availableImages,m=new va(this.zoom);for(const{feature:r,id:s,index:l,sourceLayerIndex:g}of e){const e=i._featureFilter.needGeometry,y=gs(r,e);if(!i._featureFilter.filter(m,y,n))continue;let v,x;if(e||(y.geometry=ms(r)),c){const t=i.getValueAndResolveTokens("text-field",y,n,d),e=re.factory(t),r=this.hasRTLText=this.hasRTLText||Ru(e);(!r||"unavailable"===ya.getRTLTextPluginStatus()||r&&ya.isParsed())&&(v=Lc(e,i,y))}if(u){const t=i.getValueAndResolveTokens("icon-image",y,n,d);x=t instanceof oe?t:oe.fromString(t)}if(!v&&!x)continue;const _=this.sortFeaturesByKey?h.evaluate(y,{},n):void 0;if(this.features.push({id:s,text:v,icon:x,index:l,sourceLayerIndex:g,geometry:y.geometry,properties:r.properties,type:Pu[r.type],sortKey:_}),x&&(f[x.name]=!0),v){const e=o.evaluate(y,{},n).join(","),r="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(const t of v.sections)if(t.image)f[t.image.name]=!0;else{const n=aa(v.toString()),i=t.fontStack||e,a=p[i]=p[i]||{};this.calculateGlyphDependencies(t.text,a,r,this.allowVerticalPlacement,n)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){const e={},r={},n=[];let i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){const a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){const a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){const n=r?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;ct.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!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,e){const r=this.lineVertexArray.length;if(void 0!==t.segment){let r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]);const i={};for(let n=t.segment+1;n=0;r--)i[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=e[r-1].dist(e[r]));for(let t=0;t0}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,e){const r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let e=r.vertexStartIndex;en[t]-n[e]||i[e]-i[t])),a}addToSortKeyRanges(t,e){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,r)=>{t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Nu,Uu;Si("SymbolBucket",Bu,{omit:["layers","collisionBoxArray","features","compareText"]}),Bu.MAX_GLYPHS=65535,Bu.addDynamicAttributes=Ou;var Vu={get paint(){return Uu=Uu||new Pa({"icon-opacity":new Ea(K.paint_symbol["icon-opacity"]),"icon-color":new Ea(K.paint_symbol["icon-color"]),"icon-halo-color":new Ea(K.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ea(K.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ea(K.paint_symbol["icon-halo-blur"]),"icon-translate":new Sa(K.paint_symbol["icon-translate"]),"icon-translate-anchor":new Sa(K.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ea(K.paint_symbol["text-opacity"]),"text-color":new Ea(K.paint_symbol["text-color"],{runtimeType:vt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ea(K.paint_symbol["text-halo-color"]),"text-halo-width":new Ea(K.paint_symbol["text-halo-width"]),"text-halo-blur":new Ea(K.paint_symbol["text-halo-blur"]),"text-translate":new Sa(K.paint_symbol["text-translate"]),"text-translate-anchor":new Sa(K.paint_symbol["text-translate-anchor"])})},get layout(){return Nu=Nu||new Pa({"symbol-placement":new Sa(K.layout_symbol["symbol-placement"]),"symbol-spacing":new Sa(K.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Sa(K.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ea(K.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Sa(K.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Sa(K.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Sa(K.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Sa(K.layout_symbol["icon-ignore-placement"]),"icon-optional":new Sa(K.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Sa(K.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ea(K.layout_symbol["icon-size"]),"icon-text-fit":new Sa(K.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Sa(K.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ea(K.layout_symbol["icon-image"]),"icon-rotate":new Ea(K.layout_symbol["icon-rotate"]),"icon-padding":new Ea(K.layout_symbol["icon-padding"]),"icon-keep-upright":new Sa(K.layout_symbol["icon-keep-upright"]),"icon-offset":new Ea(K.layout_symbol["icon-offset"]),"icon-anchor":new Ea(K.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Sa(K.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Sa(K.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Sa(K.layout_symbol["text-rotation-alignment"]),"text-field":new Ea(K.layout_symbol["text-field"]),"text-font":new Ea(K.layout_symbol["text-font"]),"text-size":new Ea(K.layout_symbol["text-size"]),"text-max-width":new Ea(K.layout_symbol["text-max-width"]),"text-line-height":new Sa(K.layout_symbol["text-line-height"]),"text-letter-spacing":new Ea(K.layout_symbol["text-letter-spacing"]),"text-justify":new Ea(K.layout_symbol["text-justify"]),"text-radial-offset":new Ea(K.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Sa(K.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ea(K.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ea(K.layout_symbol["text-anchor"]),"text-max-angle":new Sa(K.layout_symbol["text-max-angle"]),"text-writing-mode":new Sa(K.layout_symbol["text-writing-mode"]),"text-rotate":new Ea(K.layout_symbol["text-rotate"]),"text-padding":new Sa(K.layout_symbol["text-padding"]),"text-keep-upright":new Sa(K.layout_symbol["text-keep-upright"]),"text-transform":new Ea(K.layout_symbol["text-transform"]),"text-offset":new Ea(K.layout_symbol["text-offset"]),"text-allow-overlap":new Sa(K.layout_symbol["text-allow-overlap"]),"text-overlap":new Sa(K.layout_symbol["text-overlap"]),"text-ignore-placement":new Sa(K.layout_symbol["text-ignore-placement"]),"text-optional":new Sa(K.layout_symbol["text-optional"])})}};class qu{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.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}}Si("FormatSectionOverride",qu,{omit:["defaultValue"]});class Hu extends Da{constructor(t){super(t,Vu)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const r of t)e.indexOf(r)<0&&e.push(r);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,r,n){const i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||An(a.value)||!i?i:(o=e.properties,i.replace(/{([^{}]+)}/g,((t,e)=>o&&e in o?String(o[e]):"")));var o}createBucket(t){return new Bu(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Vu.paint.overridableProperties){if(!Hu.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),r=new qu(e),n=new kn(r,e.property.specification);let i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Sn("source",n):new En("composite",n,e.value.zoomStops),this.paint._values[t]=new Aa(e.property,i,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&Hu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const r=t.get("text-field"),n=Vu.paint.properties[e];let i=!1;const a=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof re)a(r.value.value.sections);else if("source"===r.value.kind){const t=e=>{i||(e instanceof he&&ce(e.value)===wt?a(e.value.sections):e instanceof Je?a(e.sections):e.eachChild(t))},e=r.value;e._styleExpression&&t(e._styleExpression.expression)}return i}}let Gu;var Zu={get paint(){return Gu=Gu||new Pa({"background-color":new Sa(K.paint_background["background-color"]),"background-pattern":new Ia(K.paint_background["background-pattern"]),"background-opacity":new Sa(K.paint_background["background-opacity"])})}};class Wu extends Da{constructor(t){super(t,Zu)}}let Yu;var Xu={get paint(){return Yu=Yu||new Pa({"raster-opacity":new Sa(K.paint_raster["raster-opacity"]),"raster-hue-rotate":new Sa(K.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Sa(K.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Sa(K.paint_raster["raster-brightness-max"]),"raster-saturation":new Sa(K.paint_raster["raster-saturation"]),"raster-contrast":new Sa(K.paint_raster["raster-contrast"]),"raster-resampling":new Sa(K.paint_raster["raster-resampling"]),"raster-fade-duration":new Sa(K.paint_raster["raster-fade-duration"])})}};class $u extends Da{constructor(t){super(t,Xu)}}class Ju extends Da{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Ku{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(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=()=>{}}}const Qu=6371008.8;class th{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new th(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Qu*Math.acos(Math.min(i,1))}static convert(t){if(t instanceof th)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new th(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new th(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 [, ]")}}const eh=2*Math.PI*Qu;function rh(t){return eh*Math.cos(t*Math.PI/180)}function nh(t){return(180+t)/360}function ih(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ah(t,e){return t/rh(e)}function oh(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class sh{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r}static fromLngLat(t,e=0){const r=th.convert(t);return new sh(nh(r.lng),ih(r.lat),ah(e,r.lat))}toLngLat(){return new th(360*this.x-180,oh(this.y))}toAltitude(){return this.z*rh(oh(this.y))}meterInMercatorCoordinateUnits(){return 1/eh*(t=oh(this.y),1/Math.cos(t*Math.PI/180));var t}}function lh(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ch{constructor(t,e,r){if(i=e,a=r,(n=t)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);var n,i,a;this.z=t,this.x=e,this.y=r,this.key=fh(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){const n=(a=this.y,o=this.z,s=lh(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=lh(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;const c=function(t,e,r){let n,i="";for(let a=t;a>0;a--)n=1<1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new h((t.x*e-this.x)*fs,(t.y*e-this.y)*fs)}toString(){return`${this.z}/${this.x}/${this.y}`}}class uh{constructor(t,e){this.wrap=t,this.canonical=e,this.key=fh(t,e.z,e.z,e.x,e.y)}}class hh{constructor(t,e,r,n,i){if(t= z; overscaledZ = ${t}; z = ${r}`);this.overscaledZ=t,this.wrap=e,this.canonical=new ch(r,+n,+i),this.key=fh(e,t,r,n,i)}clone(){return new hh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new hh(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new hh(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?fh(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):fh(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new hh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new hh(e,this.wrap,e,r,n),new hh(e,this.wrap,e,r+1,n),new hh(e,this.wrap,e,r,n+1),new hh(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.ythis.max&&(this.max=r),r=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,r){return t*this.redFactor+e*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Ks({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}const s=-e*this.dim,l=-r*this.dim;for(let e=a;e=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 mh{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class gh{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ai(fs,16,0),this.grid3D=new Ai(fs,16,0),this.featureIndexArray=new bo,this.promoteId=e}insert(t,e,r,n,i,a){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const s=a?this.grid3D:this.grid;for(let t=0;t=0&&n[3]>=0&&s.insert(o,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Vl.VectorTile(new nu(this.rawTileData)).layers,this.sourceLayerCoder=new dh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();const i=t.params||{},a=fs/t.tileSize/t.scale,o=Dn(i.filter),s=t.queryGeometry,l=t.queryPadding*a,c=vh(s),u=this.grid.query(c.minX-l,c.minY-l,c.maxX+l,c.maxY+l),f=vh(t.cameraQueryGeometry),p=this.grid3D.query(f.minX-l,f.minY-l,f.maxX+l,f.maxY+l,((e,r,n,i)=>function(t,e,r,n,i){for(const a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;const a=[new h(e,r),new h(e,i),new h(n,i),new h(n,r)];if(t.length>2)for(const e of a)if(Es(t,e))return!0;for(let e=0;e(f||(f=ms(e)),r.queryIntersectsFeature(s,e,n,f,this.z,t.transform,a,t.pixelPosMatrix))))}return d}loadMatchingFeature(t,e,r,n,i,a,o,s,l,c,u){const h=this.bucketLayerIDs[e];if(a&&!function(t,e){for(let r=0;r=0)return!0;return!1}(a,h))return;const f=this.sourceLayerCoder.decode(r),p=this.vtLayers[f].feature(n);if(i.needGeometry){const t=gs(p,!0);if(!i.filter(new va(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new va(this.tileID.overscaledZ),p))return;const d=this.getId(p,f);for(let e=0;e{const o=e instanceof Ma?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function vh(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:e,minY:r,maxX:n,maxY:i}}function xh(t,e){return e-t}function _h(t,e,r,n,i){const a=[];for(let o=0;o=n&&c.x>=n||(o.x>=n?o=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x>=n&&(c=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y>=i&&c.y>=i||(o.y>=i?o=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round():c.y>=i&&(c=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round()),l&&o.equals(l[l.length-1])||(l=[o],a.push(l)),l.push(c)))))}}return a}Si("FeatureIndex",gh,{omit:["rawTileData","sourceLayerCoder"]});class bh extends h{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new bh(this.x,this.y,this.angle,this.segment)}}function wh(t,e,r,n,i){if(void 0===e.segment||0===r)return!0;let a=e,o=e.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;const l=[];let c=0;for(;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=e.dist(r)}return!0}function Th(t){let e=0;for(let r=0;rc){const u=(c-l)/a,h=Re.number(n.x,i.x,u),f=Re.number(n.y,i.y,u),p=new bh(h,f,i.angleTo(n),r);return p._round(),!o||wh(t,p,s,o,e)?p:void 0}l+=a}}function Sh(t,e,r,n,i,a,o,s,l){const c=kh(n,a,o),u=Ah(n,i),h=u*o,f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h=0&&y=0&&v=0&&f+c<=u){const r=new bh(y,v,m,e);r._round(),n&&!wh(t,r,a,n,i)||p.push(r)}}h+=d}return s||p.length||o||(p=Eh(t,h/2,r,n,i,a,o,!0,l)),p}function Ch(t,e,r,n){const i=[],a=t.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2;let c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const u=a.stretchX||[[0,s]],f=a.stretchY||[[0,l]],p=(t,e)=>t+e[1]-e[0],d=u.reduce(p,0),m=f.reduce(p,0),g=s-d,y=l-m;let v=0,x=d,_=0,b=m,w=0,T=g,k=0,A=y;if(a.content&&n){const e=a.content,r=e[2]-e[0],n=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(c=Mu(t)),v=Ih(u,0,e[0]),_=Ih(f,0,e[1]),x=Ih(u,e[0],e[2]),b=Ih(f,e[1],e[3]),w=e[0]-v,k=e[1]-_,T=r-x,A=n-b}const M=c.x1,S=c.y1,E=c.x2-M,C=c.y2-S,I=(t,n,i,s)=>{const l=Ph(t.stretch-v,x,E,M),c=zh(t.fixed-w,T,t.stretch,d),u=Ph(n.stretch-_,b,C,S),f=zh(n.fixed-k,A,n.stretch,m),p=Ph(i.stretch-v,x,E,M),g=zh(i.fixed-w,T,i.stretch,d),y=Ph(s.stretch-_,b,C,S),I=zh(s.fixed-k,A,s.stretch,m),L=new h(l,u),P=new h(p,u),z=new h(p,y),D=new h(l,y),O=new h(c/o,f/o),R=new h(g/o,I/o),F=e*Math.PI/180;if(F){const t=Math.sin(F),e=Math.cos(F),r=[e,-t,t,e];L._matMult(r),P._matMult(r),D._matMult(r),z._matMult(r)}const j=t.stretch+t.fixed,B=n.stretch+n.fixed;return{tl:L,tr:P,bl:D,br:z,tex:{x:a.paddedRect.x+1+j,y:a.paddedRect.y+1+B,w:i.stretch+i.fixed-j,h:s.stretch+s.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/o/E,minFontScaleY:A/o/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const t=Lh(u,g,d),e=Lh(f,y,m);for(let r=0;r0&&(n=Math.max(10,n),this.circleDiameter=n)}else{const l=(null===(u=a.image)||void 0===u?void 0:u.content)&&(a.image.textFitWidth||a.image.textFitHeight)?Mu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];const f=a.collisionPadding;if(f&&(l.x1-=f[0]*o,l.y1-=f[1]*o,l.x2+=f[2]*o,l.y2+=f[3]*o),c){const t=new h(l.x1,l.y1),e=new h(l.x2,l.y1),r=new h(l.x1,l.y2),n=new h(l.x2,l.y2),i=c*Math.PI/180;t._rotate(i),e._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(t.x,e.x,r.x,n.x),l.x2=Math.max(t.x,e.x,r.x,n.x),l.y1=Math.min(t.y,e.y,r.y,n.y),l.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=t.length}}class Oh{constructor(t=[],e=(t,e)=>te?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=e[n],t=n}e[t]=i}}function Rh(t,e=1,r=!1){let n=1/0,i=1/0,a=-1/0,o=-1/0;const s=t[0];for(let t=0;ta)&&(a=e.x),(!t||e.y>o)&&(o=e.y)}const l=Math.min(a-n,o-i);let c=l/2;const u=new Oh([],Fh);if(0===l)return new h(n,i);for(let e=n;ef.d||!f.d)&&(f=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-f.d<=e||(c=n.h/2,u.push(new jh(n.p.x-c,n.p.y-c,c,t)),u.push(new jh(n.p.x+c,n.p.y-c,c,t)),u.push(new jh(n.p.x-c,n.p.y+c,c,t)),u.push(new jh(n.p.x+c,n.p.y+c,c,t)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${f.d}`)),f.p}function Fh(t,e){return e.max-t.max}function jh(t,e,r,n){this.p=new h(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;it.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,Ms(t,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Bh;t.aq=void 0,(Bh=t.aq||(t.aq={}))[Bh.center=1]="center",Bh[Bh.left=2]="left",Bh[Bh.right=3]="right",Bh[Bh.top=4]="top",Bh[Bh.bottom=5]="bottom",Bh[Bh["top-left"]=6]="top-left",Bh[Bh["top-right"]=7]="top-right",Bh[Bh["bottom-left"]=8]="bottom-left",Bh[Bh["bottom-right"]=9]="bottom-right";const Nh=Number.POSITIVE_INFINITY;function Uh(t,e){return e[1]!==Nh?function(t,e,r){let n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){let r=0,n=0;e<0&&(e=0);const i=e/Math.SQRT2;switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function Vh(t,e,r){var n;const i=t.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(e,{},r);if(a){const t=a.values,e=[];for(let r=0;rt*zc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),e[r+1]=i}return new ae(e)}const o=i.get("text-variable-anchor");if(o){let n;n=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(e,{},r)*zc,Nh]:i.get("text-offset").evaluate(e,{},r).map((t=>t*zc));const a=[];for(const t of o)a.push(t,Uh(t,n));return new ae(a)}return null}function qh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Hh(e,r,n,i,a,o,s,l,c,u,h){let f=o.textMaxSize.evaluate(r,{});void 0===f&&(f=s);const p=e.layers[0].layout,d=p.get("icon-offset").evaluate(r,{},h),m=Zh(n.horizontal),g=s/24,y=e.tilePixelRatio*g,v=e.tilePixelRatio*f/24,x=e.tilePixelRatio*l,_=e.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*e.tilePixelRatio,w=function(t,e,r,n=1){const i=t.get("icon-padding").evaluate(e,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(p,r,h,e.tilePixelRatio),T=p.get("text-max-angle")/180*Math.PI,k="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),A="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),M=p.get("symbol-placement"),S=_/2,E=p.get("icon-text-fit");let I;i&&"none"!==E&&(e.allowVerticalPlacement&&n.vertical&&(I=Su(i,n.vertical,E,p.get("icon-text-fit-padding"),d,g)),m&&(i=Su(i,m,E,p.get("icon-text-fit-padding"),d,g)));const L=(l,f)=>{f.x<0||f.x>=fs||f.y<0||f.y>=fs||function(e,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T,k,A){const M=e.addToLineVertexArray(r,n);let S,E,I,L,P=0,z=0,D=0,O=0,R=-1,F=-1;const j={};let B=Zo("");if(e.allowVerticalPlacement&&i.vertical){const t=l.layout.get("text-rotate").evaluate(b,{},k)+90;I=new Dh(c,r,u,h,f,i.vertical,p,d,m,t),s&&(L=new Dh(c,r,u,h,f,s,y,v,m,t))}if(a){const n=l.layout.get("icon-rotate").evaluate(b,{}),i="none"!==l.layout.get("icon-text-fit"),o=Ch(a,n,T,i),p=s?Ch(s,n,T,i):void 0;E=new Dh(c,r,u,h,f,a,y,v,!1,n),P=4*o.length;const d=e.iconSizeData;let m=null;"source"===d.kind?(m=[Eu*l.layout.get("icon-size").evaluate(b,{})],m[0]>Cu&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(m=[Eu*w.compositeIconSizes[0].evaluate(b,{},k),Eu*w.compositeIconSizes[1].evaluate(b,{},k)],(m[0]>Cu||m[1]>Cu)&&C(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,m,_,x,b,t.ah.none,r,M.lineStartIndex,M.lineLength,-1,k),R=e.icon.placedSymbolArray.length-1,p&&(z=4*p.length,e.addSymbols(e.icon,p,m,_,x,b,t.ah.vertical,r,M.lineStartIndex,M.lineLength,-1,k),F=e.icon.placedSymbolArray.length-1)}const N=Object.keys(i.horizontal);for(const n of N){const a=i.horizontal[n];if(!S){B=Zo(a.text);const t=l.layout.get("text-rotate").evaluate(b,{},k);S=new Dh(c,r,u,h,f,a,p,d,m,t)}const s=1===a.positionedLines.length;if(D+=Gh(e,r,a,o,l,m,b,g,M,i.vertical?t.ah.horizontal:t.ah.horizontalOnly,s?N:[n],j,R,w,k),s)break}i.vertical&&(O+=Gh(e,r,i.vertical,o,l,m,b,g,M,t.ah.vertical,["vertical"],j,F,w,k));const U=S?S.boxStartIndex:e.collisionBoxArray.length,V=S?S.boxEndIndex:e.collisionBoxArray.length,q=I?I.boxStartIndex:e.collisionBoxArray.length,H=I?I.boxEndIndex:e.collisionBoxArray.length,G=E?E.boxStartIndex:e.collisionBoxArray.length,Z=E?E.boxEndIndex:e.collisionBoxArray.length,W=L?L.boxStartIndex:e.collisionBoxArray.length,Y=L?L.boxEndIndex:e.collisionBoxArray.length;let X=-1;const $=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;X=$(S,X),X=$(I,X),X=$(E,X),X=$(L,X);const J=X>-1?1:0;J&&(X*=A/zc),e.glyphOffsetArray.length>=Bu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);const K=Vh(l,b,k),[Q,tt]=function(e,r){const n=e.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let r=0;r=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical||-1,R,F,B,U,V,q,H,G,Z,W,Y,u,D,O,P,z,J,0,p,X,Q,tt)}(e,f,l,n,i,a,I,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,y,[b,b,b,b],k,c,x,w,A,d,r,o,u,h,s)};if("line"===M)for(const t of _h(r.geometry,0,0,fs,fs)){const r=Sh(t,_,T,n.vertical||m,i,24,v,e.overscaling,fs);for(const n of r)m&&Wh(e,m.text,S,n)||L(t,n)}else if("line-center"===M){for(const t of r.geometry)if(t.length>1){const e=Mh(t,T,n.vertical||m,i,24,v);e&&L(t,e)}}else if("Polygon"===r.type)for(const t of kr(r.geometry,0)){const e=Rh(t,16);L(t[0],new bh(e.x,e.y,0))}else if("LineString"===r.type)for(const t of r.geometry)L(t,new bh(t[0].x,t[0].y,0));else if("Point"===r.type)for(const t of r.geometry)for(const e of t)L([e],new bh(e.x,e.y,0))}function Gh(t,e,r,n,i,a,o,s,l,c,u,f,p,d,m){const g=function(t,e,r,n,i,a,o,s){const l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[];for(const t of e.positionedLines)for(const n of t.positionedGlyphs){if(!n.rect)continue;const a=n.rect||{};let u=4,f=!0,p=1,d=0;const m=(i||s)&&n.vertical,g=n.metrics.advance*n.scale/2;if(s&&e.verticalizable&&(d=t.lineOffset/2-(n.imageName?-(zc-n.metrics.width*n.scale)/2:(n.scale-1)*zc)),n.imageName){const t=o[n.imageName];f=t.sdf,p=t.pixelRatio,u=1/p}const y=i?[n.x+g,n.y]:[0,0];let v=i?[0,0]:[n.x+g+r[0],n.y+r[1]-d],x=[0,0];m&&(x=v,v=[0,0]);const _=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-u)*n.scale-g+v[0],w=(-n.metrics.top-u)*n.scale+v[1],T=b+a.w/_*n.scale/p,k=w+a.h/_*n.scale/p,A=new h(b,w),M=new h(T,w),S=new h(b,k),E=new h(T,k);if(m){const t=new h(-g,g-uu),e=-Math.PI/2,r=12-g,i=new h(22-r,-(n.imageName?r:0)),a=new h(...x);A._rotateAround(e,t)._add(i)._add(a),M._rotateAround(e,t)._add(i)._add(a),S._rotateAround(e,t)._add(i)._add(a),E._rotateAround(e,t)._add(i)._add(a)}if(l){const t=Math.sin(l),e=Math.cos(l),r=[e,-t,t,e];A._matMult(r),M._matMult(r),S._matMult(r),E._matMult(r)}const C=new h(0,0),I=new h(0,0);c.push({tl:A,tr:M,bl:S,br:E,tex:a,writingMode:e.writingMode,glyphOffset:y,sectionIndex:n.sectionIndex,isSDF:f,pixelOffsetTL:C,pixelOffsetBR:I,minFontScaleX:0,minFontScaleY:0})}return c}(0,r,s,i,a,o,n,t.allowVerticalPlacement),y=t.textSizeData;let v=null;"source"===y.kind?(v=[Eu*i.layout.get("text-size").evaluate(o,{})],v[0]>Cu&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Eu*d.compositeTextSizes[0].evaluate(o,{},m),Eu*d.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>Cu||v[1]>Cu)&&C(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,v,s,a,o,c,e,l.lineStartIndex,l.lineLength,p,m);for(const e of u)f[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function Zh(t){for(const e in t)return t[e];return null}function Wh(t,e,r,n){const i=t.compareText;if(e in i){const t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=Yh[15&r];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new Xh(o,a,i,t)}constructor(t,e=64,r=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Yh.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return $h(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){const s=a[2*o],c=a[2*o+1];s>=t&&s<=r&&c>=e&&c<=n&&l.push(i[o])}continue}const f=h+u>>1,p=a[2*f],d=a[2*f+1];p>=t&&p<=r&&d>=e&&d<=n&&l.push(i[f]),(0===c?t<=p:e<=d)&&(s.push(h),s.push(f-1),s.push(1-c)),(0===c?r>=p:n>=d)&&(s.push(f+1),s.push(u),s.push(1-c))}return l}within(t,e,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){const c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)tf(i[2*r],i[2*r+1],t,e)<=l&&s.push(n[r]);continue}const f=h+u>>1,p=i[2*f],d=i[2*f+1];tf(p,d,t,e)<=l&&s.push(n[f]),(0===c?t-r<=p:e-r<=d)&&(o.push(h),o.push(f-1),o.push(1-c)),(0===c?t+r>=p:e+r>=d)&&(o.push(f+1),o.push(u),o.push(1-c))}return s}}function $h(t,e,r,n,i,a){if(i-n<=r)return;const o=n+i>>1;Jh(t,e,o,n,i,a),$h(t,e,r,n,o-1,1-a),$h(t,e,r,o+1,i,1-a)}function Jh(t,e,r,n,i,a){for(;i>n;){if(i-n>600){const o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);Jh(t,e,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}const o=e[2*r+a];let s=n,l=i;for(Kh(t,e,n,r),e[2*i+a]>o&&Kh(t,e,n,i);so;)l--}e[2*n+a]===o?Kh(t,e,n,l):(l++,Kh(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Kh(t,e,r,n){Qh(t,r,n),Qh(e,2*r,2*n),Qh(e,2*r+1,2*n+1)}function Qh(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function tf(t,e,r,n){const i=t-r,a=e-n;return i*i+a*a}var ef;t.bg=void 0,(ef=t.bg||(t.bg={})).create="create",ef.load="load",ef.fullLoad="fullLoad";let rf=null,nf=[];const af=1e3/60,of="loadTime",sf="fullLoadTime",lf={mark(t){performance.mark(t)},frame(t){const e=t;null!=rf&&nf.push(e-rf),rf=e},clearMetrics(){rf=null,nf=[],performance.clearMeasures(of),performance.clearMeasures(sf);for(const e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(of,t.bg.create,t.bg.load),performance.measure(sf,t.bg.create,t.bg.fullLoad);const e=performance.getEntriesByName(of)[0].duration,r=performance.getEntriesByName(sf)[0].duration,n=nf.length,i=1/(nf.reduce(((t,e)=>t+e),0)/n/1e3),a=nf.filter((t=>t>af)).reduce(((t,e)=>t+(e-af)/af),0);return{loadTime:e,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};t.$=class extends Va{},t.A=Fs,t.B=bi,t.C=function(t){if(null==P){const e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P},t.D=Sa,t.E=J,t.F=class{constructor(t,e){var r,n,i;this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Ku((()=>this.process())),this.subscription=(r=this.target,n="message",i=t=>this.receive(t),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=L(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise(((r,n)=>{const i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},e&&e.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];const e={id:i,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),{once:!0});const a=[],o=Object.assign(Object.assign({},t),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Li(t.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(t){const e=t.data,r=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(""===e.type){delete this.tasks[r];const t=this.abortControllers[r];return delete this.abortControllers[r],void(t&&t.abort())}if(L(self)||e.mustQueue)return this.tasks[r]=e,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,r){return e(this,void 0,void 0,(function*(){if(""===r.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(r.error?e.reject(Pi(r.error)):e.resolve(Pi(r.data)))}if(!this.messageHandlers[r.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const e=Pi(r.data),n=new AbortController;this.abortControllers[t]=n;try{const i=yield this.messageHandlers[r.type](r.sourceMapId,e,n);this.completeTask(t,null,i)}catch(e){this.completeTask(t,e)}}))}completeTask(t,e,r){const n=[];delete this.abortControllers[t];const i={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Li(e):null,data:Li(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=V,t.H=function(){var t=new Fs(16);return Fs!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=lu,t.J=function(t,e,r){var n,i,a,o,s,l,c,u,h,f,p,d,m=r[0],g=r[1],y=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=n*m+s*g+h*y+e[12],t[13]=i*m+l*g+f*y+e[13],t[14]=a*m+c*g+p*y+e[14],t[15]=o*m+u*g+d*y+e[15]),t},t.K=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=Bs,t.M=function(t,e){const r={};for(let n=0;n{const e=window.document.createElement("video");return e.muted=!0,new Promise((r=>{e.onloadstart=()=>{r(e)};for(const r of t){const t=window.document.createElement("source");Z(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}}))},t.a4=function(){return k++},t.a5=uo,t.a6=Bu,t.a7=Dn,t.a8=gs,t.a9=mh,t.aA=function(t){if("custom"===t.type)return new Ju(t);switch(t.type){case"background":return new Wu(t);case"circle":return new qs(t);case"fill":return new jl(t);case"fill-extrusion":return new lc(t);case"heatmap":return new el(t);case"hillshade":return new il(t);case"line":return new kc(t);case"raster":return new $u(t);case"symbol":return new Hu(t)}},t.aB=S,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let r=[];try{if(!et(t.version,e.version))return[{command:"setStyle",args:[e]}];et(t.center,e.center)||r.push({command:"setCenter",args:[e.center]}),et(t.zoom,e.zoom)||r.push({command:"setZoom",args:[e.zoom]}),et(t.bearing,e.bearing)||r.push({command:"setBearing",args:[e.bearing]}),et(t.pitch,e.pitch)||r.push({command:"setPitch",args:[e.pitch]}),et(t.sprite,e.sprite)||r.push({command:"setSprite",args:[e.sprite]}),et(t.glyphs,e.glyphs)||r.push({command:"setGlyphs",args:[e.glyphs]}),et(t.transition,e.transition)||r.push({command:"setTransition",args:[e.transition]}),et(t.light,e.light)||r.push({command:"setLight",args:[e.light]}),et(t.terrain,e.terrain)||r.push({command:"setTerrain",args:[e.terrain]}),et(t.sky,e.sky)||r.push({command:"setSky",args:[e.sky]}),et(t.projection,e.projection)||r.push({command:"setProjection",args:[e.projection]});const n={},i=[];!function(t,e,r,n){let i;for(i in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)||it(i,r,n));for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)?et(t[i],e[i])||("geojson"===t[i].type&&"geojson"===e[i].type&&ot(t,e,i)?rt(r,{command:"setGeoJSONSourceData",args:[i,e[i].data]}):at(i,e,r,n)):nt(i,e,r))}(t.sources,e.sources,i,n);const a=[];t.layers&&t.layers.forEach((t=>{"source"in t&&n[t.source]?r.push({command:"removeLayer",args:[t.id]}):a.push(t)})),r=r.concat(i),function(t,e,r){e=e||[];const n=(t=t||[]).map(lt),i=e.map(lt),a=t.reduce(ct,{}),o=e.reduce(ct,{}),s=n.slice(),l=Object.create(null);let c,u,h,f,p;for(let t=0,e=0;t@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{const a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){const r=[];for(const n in t)n in e||r.push(n);return r},t.ac=b,t.ad=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+c*n,t[1]=o*i+u*n,t[2]=s*i+h*n,t[3]=l*i+f*n,t[4]=c*i-a*n,t[5]=u*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},t.ae=function(t){var e=new Fs(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=Vs,t.ag=function(t,e){let r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:i,minZoom:a,maxZoom:o}=t,s=i?b(Fe.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=Re.number(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}},t.ai=function(t,{uSize:e,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===t.kind?n/Eu:"composite"===t.kind?Re.number(n/Eu,i/Eu,r):e},t.aj=Ou,t.ak=function(t,e,r,n){const i=e.y-t.y,a=e.x-t.x,o=n.y-r.y,s=n.x-r.x,l=o*a-s*i;if(0===l)return null;const c=(s*(t.y-r.y)-o*(t.x-r.x))/l;return new h(t.x+c*a,t.y+c*i)},t.al=_h,t.am=xs,t.an=js,t.ao=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of t)e=Math.min(e,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[e,r,n,i]},t.ap=zc,t.ar=Lu,t.as=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],d=e[12],m=e[13],g=e[14],y=e[15],v=r*s-n*o,x=r*l-i*o,_=r*c-a*o,b=n*l-i*s,w=n*c-a*s,T=i*c-a*l,k=u*m-h*d,A=u*g-f*d,M=u*y-p*d,S=h*g-f*m,E=h*y-p*m,C=f*y-p*g,I=v*C-x*E+_*S+b*M-w*A+T*k;return I?(t[0]=(s*C-l*E+c*S)*(I=1/I),t[1]=(i*E-n*C-a*S)*I,t[2]=(m*T-g*w+y*b)*I,t[3]=(f*w-h*T-p*b)*I,t[4]=(l*M-o*C-c*A)*I,t[5]=(r*C-i*M+a*A)*I,t[6]=(g*_-d*T-y*x)*I,t[7]=(u*T-f*_+p*x)*I,t[8]=(o*E-s*M+c*k)*I,t[9]=(n*M-r*E-a*k)*I,t[10]=(d*w-m*_+y*v)*I,t[11]=(h*_-u*w-p*v)*I,t[12]=(s*A-o*S-l*k)*I,t[13]=(r*S-n*A+i*k)*I,t[14]=(m*x-d*b-g*v)*I,t[15]=(u*b-h*x+f*v)*I,t):null},t.at=qh,t.au=Tu,t.av=Xh,t.aw=function(){const t={},e=K.$version;for(const r in K.$root){const n=K.$root[r];if(n.required){let i=null;i="version"===r?e:"array"===n.type?[]:{},null!=i&&(t[r]=i)}}return t},t.ax=zi,t.ay=H,t.az=function(t){t=t.slice();const e=Object.create(null);for(let r=0;r25||n<0||n>=1||r<0||r>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends Ua{},t.be=Qu,t.bf=lf,t.bh=q,t.bi=function(t,e){N.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete N.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){const r={};for(let n=0;nt*zc))}let x=s?"center":n.get("text-justify").evaluate(i,{},e.canonical);const _="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(i,{},e.canonical)*zc:1/0,b=()=>{e.bucket.allowVerticalPlacement&&aa(a)&&(d.vertical=pu(m,e.glyphMap,e.glyphPositions,e.imagePositions,u,_,o,g,"left",p,y,t.ah.vertical,!0,f,h))};if(!s&&v){const r=new Set;if("auto"===x)for(let t=0;te(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),t.e=T,t.f=t=>new Promise(((e,r)=>{const n=new Image;n.onload=()=>{e(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=D}))},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."));const i=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?URL.createObjectURL(i):D})),t.g=U,t.h=(t,e)=>G(T(t,{type:"json"}),e),t.i=L,t.j=$,t.k=X,t.l=(t,e)=>G(T(t,{type:"arrayBuffer"}),e),t.m=G,t.n=function(t){return new nu(t).readFields(iu,[])},t.o=Js,t.p=su,t.q=Pa,t.r=_i,t.s=Z,t.t=ki,t.u=xi,t.v=K,t.w=C,t.x=function([t,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(r),y:t*Math.sin(e)*Math.sin(r),z:t*Math.cos(r)}},t.y=Re,t.z=va})),n("worker",0,(function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,r){for(const r of e){this._layerConfigs[r.id]=r;const e=this._layers[r.id]=t.aA(r);e._featureFilter=t.a7(e.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(const t of r)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const n=t.bk(Object.values(this._layerConfigs),this.keyCache);for(const t of n){const e=t.map((t=>this._layers[t.id])),r=e[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const a=r.sourceLayer||"_geojsonTileLayer";let o=i[a];o||(o=i[a]=[]),o.push(e)}}}class r{constructor(e){const r={},n=[];for(const t in e){const i=e[t],a=r[t]={};for(const t in i){const e=i[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const r={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(r),a[t]={rect:r,metrics:e.metrics}}}const{w:i,h:a}=t.p(n),o=new t.o({width:i||1,height:a||1});for(const n in e){const i=e[n];for(const e in i){const a=i[+e];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;const s=r[n][e].rect;t.o.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=r}}t.bl("GlyphAtlas",r);class n{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,n,a,o){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;const s=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(const r in h){const n=e.layers[r];if(!n)continue;1===n.version&&t.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=s.encode(r),f=[];for(let t=0;t=r.maxzoom||"none"!==r.visibility&&(i(e,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(f,u,this.tileID.canonical),l.bucketLayerIDs.push(e.map((t=>t.id))))}}const f=t.aF(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>null==t?void 0:t.abort())),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(f).length){const t=new AbortController;this.inFlightDependencies.push(t),p=o.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const d=Object.keys(u.iconDependencies);let m=Promise.resolve({});if(d.length){const t=new AbortController;this.inFlightDependencies.push(t),m=o.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"icons"}},t)}const g=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(g.length){const t=new AbortController;this.inFlightDependencies.push(t),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const[v,x,_]=yield Promise.all([p,m,y]),b=new r(v),w=new t.bo(x,_);for(const e in c){const r=c[e];r instanceof t.a6?(i(r.layers,this.zoom,a),t.bp({bucket:r,glyphMap:v,glyphPositions:b.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof t.bq||r instanceof t.br||r instanceof t.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((t=>!t.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?b.positions:null}}))}}function i(e,r,n){const i=new t.z(r);for(const t of e)t.recalculate(i,n)}class a{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,r){return t._(this,void 0,void 0,(function*(){const n=yield t.l(e.request,r);try{return{vectorTile:new t.bt.VectorTile(new t.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(t){const r=new Uint8Array(n.data);let i=`Unable to parse the tile at ${e.request.url}, `;throw i+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(i)}}))}loadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.uid,i=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),a=new n(e);this.loading[r]=a;const o=new AbortController;a.abort=o;try{const n=yield this.loadVectorTile(e,o);if(delete this.loading[r],!n)return null;const s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(i){const t=i.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}a.vectorTile=n.vectorTile;const u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{const e=yield u;return t.e({rawTileData:s.slice(0)},e,l,c)}finally{delete this.fetching[r]}}catch(t){throw delete this.loading[r],a.status="done",this.loaded[r]=a,t}}))}reloadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status){const e=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);let i;if(this.fetching[r]){const{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],i=t.e({rawTileData:n.slice(0)},e,a,o)}else i=e;return i}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){const t=this.loading,r=e.uid;t&&t[r]&&t[r].abort&&(t[r].abort.abort(),delete t[r])}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}))}}class o{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=e,c=i.width+2,u=i.height+2,h=t.b(i)?new t.R({width:c,height:u},yield t.bw(i,-1,-1,c,u)):i,f=new t.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=f,f}))}removeTile(t){const e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]}}function s(t,e){if(0!==t.length){l(t[0],e);for(var r=1;r=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}var c=t.by((function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n>31}function A(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;st},C=Math.fround||(I=new Float32Array(1),t=>(I[0]=+t,I[0]));var I;class L{constructor(t){this.options=Object.assign(Object.create(E),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:r,maxZoom:n}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const a=[];for(let e=0;e=r;t--){const r=+Date.now();o=this.trees[t]=this._createTree(this._cluster(o,t)),e&&console.log("z%d: %d clusters in %dms",t,o.numItems,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let i=180===t[2]?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){const t=this.getClusters([r,n,180,a],e),o=this.getClusters([-180,n,i,a],e);return t.concat(o)}const o=this.trees[this._limitZoom(e)],s=o.range(D(r),O(a),D(i),O(n)),l=o.data,c=[];for(const t of s){const e=this.stride*t;c.push(l[e+5]>1?P(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const a=i.data;if(e*this.stride>=a.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[e*this.stride],a[e*this.stride+1],o),l=[];for(const e of s){const r=e*this.stride;a[r+4]===t&&l.push(a[r+5]>1?P(a,r,this.clusterProps):this.points[a[r+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,r){const n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,c),n.data,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,i){const a=this.getChildren(e);for(const e of a){const a=e.properties;if(a&&a.cluster?i+a.point_count<=n?i+=a.point_count:i=this._appendLeaves(t,a.cluster_id,r,n,i):i1;let l,c,u;if(s)l=z(e,t,this.clusterProps),c=e[t],u=e[t+1];else{const r=this.points[e[t+3]];l=r.properties;const[n,i]=r.geometry.coordinates;c=D(n),u=O(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let f;f=s||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==f&&(h.id=f),a.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,e)),s=t.data,l=[],c=this.stride;for(let r=0;re&&(p+=s[r+5])}if(p>f&&p>=a){let t,a=n*f,o=u*f,d=-1;const m=(r/c<<5)+(e+1)+this.points.length;for(const n of h){const l=n*c;if(s[l+2]<=e)continue;s[l+2]=e;const u=s[l+5];a+=s[l]*u,o+=s[l+1]*u,s[l+4]=m,i&&(t||(t=this._map(s,r,!0),d=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(s,l)))}s[r+4]=m,l.push(a/p,o/p,1/0,m,-1,p),i&&l.push(d)}else{for(let t=0;t1)for(const t of h){const r=t*c;if(!(s[r+2]<=e)){s[r+2]=e;for(let t=0;t>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,r){if(t[e+5]>1){const n=this.clusterProps[t[e+6]];return r?Object.assign({},n):n}const n=this.points[t[e+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function P(t,e,r){return{type:"Feature",id:t[e+3],properties:z(t,e,r),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),R(t[e+1])]}};var n}function z(t,e,r){const n=t[e+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=t[e+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:t[e+3],point_count:n,point_count_abbreviated:i})}function D(t){return t/360+.5}function O(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function R(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function F(t,e,r,n){let i=n;const a=e+(r-e>>1);let o,s=r-e;const l=t[e],c=t[e+1],u=t[r],h=t[r+1];for(let n=e+3;ni)o=n,i=e;else if(e===i){const t=Math.abs(n-a);tn&&(o-e>3&&F(t,e,o,n),t[o+2]=i,r-o>3&&F(t,o,r,n))}function j(t,e,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){const l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=t-r,s=e-n,o*o+s*s}function B(t,e,r,n){const i={id:null==t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)N(i,r);else if("Polygon"===e)N(i,r[0]);else if("MultiLineString"===e)for(const t of r)N(i,t);else if("MultiPolygon"===e)for(const t of r)N(i,t[0]);return i}function N(t,e){for(let r=0;r0&&(o+=n?(i*l-s*a)/2:Math.sqrt(Math.pow(s-i,2)+Math.pow(l-a,2))),i=s,a=l}const s=e.length-3;e[2]=1,F(e,0,s,r),e[s+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function H(t,e,r,n){for(let i=0;i1?1:r}function W(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o=n)return null;const l=[];for(const e of t){const t=e.geometry;let a=e.type;const o=0===i?e.minX:e.minY,c=0===i?e.maxX:e.maxY;if(o>=r&&c=n)continue;let u=[];if("Point"===a||"MultiPoint"===a)Y(t,u,r,n,i);else if("LineString"===a)X(t,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===a)J(t,u,r,n,i,!1);else if("Polygon"===a)J(t,u,r,n,i,!0);else if("MultiPolygon"===a)for(const e of t){const t=[];J(e,t,r,n,i,!0),t.length&&u.push(t)}if(u.length){if(s.lineMetrics&&"LineString"===a){for(const t of u)l.push(B(e.id,a,t,e.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===u.length?(a="LineString",u=u[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===u.length?"Point":"MultiPoint"),l.push(B(e.id,a,u,e.tags))}}return l.length?l:null}function Y(t,e,r,n,i){for(let a=0;a=r&&o<=n&&K(e,t[a],t[a+1],t[a+2])}}function X(t,e,r,n,i,a,o){let s=$(t);const l=0===i?Q:tt;let c,u,h=t.start;for(let f=0;fr&&(u=l(s,p,d,g,y,r),o&&(s.start=h+c*u)):v>n?x=r&&(u=l(s,p,d,g,y,r),_=!0),x>n&&v<=n&&(u=l(s,p,d,g,y,n),_=!0),!a&&_&&(o&&(s.end=h+c*u),e.push(s),s=$(t)),o&&(h+=c)}let f=t.length-3;const p=t[f],d=t[f+1],m=0===i?p:d;m>=r&&m<=n&&K(s,p,d,t[f+2]),f=s.length-3,a&&f>=3&&(s[f]!==s[0]||s[f+1]!==s[1])&&K(s,s[0],s[1],s[2]),s.length&&e.push(s)}function $(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,r,n,i,a){for(const o of t)X(o,e,r,n,i,a,!1)}function K(t,e,r,n){t.push(e,r,n)}function Q(t,e,r,n,i,a){const o=(a-e)/(n-e);return K(t,a,r+(i-r)*o,1),o}function tt(t,e,r,n,i,a){const o=(a-r)/(i-r);return K(t,e+(n-e)*o,a,1),o}function et(t,e){const r=[];for(let n=0;n0&&e.size<(i?o:n))return void(r.numPoints+=e.length/3);const s=[];for(let t=0;to)&&(r.numSimplified++,s.push(e[t],e[t+1])),r.numPoints++;i&&function(t,e){let r=0;for(let e=0,n=t.length,i=n-2;e0===e)for(let e=0,r=t.length;e24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(t,e){const r=[];if("FeatureCollection"===t.type)for(let n=0;n1&&console.time("creation"),f=this.tiles[h]=at(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(r!==a>>t||n!==o>>t)continue}}if(f.source=null,0===t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,d=.5-p,m=.5+p,g=1+p;let y=null,v=null,x=null,_=null,b=W(t,u,r-p,r+m,0,f.minX,f.maxX,l),w=W(t,u,r+d,r+g,0,f.minX,f.maxX,l);t=null,b&&(y=W(b,u,n-p,n+m,1,f.minY,f.maxY,l),v=W(b,u,n+d,n+g,1,f.minY,f.maxY,l),b=null),w&&(x=W(w,u,n-p,n+m,1,f.minY,f.maxY,l),_=W(w,u,n+d,n+g,1,f.minY,f.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*n),s.push(v||[],e+1,2*r,2*n+1),s.push(x||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}getTile(t,e,r){t=+t,e=+e,r=+r;const n=this.options,{extent:i,debug:a}=n;if(t<0||t>24)return null;const o=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let l,c=t,u=e,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ut(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?nt(this.tiles[s],i):null):null}}function ut(t,e,r){return 32*((1<{o.properties=t;const e={};for(const t of s)e[t]=n[t].evaluate(a,o);return e},e.reduce=(t,e)=>{o.properties=e;for(const e of s)a.accumulated=t[e],t[e]=i[e].evaluate(a,o)},e}(e)).load((yield this._pendingData).features):(i=yield this._pendingData,new ct(i,e.geojsonVtOptions)),this.loaded={};const r={};if(n){const t=n.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return r}catch(e){if(delete this._pendingRequest,t.bB(e))return{abandoned:!0};throw e}var i}))}getData(){return t._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(t){const e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(e,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(c(n,!0),e.filter){const r=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const i=n.features.filter((t=>r.value.evaluate({zoom:0},t)));n={type:"FeatureCollection",features:i}}return n}))}loadGeoJSON(e,r){return t._(this,void 0,void 0,(function*(){const{promoteId:n}=e;if(e.request){const i=yield t.h(e.request,r);return this._dataUpdateable=ft(i.data,n)?pt(i.data,n):void 0,i.data}if("string"==typeof e.data)try{const t=JSON.parse(e.data);return this._dataUpdateable=ft(t,n)?pt(t,n):void 0,t}catch(t){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,r){var n,i,a,o;if(e.removeAll&&t.clear(),e.remove)for(const r of e.remove)t.delete(r);if(e.add)for(const n of e.add){const e=ht(n,r);null!=e&&t.set(e,n)}if(e.update)for(const r of e.update){let e=t.get(r.id);if(null==e)continue;const s=!r.removeAllProperties&&((null===(n=r.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=r.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((r.newGeometry||r.removeAllProperties||s)&&(e=Object.assign({},e),t.set(r.id,e),s&&(e.properties=Object.assign({},e.properties))),r.newGeometry&&(e.geometry=r.newGeometry),r.removeAllProperties)e.properties={};else if((null===(a=r.removeProperties)||void 0===a?void 0:a.length)>0)for(const t of r.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(o=r.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(const{key:t,value:n}of r.addOrUpdateProperties)e.properties[t]=n}}(this._dataUpdateable,e.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(e){return t._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class mt{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,r)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((e,r)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("GD",((t,e)=>this._getWorkerSource(t,e.type,e.source).getData())),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,r)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][r.type]||!this.workerSources[e][r.type][r.source])return;const t=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],void 0!==t.removeSource&&t.removeSource(r)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})))),this.actor.registerMessageHandler("SR",((e,r)=>t._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,r)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((e,r)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(r)}))))}_setImages(e,r){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=r;for(const t in this.workerSources[e]){const n=this.workerSources[e][t];for(const t in n)n[t].availableImages=r}}))}_syncRTLPluginState(e,r){return t._(this,void 0,void 0,(function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==r.pluginStatus)return t.bD.setState(r),r;const e=r.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){const r={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(r),r}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let r=this.layerIndexes[t];return r||(r=this.layerIndexes[t]=new e),r}_getWorkerSource(t,e,r){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){const n={sendAsync:(e,r)=>(e.targetMapId=t,this.actor.sendAsync(e,r))};switch(e){case"vector":this.workerSources[t][e][r]=new a(n,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new dt(n,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](n,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new mt(self)),mt})),n("index",0,(function(t,e){var r="4.7.1";let n,i;const a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise(((r,n)=>{const i=requestAnimationFrame(r);t.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(e.c())}))})),getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const 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=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(t){if(!o.docStyle)return t[0];for(let e=0;e{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,r,n){const i=r.boundingClientRect;return new e.P((n.clientX-i.left)/r.x-t.clientLeft,(n.clientY-i.top)/r.y-t.clientTop)}static mousePos(t,e){const r=o.getScale(t);return o.getPoint(t,r,e)}static touchPos(t,e){const r=[],n=o.getScale(t);for(let i=0;i{l&&f(l),l=null,h=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let r,n,i,a;t.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},t.addThrottleControl=t=>{const e=i++;return a[e]=t,e},t.removeThrottleControl=t=>{delete a[t],l()},t.getImage=(t,n,i=!0)=>new Promise(((a,o)=>{s.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),r.push({abortController:n,requestParameters:t,supportImageRefresh:i,state:"queued",onError:t=>{o(t)},onSuccess:t=>{a(t)}}),l()}));const o=t=>e._(this,void 0,void 0,(function*(){t.state="running";const{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:s}=t,u=!1===i&&!e.i(self)&&!e.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((t,e)=>t&&"accept"===e),!0));n++;const h=u?c(r,s):e.m(r,s);try{const r=yield h;delete t.abortController,t.state="completed",r.data instanceof HTMLImageElement||e.b(r.data)?o(r):r.data&&o({data:yield(f=r.data,"function"==typeof createImageBitmap?e.d(f):e.f(f)),cacheControl:r.cacheControl,expires:r.expires})}catch(e){delete t.abortController,a(e)}finally{n--,l()}var f})),l=()=>{const t=(()=>{for(const t of Object.keys(a))if(a[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=n;e0;e++){const t=r.shift();t.abortController.signal.aborted?e--:o(t)}},c=(t,r)=>new Promise(((n,i)=>{const a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(e.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o}))}(p||(p={})),p.resetRequestQueue();class d{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var r=new e.A(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}var g,y=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};g=new e.A(3),e.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v,x=function(t){var e=t[0],r=t[1];return e*e+r*r};function _(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const r=[];for(const{id:n,url:i}of t){const t=`${n}${i}`;-1===r.indexOf(t)&&(r.push(t),e.push({id:n,url:i}))}}return e}function b(t,e,r){const n=t.split("?");return n[0]+=`${e}${r}`,n.join("?")}v=new e.A(2),e.A!=Float32Array&&(v[0]=0,v[1]=0);class w{constructor(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,r,n){const{width:i,height:a}=t,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,t.data);else{const{x:r,y:o}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,r){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function T(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class k extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const r=this.images[t];if(r&&!r.data&&r.spriteData){const t=r.spriteData;r.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,r){let n=!0;const i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let r=0;for(const n of t){if(n[0]{let n=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(n=!1);this.isLoaded()||n?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){const r={};for(const n of t){let t=this.getImage(n);t||(this.fire(new e.k("styleimagemissing",{id:n})),t=this.getImage(n)),t?r[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${n}" 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 r}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new e.I(r,n);this.patterns[t]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new w(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:r,h:n}=e.p(t),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const t in this.patterns){const{bin:r}=this.patterns[t],n=r.x+1,a=r.y+1,o=this.getImage(t).data,s=o.width,l=o.height;e.R.copy(o,i,{x:0,y:0},{x:n,y:a},{width:s,height:l}),e.R.copy(o,i,{x:0,y:l-1},{x:n,y:a-1},{width:s,height:1}),e.R.copy(o,i,{x:0,y:0},{x:n,y:a+l},{width:s,height:1}),e.R.copy(o,i,{x:s-1,y:0},{x:n-1,y:a},{width:1,height:l}),e.R.copy(o,i,{x:0,y:0},{x:n+s,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const r of t){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const t=this.getImage(r);t||e.w(`Image with ID: "${r}" was not found`),T(t)&&this.updateImage(r,t)}}}const A=1e20;function M(t,e,r,n,i,a,o,s,l){for(let c=e;c-1);l++,a[l]=s,o[l]=c,o[l+1]=A}for(let s=0,l=0;s65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[i])return{stack:t,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[i]){const r=E.loadGlyphRange(t,i,this.url,this.requestManager);e.requests[i]=r}const a=yield e.requests[i];for(const t in a)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=a[+t]);return e.ranges[i]=!0,{stack:t,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(t))}_tinySDF(t,r,n){const i=this.localIdeographFontFamily;if(!i)return;if(!this._doesCharSupportLocalGlyph(n))return;let a=t.tinySDF;if(!a){let e="400";/bold/i.test(r)?e="900":/medium/i.test(r)?e="500":/light/i.test(r)&&(e="200"),a=t.tinySDF=new E.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:e})}const o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new e.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}E.loadGlyphRange=function(t,r,n,i){return e._(this,void 0,void 0,(function*(){const a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",t).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield e.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);const c={};for(const t of e.n(l.data))c[t.id]=t;return c}))},E.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=r;const s=this.size=t+4*e,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${t}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(t),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),f=new Uint8ClampedArray(h),p={data:f,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:d,buffer:m,gridInner:g,gridOuter:y}=this;d.clearRect(m,m,s,l),d.fillText(t,m,m+o);const v=d.getImageData(m,m,s,l);y.fill(A,0,h),g.fill(0,0,h);for(let t=0;t0?t*t:0,g[n]=t<0?t*t:0}}M(y,0,0,c,u,c,this.f,this.v,this.z),M(g,m,m,s,l,c,this.f,this.v,this.z);for(let t=0;t1&&(o=t[++a]);const l=Math.abs(s-o.left),c=Math.abs(s-o.right),u=Math.min(l,c);let h;const f=e/r*(n+1);if(o.isDash){const t=n-Math.abs(f);h=Math.sqrt(u*u+t*t)}else h=n-Math.sqrt(u*u+f*f);this.data[i+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){const r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}const e=t[0],r=t[t.length-1];e.isDash===r.isDash&&(e.left=r.left-this.width,r.right=e.right+this.width);const n=this.width*this.nextRow;let i=0,a=t[i];for(let e=0;e1&&(a=t[++i]);const r=Math.abs(e-a.left),o=Math.abs(e-a.right),s=Math.min(r,o);this.data[n+e]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(t,r){const n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.w("LineAtlas out of space"),null;let a=0;for(let e=0;e{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}const F=Math.floor(a.hardwareConcurrency/2);let j,B;function N(){return j||(j=new R),j}R.workerCount=e.C(globalThis)?Math.max(Math.min(F,3),1):1;class U{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=r;const n=this.workerPool.acquire(r);for(let t=0;t{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const r of this.actors)r.registerMessageHandler(t,e)}}function V(){return B||(B=new U(N(),e.G),B.registerMessageHandler("GR",((t,r,n)=>e.m(r,n)))),B}function q(t,r){const n=e.H();return e.J(n,n,[1,1,0]),e.K(n,n,[.5*t.width,.5*t.height,1]),e.L(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function H(t,e,r,n,i,a){const o=function(t,e,r){if(t)for(const n of t){const t=e[n];if(t&&t.source===r&&"fill-extrusion"===t.type)return!0}else for(const t in e){const n=e[t];if(n.source===r&&"fill-extrusion"===n.type)return!0}return!1}(i&&i.layers,e,t.id),s=a.maxPitchScaleFactor(),l=t.tilesIn(n,s,o);l.sort(G);const c=[];for(const n of l)c.push({wrappedTileID:n.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,r,t._state,n.queryGeometry,n.cameraQueryGeometry,n.scale,i,a,s,q(t.transform,n.tileID))});const u=function(t){const e={},r={};for(const n of t){const t=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(const r in t){const n=t[r],i=a[r]=a[r]||{},o=e[r]=e[r]||[];for(const t of n)i[t.featureIndex]||(i[t.featureIndex]=!0,o.push(t))}}return e}(c);for(const e in u)u[e].forEach((e=>{const r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function G(t,e){const r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function Z(t,r,n){return e._(this,void 0,void 0,(function*(){let i=t;if(t.url?i=(yield e.h(r.transformRequest(t.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;const o=e.M(e.e(i,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map((t=>t.id))),o}))}class W{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?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 e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){const r=this._sw,n=this._ne;let i,a;if(t instanceof e.N)i=t,a=t;else{if(!(t instanceof W))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(W.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(i=t._sw,a=t._ne,!i||!a)return this}return r||n?(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(a.lng,n.lng),n.lat=Math.max(a.lat,n.lat)):(this._sw=new e.N(i.lng,i.lat),this._ne=new e.N(a.lng,a.lat)),this}getCenter(){return new e.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 e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.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(t){const{lng:r,lat:n}=e.N.convert(t);let i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(t){return t instanceof W?t:t?new W(t):t}static fromLngLat(t,r=0){const n=360*r/40075017,i=n/Math.cos(Math.PI/180*t.lat);return new W(new e.N(t.lng-i,t.lat-n),new e.N(t.lng+i,t.lat+n))}adjustAntiMeridian(){const t=new e.N(this._sw.lng,this._sw.lat),r=new e.N(this._ne.lng,this._ne.lat);return new W(t,t.lng>r.lng?new e.N(r.lng+360,r.lat):r)}}class Y{constructor(t,e,r){this.bounds=W.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const r=Math.pow(2,t.z),n=Math.floor(e.O(this.bounds.getWest())*r),i=Math.floor(e.Q(this.bounds.getNorth())*r),a=Math.ceil(e.O(this.bounds.getEast())*r),o=Math.ceil(e.Q(this.bounds.getSouth())*r);return t.x>=n&&t.x=i&&t.y{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(e,"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};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,r)=>{t.reloadPromise={resolve:e,reject:r}}))}else t.actor=this.dispatcher.getActor(),n="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:n,data:r},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}}))}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class $ extends e.E{constructor(t,r,n,i){super(),this.id=t,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},r),e.e(this,e.M(r,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Z(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Y(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const r=yield p.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const e=this.map.painter.context,n=e.gl,i=r.data;t.texture=this.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new w(e,i,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class J extends ${constructor(t,r,n,i){super(t,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const r=yield p.getImage(n,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){const n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=e.b(n)&&e.U()?n:yield this.readImageNow(n),a={type:this.type,uid:t.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.V()){const r=t.width+2,n=t.height+2;try{return new e.R({width:r,height:n},yield e.W(t,-1,-1,r,n))}catch(t){}}return a.getImageData(t,1)}))}_getNeighboringTiles(t){const r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.S(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&e.e(i,{resourceTiming:n}),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(t))}}))}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const r={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.abortController=new AbortController;const n=yield this.actor.sendAsync({type:e,data:r},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(n,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.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 e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Q=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class tt extends e.E{constructor(t,e,r,n){super(),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,this.fire(new e.j(t))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const r=t.map(e.Z.fromLngLat);this.tileID=function(t){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(const e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);const o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new e.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const n=r.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new e.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,e.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,e.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new w(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class et extends tt{constructor(t,e,r,n){super(t,e,r,n),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.j(t))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const r=this.video.seekable;tr.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.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)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new w(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.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 rt extends tt{constructor(t,r,n,i){super(t,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`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 e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return e._(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 e.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(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,Q.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new w(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const nt={},it=t=>{switch(t){case"geojson":return K;case"image":return tt;case"raster":return $;case"raster-dem":return J;case"vector":return X;case"video":return et;case"canvas":return rt}return nt[t]},at="RTLPluginLoaded";class ot extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=a.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(at))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let st=null;function lt(){return st||(st=new ot),st}class ct{constructor(t,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=r,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){const e=t+this.timeAdded;ee.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)r[e.id]=n}}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.a6&&r.hasRTLText){this.hasRTLText=!0,lt().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const 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(const e in this.buckets){const r=this.buckets[e];r.uploadPending()&&r.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new w(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new w(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},t,e,r):{}}querySourceFeatures(t,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;const s=e.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let r=0;rt)e=!1;else if(r)if(this.expirationTime{this.remove(t,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}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){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const r in this.data)for(const n of this.data[r])t(n.value)||e.push(n);for(const t of e)this.remove(t.value.tileID,t)}}class ht{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,n){const i=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},e.e(this.stateChanges[t][i],n),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==i&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][i]){this.deletedStates[t][i]={};for(const e in this.state[t][i])n[e]||(this.deletedStates[t][i][e]=null)}else for(const e in n)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][e]&&delete this.deletedStates[t][i][e]}removeFeatureState(t,e,r){if(null===this.deletedStates[t])return;const n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,r){const n=String(r),i=e.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][r];if(null===e)return{};for(const t in e)delete i[t]}return i}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,r){const n={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const r={};for(const n in this.stateChanges[t])this.state[t][n]||(this.state[t][n]={}),e.e(this.state[t][n],this.stateChanges[t][n]),r[n]=this.state[t][n];n[t]=r}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const r={};if(null===this.deletedStates[t])for(const e in this.state[t])r[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(const r of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][r];r[e]=this.state[t][e]}n[t]=n[t]||{},e.e(n[t],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const e in t)t[e].setFeatureState(n,r)}}class ft extends e.E{constructor(t,e,r){super(),this.id=t,this.dispatcher=r,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,r,n)=>{const i=new(it(e.type))(t,e,r,n);if(i.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${i.id}`);return i})(t,e,r,this),this._tiles={},this._cache=new ut(0,(t=>this._unloadTile(t))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ht,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)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,r,n){return e._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,r,n)}catch(r){t.state="errored",404!==r.status?this._source.fire(new e.j(r,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("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(const e in this._tiles){const r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(pt).map((t=>t.key))}getRenderableIds(t){const r=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&r.push(this._tiles[e]);return t?r.sort(((t,r)=>{const n=t.tileID,i=r.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new e.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((t=>t.tileID.key)):r.map((t=>t.tileID)).sort(pt).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,r){return e._(this,void 0,void 0,(function*(){const e=this._tiles[t];e&&("loading"!==e.state&&(e.state=r),yield this._loadTile(e,t,r))}))}_tileLoaded(t,r,n){t.timeAdded=a.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,r,n){for(const i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>e+1;){const t=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[t.key],a&&a.hasData()&&(o=t)}let s=o;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){n[o.key]=o;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(let r=t.overscaledZ-1;r>=e;r--){const e=t.scaledTo(r),n=this._getLoadedTile(e);if(n)return n}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const r=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(t,e,r,n,i,o){const s={},l={},c=Object.keys(t),u=a.now();for(const r of c){const n=t[r],i=this._tiles[r];if(!i||0!==i.fadeEndTime&&i.fadeEndTime<=u)continue;const a=this.findLoadedParent(n,e),o=this.findLoadedSibling(n),c=a||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[r]=n}this._retainLoadedChildren(l,n,r,t);for(const e in s)t[e]||(this._coveredTiles[e]=!0,t[e]=s[e]);if(o){const e={},r={};for(const t of i)this._tiles[t.key].hasData()?e[t.key]=t:r[t.key]=t;for(const n in r){const i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(e[i[0].key]=t[i[0].key]=i[0],e[i[1].key]=t[i[1].key]=i[1],e[i[2].key]=t[i[2].key]=i[2],e[i[3].key]=t[i[3].key]=i[3],delete r[n])}for(const n in r){const i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){e[s.tileID.key]=t[s.tileID.key]=s.tileID;for(const t in e)e[t].isChildOf(s.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=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:r}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];const i=t.coveringZoomLevel(this._source),a=Math.max(i-ft.maxOverzooming,this._source.minzoom),o=Math.max(i+ft.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const t={};for(const e of n)if(e.canonical.z>this._source.minzoom){const r=e.scaledTo(e.canonical.z-1);t[r.key]=r;const n=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[n.key]=n}n=n.concat(Object.values(t))}const s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(n,i);dt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(const t in l)this._tiles[t].clearFadeHold();const c=e.ab(this._tiles,l);for(const t of c){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var r;const n={},i={},a=Math.max(e-ft.maxOverzooming,this._source.minzoom),o=Math.max(e+ft.maxUnderzooming,this._source.minzoom),s={};for(const r of t){const t=this._addTile(r);n[r.key]=r,t.hasData()||ethis._source.maxzoom){const t=o.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){n[t.key]=t;continue}}else{const t=o.children(this._source.maxzoom);if(n[t[0].key]&&n[t[1].key]&&n[t[2].key]&&n[t[3].key])continue}let s=t.wasRequested();for(let e=o.overscaledZ-1;e>=a;--e){const a=o.scaledTo(e);if(i[a.key])break;if(i[a.key]=!0,t=this.getTile(a),!t&&s&&(t=this._addTile(a)),t){const e=t.hasData();if((e||!(null===(r=this.map)||void 0===r?void 0:r.cancelPendingTileRequestsWhileZooming)||s)&&(n[a.key]=a),s=t.wasRequested(),e)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let r,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(t),r)break;n=t}for(const t of e)this._loadedParentTiles[t]=r}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const e=this._tiles[t].tileID,r=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));const n=r;return r||(r=new ct(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state)),r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),r))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){const e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,r,n){const i=[],a=this.transform;if(!a)return i;const o=n?a.getCameraQueryGeometry(t):t,s=t.map((t=>a.pointCoordinate(t,this.terrain))),l=o.map((t=>a.pointCoordinate(t,this.terrain))),c=this.getIds();let u=1/0,h=1/0,f=-1/0,p=-1/0;for(const t of l)u=Math.min(u,t.x),h=Math.min(h,t.y),f=Math.max(f,t.x),p=Math.max(p,t.y);for(let t=0;t=0&&g[1].y+m>=0){const t=s.map((t=>o.getTilePoint(t))),e=l.map((t=>o.getTilePoint(t)));i.push({tile:n,tileID:o,queryGeometry:t,cameraQueryGeometry:e,scale:d})}}return i}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(dt(this._source.type)){const t=a.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)}removeFeatureState(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,r){const n=this._tiles[t];n&&n.setDependencies(e,r)}reloadTilesForDependencies(t,e){for(const r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(t,e)))}}function pt(t,e){const r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function dt(t){return"raster"===t||"image"===t||"video"===t}ft.maxOverzooming=10,ft.maxUnderzooming=3;class mt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function gt(t,e){let r=!0;return"always"===t||"never"!==t&&"never"!==e||(r=!1),r}class yt{constructor(t,e,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(let t=0;tthis.width||n<0||e>this.height)return[];const s=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:t,y1:e,x2:r,y2:n}];for(let t=0;t0}hitTestCircle(t,e,r,n,i){const a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(t,e,r,n,i,a,o,s){const{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const i=this.bboxes;for(const o of h)if(!l.box[o]){l.box[o]=!0;const h=4*o,f=this.boxKeys[o];if(t<=i[h+2]&&e<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(f))&&(!c||!gt(u,f.overlapMode))&&(a.push({key:f,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}const f=this.circleCells[i];if(null!==f){const i=this.circles;for(const o of f)if(!l.circle[o]){l.circle[o]=!0;const h=3*o,f=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],t,e,r,n)&&(!s||s(f))&&(!c||!gt(u,f.overlapMode))){const t=i[h],e=i[h+1],r=i[h+2];if(a.push({key:f,x1:t-r,y1:e-r,x2:t+r,y2:e+r}),c)return!0}}}return!1}_queryCellCircle(t,e,r,n,i,a,o,s){const{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const t=this.bboxes;for(const e of h)if(!c.box[e]){c.box[e]=!0;const r=4*e,n=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[r+0],t[r+1],t[r+2],t[r+3])&&(!s||s(n))&&!gt(u,n.overlapMode))return a.push(!0),!0}}const f=this.circleCells[i];if(null!==f){const t=this.circles;for(const e of f)if(!c.circle[e]){c.circle[e]=!0;const r=3*e,n=this.circleKeys[e];if(this._circlesCollide(t[r],t[r+1],t[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!gt(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,r,n,i,a,o,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let f=l;f<=u;f++)for(let l=c;l<=h;l++)if(i.call(this,t,e,r,n,this.xCellCount*l+f,a,o,s))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,e,r,n,i,a){const o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(t,e,r,n,i,a,o){const s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;const c=(o-i)/2,u=Math.abs(e-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const h=l-s,f=u-c;return h*h+f*f<=r*r}}function vt(t,r,n,i,a){const o=e.H();return r?(e.K(o,o,[1/a,1/a,1]),n||e.ad(o,o,i.angle)):e.L(o,i.labelPlaneMatrix,t),o}function xt(t,r,n,i,a){if(r){const r=e.ae(t);return e.K(r,r,[a,a,1]),n||e.ad(r,r,-i.angle),r}return i.glCoordMatrix}function _t(t,r,n,i){let a;i?(a=[t,r,i(t,r),1],e.af(a,a,n)):(a=[t,r,0,1],Ot(a,a,n));const o=a[3];return{point:new e.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function bt(t,e){return.5+t/e*.5}function wt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function Tt(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m){const g=i?t.textSizeData:t.iconSizeData,y=e.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();const _=t.lineVertexArray,b=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=n.transform.width/n.transform.height;let T=!1;for(let i=0;iMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.ah.vertical?r.yn.x)?{needsFlipping:!0}:null}function Mt(t,r,n,i,a,o,s,l,c,u,h){const f=n/24,p=r.lineOffsetX*f,d=r.lineOffsetY*f;let m;if(r.numGlyphs>1){const e=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=kt(f,l,p,d,i,r,h,t);if(!c)return{notEnoughRoom:!0};const g=_t(c.first.point.x,c.first.point.y,s,t.getElevation).point,y=_t(c.last.point.x,c.last.point.y,s,t.getElevation).point;if(a&&!i){const t=At(r.writingMode,g,y,u);if(t)return t}m=[c.first];for(let a=r.glyphStartIndex+1;a0?s.point:St(t.tileAnchorPoint,a,n,1,o,t),c=At(r.writingMode,n,l,u);if(c)return c}const n=Pt(f*l.getoffsetX(r.glyphStartIndex),p,d,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,t,h);if(!n||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[n]}for(const t of m)e.aj(c,t.point,t.angle);return{}}function St(t,e,r,n,i,a){const o=t.add(t.sub(e)._unit()),s=void 0!==i?_t(o.x,o.y,i,a.getElevation).point:Ct(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Et(t,r,n){const i=r.projectionCache;if(i.projections[t])return i.projections[t];const a=new e.P(r.lineVertexArray.getx(t),r.lineVertexArray.gety(t)),o=Ct(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[t]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;const s=t-n.direction;return l=0===n.distanceFromAnchor?r.tileAnchorPoint:new e.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),c=a,u=n.previousVertex,h=n.absOffsetX-n.distanceFromAnchor+1,St(l,c,u,h,void 0,r);var l,c,u,h}function Ct(t,e,r){const n=t+r.translation[0],i=e+r.translation[1];let a;return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(a=r.projection.projectTileCoordinates(n,i,r.unwrappedTileID,r.getElevation),a.point.x=(.5*a.point.x+.5)*r.width,a.point.y=(.5*-a.point.y+.5)*r.height):(a=_t(n,i,r.labelPlaneMatrix,r.getElevation),a.isOccluded=!1),a}function It(t,e,r){return t._unit()._perp()._mult(e*r)}function Lt(t,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const u=n.add(r);if(t+c.direction=a)return l.projectionCache.offsets[t]=u,u;const h=Et(t+c.direction,l,c),f=It(h.sub(n),s,c.direction),p=n.add(f),d=h.add(f);return l.projectionCache.offsets[t]=e.ak(o,u,p,d)||u,l.projectionCache.offsets[t]}function Pt(t,e,r,n,i,a,o,s,l){const c=n?t-e:t+e;let u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let f,p=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=Ct(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let d,m,g=f,y=f,v=0,x=0;const _=Math.abs(c),b=[];let w;for(;v+x<=_;){if(p+=u,p=o)return null;v+=x,y=g,m=d;const t={absOffsetX:_,direction:u,distanceFromAnchor:v,previousVertex:y};if(g=Et(p,s,t),0===r)b.push(y),w=g.sub(y);else{let e;const n=g.sub(y);e=0===n.mag()?It(Et(p+u,s,t).sub(g),r,u):It(n,r,u),m||(m=y.add(e)),d=Lt(p,e,g,a,o,m,r,s,t),b.push(m),w=d.sub(m)}x=w.mag()}const T=w._mult((_-v)/x)._add(m||y),k=h+Math.atan2(g.y-y.y,g.x-y.x);return b.push(T),{point:T,angle:l?k:0,path:b}}const zt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dt(t,e){for(let r=0;r=1;t--)l.push(o.path[t]);for(let t=1;tt.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let m=[];if(l.length>0){const t=l[0].clone(),r=l[0].clone();for(let e=1;e=n.x&&r.x<=i.x&&t.y>=n.y&&r.y<=i.y?[l]:r.xi.x||r.yi.y?[]:e.al([l],n.x,n.y,i.x,i.y)}for(const e of m){a.reset(e,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let e=0;e_t(t.x,t.y,r,e.getElevation)))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,a=-1/0,o=-1/0;for(const s of t){const t=new e.P(s.x+Rt,s.y+Rt);n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y),r.push(t)}const s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(const t of s){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const i=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.am(r,i)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(t,e,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,r,n,i,a){const o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:e};for(let e=0;e=this.screenRightBoundary||nthis.screenBottomBoundary}isInsideGrid(t,e,r,n){return r>=0&&t=0&&ethis.projectAndGetPerspectiveRatio(n,t.x,t.y,i,c)));k=t.some((t=>!t.isOccluded)),T=t.map((t=>t.point))}else k=!0;return{box:e.ao(T),allPointsOccluded:!k}}}function jt(t,r,n){return r*(e.X/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}class Bt{constructor(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Nt{constructor(t,e,r,n,i){this.text=new Bt(t?t.text:null,e,r,i),this.icon=new Bt(t?t.icon:null,e,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ut{constructor(t,e,r){this.text=t,this.icon=e,this.skipFade=r}}class Vt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class qt{constructor(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class Ht{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function Gt(t,r,n,i,a){const{horizontalAlign:o,verticalAlign:s}=e.au(t);return new e.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Zt{constructor(t,e,r,n,i,a){this.transform=t.clone(),this.terrain=r,this.collisionIndex=new Ft(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Ht(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(r,n)=>e.getElevation(t,r,n):null}getBucketParts(t,r,n,i){const a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;const s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/e.X,f=n.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(f),d="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=jt(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=vt(p,d,m,this.transform,g);let _=null;if(d){const t=xt(p,d,m,this.transform,g);_=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[a.bucketInstanceId]=new qt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);const b={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:p,unwrappedTileID:f,textLabelPlaneMatrix:x,labelToScreenMatrix:_,scale:u,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(const e of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=e;t.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:b})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x){const _=e.aq[t.textAnchor],b=[t.textOffset0,t.textOffset1],w=Gt(_,n,i,b,a),T=this.collisionIndex.placeCollisionBox(r,f,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,f,l,c,u,s,o,y,h.predicate,x,w).placeable)&&T.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:n,height:i,anchor:_,textBoxScale:a,prevAnchor:t},this.markUsedJustification(d,_,p,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,r,n){const{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:f,holdingForFade:p,collisionBoxArray:d,partiallyEvaluatedTextSize:m,collisionGroup:g}=t.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=e.ar(a,"text-overlap","text-allow-overlap"),_="always"===x,b=e.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===b,T="map"===a.get("text-rotation-alignment"),k="map"===a.get("text-pitch-alignment"),A="none"!==a.get("icon-text-fit"),M="viewport-y"===a.get("symbol-z-order"),S=_&&(w||!i.hasIconData()||v),E=w&&(_||!i.hasTextData()||y);!i.collisionArrays&&d&&i.deserializeCollisionBoxes(d);const C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),I=(t,d,w)=>{var M,I;if(r[t.crossTileID])return;if(p)return void(this.placements[t.crossTileID]=new Ut(!1,!1,!1));let L=!1,P=!1,z=!0,D=null,O={box:null,placeable:!1,offscreen:null},R={box:null,placeable:!1,offscreen:null},F=null,j=null,B=null,N=0,U=0,V=0;d.textFeatureIndex?N=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),d.verticalTextFeatureIndex&&(U=d.verticalTextFeatureIndex);const q=d.textBox;if(q){const r=r=>{let n=e.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,n=e,this.markUsedOrientation(i,n,t))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(const t of i.writingModes)if(t===e.ah.vertical?(O=n(),R=O):O=r(),O&&O.placeable)break}else O=r()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){const n=(e,r)=>{const n=this.collisionIndex.placeCollisionBox(e,x,f,l,c,k,T,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,t),this.placedOrientations[t.crossTileID]=r),n};a((()=>n(q,e.ah.horizontal)),(()=>{const r=d.verticalTextBox;return i.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?n(r,e.ah.vertical):{box:null,offscreen:null}})),r(O&&O.placeable)}else{let p=e.aq[null===(I=null===(M=this.prevPlacement)||void 0===M?void 0:M.variableOffsets[t.crossTileID])||void 0===I?void 0:I.anchor];const m=(r,a,d)=>{const m=r.x2-r.x1,y=r.y2-r.y1,v=t.textBoxScale,_=A&&"never"===b?a:null;let w=null,M="never"===x?1:2,S="never";p&&M++;for(let e=0;em(q,d.iconBox,e.ah.horizontal)),(()=>{const r=d.verticalTextBox;return i.allowVerticalPlacement&&(!O||!O.placeable)&&t.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}})),O&&(L=O.placeable,z=O.offscreen);const y=r(O&&O.placeable);if(!L&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(i,e.anchor,t,y))}}}if(F=O,L=F&&F.placeable,z=F&&F.offscreen,t.useRuntimeCollisionCircles){const r=i.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ai(i.textSizeData,m,r),f=a.get("text-padding");j=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,k,g.predicate,t.collisionCircleDiameter,f,o,C),j.circles.length&&j.collisionDetected&&!n&&e.w("Collisions detected, but collision boxes are not shown"),L=_||j.circles.length>0&&!j.collisionDetected,z=z&&j.offscreen}if(d.iconFeatureIndex&&(V=d.iconFeatureIndex),d.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,b,f,l,c,k,T,s,g.predicate,C,A&&D?D:void 0);R&&R.placeable&&d.verticalIconBox?(B=t(d.verticalIconBox),P=B.placeable):(B=t(d.iconBox),P=B.placeable),z=z&&B.offscreen}const H=y||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=v||0===t.numIconVertices;H||G?G?H||(P=P&&L):L=P&&L:P=L=P&&L;const Z=P&&B.placeable;if(L&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,R&&R.placeable&&U?U:N,g.ID),Z&&this.collisionIndex.insertCollisionBox(B.box,b,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),j&&L&&this.collisionIndex.insertCollisionCircles(j.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,d,F,B,j),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Ut(L||S,P||E,z||i.justReloaded),r[t.crossTileID]=!0};if(M){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=i.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const r=e[t];I(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let e=t.symbolInstanceStart;e=0&&(t.text.placedSymbolArray.get(e).crossTileID=a>=0&&e!==a?0:n.crossTileID)}markUsedOrientation(t,r,n){const i=r===e.ah.horizontal||r===e.ah.horizontalOnly?r:0,a=r===e.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const e of o)t.text.placedSymbolArray.get(e).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],a=i[t];a?(this.opacities[t]=new Nt(a,n,e.text,e.icon),r=r||e.text!==a.text.placed||e.icon!==a.icon.placed):(this.opacities[t]=new Nt(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(const t in i){const e=i[t];if(!this.opacities[t]){const i=new Nt(e,n,!1,!1);i.isHidden()||(this.opacities[t]=i,r=r||e.text.placed||e.icon.placed)}}for(const t in a)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=a[t]);for(const t in o)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=o[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const r={};for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(t,r,n,i){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();const a=t.layers[0],o=a.layout,s=new Nt(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),f="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),d=new Nt(null,0,l&&(c||!t.hasIconData()||o.get("icon-optional")),c&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const m=(t,e,r)=>{for(let n=0;n0,v=this.placedOrientations[i.crossTileID],x=v===e.ah.vertical,_=v===e.ah.horizontal||v===e.ah.horizontalOnly;if(a>0||o>0){const e=ee(c.text);m(t.text,a,x?re:e),m(t.text,o,_?re:e);const r=c.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||x?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||_?1:0);const n=this.variableOffsets[i.crossTileID];n&&this.markUsedJustification(t,n.anchor,i,v);const s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(t,"left",i,s),this.markUsedOrientation(t,s,i))}if(y){const e=ee(c.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&x);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:re),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=c.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?re:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=c.icon.isHidden())}const b=g&&g.has(r)?g.get(r):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const n=t.collisionArrays[r];if(n){let r=new e.P(0,0);if(n.textBox||n.verticalTextBox){let e=!0;if(u){const t=this.variableOffsets[l];t?(r=Gt(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&r._rotate(f?this.transform.angle:-this.transform.angle)):e=!1}if(n.textBox||n.verticalTextBox){let i;n.textBox&&(i=x),n.verticalTextBox&&(i=_),Wt(t.textCollisionBox.collisionVertexArray,c.text.placed,!e||i,b.text,r.x,r.y)}}if(n.iconBox||n.verticalIconBox){const e=Boolean(!_&&n.verticalIconBox);let i;n.iconBox&&(i=e),n.verticalIconBox&&(i=!e),Wt(t.iconCollisionBox.collisionVertexArray,c.icon.placed,i,b.icon,p?r.x:0,p?r.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){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?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 Wt(t,e,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);const o=n[0]-Rt,s=n[1]-Rt,l=n[2]-Rt,c=n[3]-Rt;t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,s),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,l,c),t.emplaceBack(e?1:0,r?1:0,i||0,a||0,o,c)}const Yt=Math.pow(2,25),Xt=Math.pow(2,24),$t=Math.pow(2,17),Jt=Math.pow(2,16),Kt=Math.pow(2,9),Qt=Math.pow(2,8),te=Math.pow(2,1);function ee(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Yt+e*Xt+r*$t+e*Jt+r*Kt+e*Qt+r*te+e}const re=0;function ne(){return{isOccluded:(t,e,r)=>!1,getPitchedTextCorrection:(t,e,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,r,n){throw new Error("Not implemented.")},translatePosition:(t,e,r,n)=>function(t,e,r,n,i=!1){if(!r[0]&&!r[1])return[0,0];const a=i?"map"===n?t.angle:0:"viewport"===n?-t.angle:0;if(a){const t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}return[i?r[0]:jt(e,r[0],t.zoom),i?r[1]:jt(e,r[1],t.zoom)]}(t,e,r,n),getCircleRadiusCorrection:t=>1}}class ie{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,r,n,i){const a=this._bucketParts;for(;this._currentTileIndext.sortKey-e.sortKey)));this._currentPartIndex!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){const n=e[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new ie(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const oe=512/e.X/2;class se{constructor(t,r,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};const i=new Map;for(let t=0;t({x:Math.floor(t.anchorX*oe),y:Math.floor(t.anchorY*oe)}))),crossTileIDs:r.map((t=>t.crossTileID))};if(n.positions.length>128){const t=new e.av(n.positions.length,16,Uint16Array);for(const{x:e,y:r}of n.positions)t.add(e,r);t.finish(),delete n.positions,n.index=t}this._symbolsByKey[t]=n}}getScaledCoordinates(t,r){const{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=oe/Math.pow(2,l-a),u=(s*e.X+t.anchorY)*c,h=i*e.X*oe;return{x:Math.floor((o*e.X+t.anchorX)*c-n*e.X*oe),y:Math.floor(u-h)}}findMatches(t,e,r){const n=this.tileID.canonical.zt))}}class le{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ce{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const r=this.indexes[t],n={};for(const t in r){const i=r[t];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}this.indexes[t]=n}this.lng=t}addBucket(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;tt.overscaledZ)for(const r in i){const a=i[r];a.tileID.isChildOf(t)&&a.findMatches(e.symbolInstances,t,n)}else{const a=i[t.scaledTo(Number(r)).key];a&&a.findMatches(e.symbolInstances,t,n)}}for(let t=0;t{e[t]=!0}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}const he=(t,r)=>e.t(t,r&&r.filter((t=>"source.canvas"!==t.identifier))),fe=e.aw();class pe extends e.E{constructor(t,r={}){super(),this._rtlPluginLoaded=()=>{for(const t in this.sourceCaches){const e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new U(N(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new E(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new ue,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),lt().on(at,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const r=e.getSource();if(r&&r.vectorLayerIds)for(const t in this._layers){const e=this._layers[t];e.source===r.id&&this._validateLayer(e)}}))}loadURL(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;const i=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const a=this._loadStyleRequest;e.h(i,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,r,n)})).catch((t=>{this._loadStyleRequest=null,t&&!a.signal.aborted&&this.fire(new e.j(t))}))}loadJSON(t,r={},n){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(t,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(fe,{validate:!1})}_load(t,r,n){var i;const a=r.transformStyle?r.transformStyle(n,t):t;if(!r.validate||!he(this,e.u(a))){this._loaded=!0,this.stylesheet=a;for(const t in a.sources)this.addSource(t,a.sources[t],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new z(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(const r of t){const t=e.aA(r);t.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=t}}_loadSprite(t,r=!1,n=void 0){let i;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,r,n,i){return e._(this,void 0,void 0,(function*(){const o=_(t),s=n>1?"@2x":"",l={},c={};for(const{id:t,url:n}of o){const a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[t]=e.h(a,i);const o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[t]=p.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,r){return e._(this,void 0,void 0,(function*(){const e={};for(const n in t){e[n]={};const i=a.getImageCanvasContext((yield r[n]).data),o=(yield t[n]).data;for(const t in o){const{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m}=o[t];e[n][t]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:f,content:p,textFitWidth:d,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return e}))}(l,c)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const n=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(const t of n)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const n in t[e]){const i="default"===e?n:`${e}:${n}`;this._spritesImagesIds[e].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,t[e][n],!1):this.imageManager.addImage(i,t[e][n]),r&&(this._changedImages[i]=!0)}}})).catch((t=>{this._spriteRequest=null,i=t,this.fire(new e.j(i))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),n&&n(i)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){const r=this.sourceCaches[t.source];if(!r)return;const n=t.sourceLayer;if(!n)return;const i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,r=!1){const n=this._serializedAllLayers();if(!t||0===t.length)return Object.values(r?e.aB(n):n);const i=[];for(const a of t)if(n[a]){const t=r?e.aB(n[a]):n[a];i.push(t)}return i}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const r of e){const e=this._layers[r];"custom"!==e.type&&(t[r]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const 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;const r=this._changed;if(r){const e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const n={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(const e of this._order){const r=this._layers[e];r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const t in n){const r=this.sourceCaches[t];!!n[t]!=!!r.used&&r.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,r&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,r={}){var n;this._checkLoaded();const i=this.serialize();if(t=r.transformStyle?r.transformStyle(i,t):t,(null===(n=r.validate)||void 0===n||n)&&he(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);const a=e.aC(i,t),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(const t of o.operations)t();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const e=[],r=[];for(const n of t)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":e.push((()=>{}));break;default:r.push(n.command)}return{operations:e,unimplemented:r}}addImage(t,r){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r,n={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.u.source,`sources.${t}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=this.sourceCaches[t]=new ft(t,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:t}))),i.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));const r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const r=this.sourceCaches[t].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,r,n={}){this._checkLoaded();const i=t.id;if(this.getLayer(i))return void this.fire(new e.j(new Error(`Layer "${i}" already exists on this map.`)));let a;if("custom"===t.type){if(he(this,e.aD(t)))return;a=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(i,t.source),t=e.aB(t),t=e.e(t,{source:i})),this._validate(e.u.layer,`layers.${i}`,t,{arrayIndex:-1},n))return;a=e.aA(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}const o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.j(new Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){const t=this._removedLayers[i];delete this._removedLayers[i],t.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;const n=this._order.indexOf(t);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${r}".`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const r=this._layers[t];if(!r)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));r.setEventedParent(null);const n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,r,n){this._checkLoaded();const i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r,n={}){this._checkLoaded();const i=this.getLayer(t);if(i){if(!e.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=e.aB(r),this._updateLayer(i)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,r,n,i={}){this._checkLoaded();const a=this.getLayer(t);a?e.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){const n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,n,i={}){this._checkLoaded();const a=this.getLayer(t);a?e.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,r){this._checkLoaded();const n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));const o=a.getSource().type;"geojson"===o&&i?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,r){this._checkLoaded();const n=t.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new e.j(new Error(`The source '${n}' does not exist in the map's style.`)));const a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.aF(this.sourceCaches,(t=>t.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return e.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:t,layers:r,terrain:n},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,r={},n=[];for(let i=this._order.length-1;i>=0;i--){const a=this._order[i];if(e(a)){r[a]=i;for(const e of t){const t=e[a];if(t)for(const e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const i=[];for(let a=this._order.length-1;a>=0;a--){const o=this._order[a];if(e(o))for(let t=n.length-1;t>=0;t--){const e=n[t].feature;if(r[e.layer.id]{const n=r.featureSortOrder;if(n){const r=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(const t of i)e.push(t)}}for(const e in s)s[e].forEach((n=>{const i=n.feature,a=r[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}));return s}(this._layers,o,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",r.filter,null,r);const n=this.sourceCaches[t];return n?function(t,e){const r=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],i={};for(let t=0;tt.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const n=this.crossTileSymbolIndex.addLayer(r,l[r.source],t.center.lng);o=o||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),t.zoom))&&(this.pauseablePlacement=new ae(t,this.map.terrain,this._order,i,e,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,r){return e._(this,void 0,void 0,(function*(){const t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,r.icons),t}))}getGlyphs(t,r){return e._(this,void 0,void 0,(function*(){const t=yield this.glyphManager.getGlyphs(r.stacks),e=this.sourceCaches[r.source];return e&&e.setDependencies(r.tileID.key,r.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,r={}){this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,r,n={},i){this._checkLoaded();const a=[{id:t,url:r}],o=[..._(this.stylesheet.sprite),...a];this._validate(e.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(t){this._checkLoaded();const r=_(this.stylesheet.sprite);if(r.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;r.splice(r.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return _(this.stylesheet.sprite)}setSprite(t,r={},n){this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,r)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}var de=e.Y([{name:"a_pos",type:"Int16",components:2}]);const me={prelude:ge("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:ge("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ge("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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:ge("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:ge("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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:ge("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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:ge("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:ge("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:ge("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:ge("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:ge("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:ge("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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:ge("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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:ge("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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\n? a_pos\n: 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:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:ge("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:ge("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:ge("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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:ge("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:ge("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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:ge("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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:ge("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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:ge("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:ge("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:ge("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:ge("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 ge(t,e){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:t=t.replace(r,((t,e,r,n,i)=>(s[i]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:e=e.replace(r,((t,e,r,n,i)=>{const a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class ye{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,r,n,i,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t({u_matrix:t,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function xe(t){const e=[];for(let r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const we=(t,r,n,i)=>{const a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=(c=new e.A(9),e.A!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[5]=0,c[6]=0,c[7]=0),c[0]=1,c[4]=1,c[8]=1,c);var c;"viewport"===a.properties.get("anchor")&&function(t,e){var r=Math.sin(e),n=Math.cos(e);t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-r.transform.angle),function(t,e,r){var n=e[0],i=e[1],a=e[2];t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);const u=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Te=(t,r,n,i,a,o,s)=>e.e(we(t,r,n,i),be(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ke=t=>({u_matrix:t}),Ae=(t,r,n,i)=>e.e(ke(t),be(n,r,i)),Me=(t,e)=>({u_matrix:t,u_world:e}),Se=(t,r,n,i,a)=>e.e(Ae(t,r,n,i),{u_world:a}),Ee=(t,e,r,n)=>{const i=t.transform;let a,o;if("map"===n.paint.get("circle-pitch-alignment")){const t=jt(r,1,i.zoom);a=!0,o=[t,t]}else a=!1,o=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:o}},Ce=(t,e,r)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ie=(t,e,r=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}),Le=t=>({u_matrix:t}),Pe=(t,e,r,n)=>({u_matrix:t,u_extrude_scale:jt(e,1,r),u_intensity:n}),ze=(t,r,n,i)=>{const a=e.H();e.aP(a,0,t.width,t.height,0,0,1);const o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function De(t,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.Z(0,i/n).toLngLat().lat,new e.Z(0,(i+1)/n).toLngLat().lat]}const Oe=(t,e,r,n)=>{const i=t.transform;return{u_matrix:Ne(t,e,r,n),u_ratio:1/jt(e,1,i.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Re=(t,r,n,i,a)=>e.e(Oe(t,r,n,a),{u_image:0,u_image_height:i}),Fe=(t,e,r,n,i)=>{const a=t.transform,o=Be(e,a);return{u_matrix:Ne(t,e,r,i),u_texsize:e.imageAtlasTexture.size,u_ratio:1/jt(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},je=(t,r,n,i,a,o)=>{const s=t.lineAtlas,l=Be(r,t.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),f=u.width*a.fromScale,p=h.width*a.toScale;return e.e(Oe(t,r,n,o),{u_patternscale_a:[l/f,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Be(t,e){return 1/jt(t,1,e.tileZoom)}function Ne(t,e,r,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Ue=(t,e,r,n,i)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ve(i.paint.get("raster-hue-rotate"))};var a,o};function Ve(t){t*=Math.PI/180;const e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}const qe=(t,e,r,n,i,a,o,s,l,c,u,h,f,p)=>{const d=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:d.width/d.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:f,u_texture:0,u_translation:u,u_pitched_scale:p}},He=(t,r,n,i,a,o,s,l,c,u,h,f,p,d,m)=>{const g=s.transform;return e.e(qe(t,r,n,i,a,o,s,l,c,u,h,f,p,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+d})},Ge=(t,r,n,i,a,o,s,l,c,u,h,f,p,d)=>e.e(He(t,r,n,i,a,o,s,l,c,u,h,!0,f,!0,d),{u_texsize_icon:p,u_texture_icon:1}),Ze=(t,e,r)=>({u_matrix:t,u_opacity:e,u_color:r}),We=(t,r,n,i,a,o)=>e.e(function(t,e,r,n){const i=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/jt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:t,u_opacity:r}),Ye={fillExtrusion:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_opacity:new e.aI(t,r.u_opacity)}),fillExtrusionPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_lightpos:new e.aN(t,r.u_lightpos),u_lightintensity:new e.aI(t,r.u_lightintensity),u_lightcolor:new e.aN(t,r.u_lightcolor),u_vertical_gradient:new e.aI(t,r.u_vertical_gradient),u_height_factor:new e.aI(t,r.u_height_factor),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade),u_opacity:new e.aI(t,r.u_opacity)}),fill:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),fillPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),fillOutline:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world)}),fillOutlinePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_texsize:new e.aO(t,r.u_texsize),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),circle:(t,r)=>({u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,r.u_scale_with_map),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_extrude_scale:new e.aO(t,r.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_matrix:new e.aJ(t,r.u_matrix)}),collisionBox:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_pixel_extrude_scale:new e.aO(t,r.u_pixel_extrude_scale)}),collisionCircle:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_inv_matrix:new e.aJ(t,r.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_viewport_size:new e.aO(t,r.u_viewport_size)}),debug:(t,r)=>({u_color:new e.aL(t,r.u_color),u_matrix:new e.aJ(t,r.u_matrix),u_overlay:new e.aH(t,r.u_overlay),u_overlay_scale:new e.aI(t,r.u_overlay_scale)}),clippingMask:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix)}),heatmap:(t,r)=>({u_extrude_scale:new e.aI(t,r.u_extrude_scale),u_intensity:new e.aI(t,r.u_intensity),u_matrix:new e.aJ(t,r.u_matrix)}),heatmapTexture:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_world:new e.aO(t,r.u_world),u_image:new e.aH(t,r.u_image),u_color_ramp:new e.aH(t,r.u_color_ramp),u_opacity:new e.aI(t,r.u_opacity)}),hillshade:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_latrange:new e.aO(t,r.u_latrange),u_light:new e.aO(t,r.u_light),u_shadow:new e.aL(t,r.u_shadow),u_highlight:new e.aL(t,r.u_highlight),u_accent:new e.aL(t,r.u_accent)}),hillshadePrepare:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_image:new e.aH(t,r.u_image),u_dimension:new e.aO(t,r.u_dimension),u_zoom:new e.aI(t,r.u_zoom),u_unpack:new e.aK(t,r.u_unpack)}),line:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels)}),lineGradient:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_image:new e.aH(t,r.u_image),u_image_height:new e.aI(t,r.u_image_height)}),linePattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texsize:new e.aO(t,r.u_texsize),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_image:new e.aH(t,r.u_image),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_scale:new e.aN(t,r.u_scale),u_fade:new e.aI(t,r.u_fade)}),lineSDF:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ratio:new e.aI(t,r.u_ratio),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,r.u_units_to_pixels),u_patternscale_a:new e.aO(t,r.u_patternscale_a),u_patternscale_b:new e.aO(t,r.u_patternscale_b),u_sdfgamma:new e.aI(t,r.u_sdfgamma),u_image:new e.aH(t,r.u_image),u_tex_y_a:new e.aI(t,r.u_tex_y_a),u_tex_y_b:new e.aI(t,r.u_tex_y_b),u_mix:new e.aI(t,r.u_mix)}),raster:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_tl_parent:new e.aO(t,r.u_tl_parent),u_scale_parent:new e.aI(t,r.u_scale_parent),u_buffer_scale:new e.aI(t,r.u_buffer_scale),u_fade_t:new e.aI(t,r.u_fade_t),u_opacity:new e.aI(t,r.u_opacity),u_image0:new e.aH(t,r.u_image0),u_image1:new e.aH(t,r.u_image1),u_brightness_low:new e.aI(t,r.u_brightness_low),u_brightness_high:new e.aI(t,r.u_brightness_high),u_saturation_factor:new e.aI(t,r.u_saturation_factor),u_contrast_factor:new e.aI(t,r.u_contrast_factor),u_spin_weights:new e.aN(t,r.u_spin_weights)}),symbolIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolSDF:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texture:new e.aH(t,r.u_texture),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),symbolTextAndIcon:(t,r)=>({u_is_size_zoom_constant:new e.aH(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,r.u_is_size_feature_constant),u_size_t:new e.aI(t,r.u_size_t),u_size:new e.aI(t,r.u_size),u_camera_to_center_distance:new e.aI(t,r.u_camera_to_center_distance),u_pitch:new e.aI(t,r.u_pitch),u_rotate_symbol:new e.aH(t,r.u_rotate_symbol),u_aspect_ratio:new e.aI(t,r.u_aspect_ratio),u_fade_change:new e.aI(t,r.u_fade_change),u_matrix:new e.aJ(t,r.u_matrix),u_label_plane_matrix:new e.aJ(t,r.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,r.u_coord_matrix),u_is_text:new e.aH(t,r.u_is_text),u_pitch_with_map:new e.aH(t,r.u_pitch_with_map),u_is_along_line:new e.aH(t,r.u_is_along_line),u_is_variable_anchor:new e.aH(t,r.u_is_variable_anchor),u_texsize:new e.aO(t,r.u_texsize),u_texsize_icon:new e.aO(t,r.u_texsize_icon),u_texture:new e.aH(t,r.u_texture),u_texture_icon:new e.aH(t,r.u_texture_icon),u_gamma_scale:new e.aI(t,r.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,r.u_device_pixel_ratio),u_is_halo:new e.aH(t,r.u_is_halo),u_translation:new e.aO(t,r.u_translation),u_pitched_scale:new e.aI(t,r.u_pitched_scale)}),background:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_color:new e.aL(t,r.u_color)}),backgroundPattern:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_opacity:new e.aI(t,r.u_opacity),u_image:new e.aH(t,r.u_image),u_pattern_tl_a:new e.aO(t,r.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,r.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,r.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,r.u_pattern_br_b),u_texsize:new e.aO(t,r.u_texsize),u_mix:new e.aI(t,r.u_mix),u_pattern_size_a:new e.aO(t,r.u_pattern_size_a),u_pattern_size_b:new e.aO(t,r.u_pattern_size_b),u_scale_a:new e.aI(t,r.u_scale_a),u_scale_b:new e.aI(t,r.u_scale_b),u_pixel_coord_upper:new e.aO(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,r.u_tile_units_to_pixels)}),terrain:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_ele_delta:new e.aI(t,r.u_ele_delta),u_fog_matrix:new e.aJ(t,r.u_fog_matrix),u_fog_color:new e.aL(t,r.u_fog_color),u_fog_ground_blend:new e.aI(t,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,r.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon_fog_blend:new e.aI(t,r.u_horizon_fog_blend)}),terrainDepth:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_ele_delta:new e.aI(t,r.u_ele_delta)}),terrainCoords:(t,r)=>({u_matrix:new e.aJ(t,r.u_matrix),u_texture:new e.aH(t,r.u_texture),u_terrain_coords_id:new e.aI(t,r.u_terrain_coords_id),u_ele_delta:new e.aI(t,r.u_ele_delta)}),sky:(t,r)=>({u_sky_color:new e.aL(t,r.u_sky_color),u_horizon_color:new e.aL(t,r.u_horizon_color),u_horizon:new e.aI(t,r.u_horizon),u_sky_horizon_blend:new e.aI(t,r.u_sky_horizon_blend)})};class Xe{constructor(t,e,r){this.context=t;const n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const $e={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Je{constructor(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;const i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.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}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let r=0;r0){const r=e.H();e.aQ(r,m.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(r,r,m.placementViewportMatrix),c.push({circleArray:y,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=y.length/4,h=u}g&&l.draw(o,s.LINES,Br.disabled,Ur.disabled,t.colorModeForRenderPass(),Vr.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(f=t.transform).width,1/f.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}var f;if(!a||!c.length)return;const p=t.useProgram("collisionCircle"),d=new e.aR;d.resize(4*u),d._trim();let m=0;for(const t of c)for(let e=0;e=0&&(v[x.associatedIconIndex]={shiftedAnchor:I,angle:L})}else Dt(x.numGlyphs,g)}if(u){y.clear();const r=t.icon.placedSymbolArray;for(let t=0;tt.style.map.terrain.getElevation(l,e,r):null,r="map"===n.layout.get("text-rotation-alignment");Tt(c,l.posMatrix,t,a,N,V,v,u,r,g,l.toUnwrapped(),m.width,m.height,q,e)}const Z=l.posMatrix,W=a&&A||G,Y=x||W?Gr:N,X=U,$=p&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let J;J=p?c.iconsInText?Ge(k.kind,I,_,v,x,W,t,Z,Y,X,q,P,R,S):He(k.kind,I,_,v,x,W,t,Z,Y,X,q,a,P,!0,S):qe(k.kind,I,_,v,x,W,t,Z,Y,X,q,a,P,S);const K={program:C,buffers:h,uniformValues:J,atlasTexture:z,atlasTextureIcon:F,atlasInterpolation:D,atlasInterpolationIcon:O,isSDF:p,hasHalo:$};if(w&&c.canOverlap){T=!0;const t=h.segments.get();for(const r of t)M.push({segments:new e.a0([r]),sortKey:r.sortKey,state:K,terrainData:L})}else M.push({segments:h.segments,sortKey:0,state:K,terrainData:L})}T&&M.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of M){const r=e.state;if(p.activeTexture.set(d.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,d.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Jr(r.buffers,e.segments,n,t,r.program,k,h,f,i,e.terrainData)),i.u_is_halo=0}Jr(r.buffers,e.segments,n,t,r.program,k,h,f,r.uniformValues,e.terrainData)}}function Jr(t,e,r,n,i,a,o,s,l,c){const u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Vr.disabled,l,c,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Kr(t,r,n,i){const a=t.context,o=a.gl,s=Ur.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;const u=i.key;let h=n.heatmapFbos.get(u);h||(h=tn(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:e.aM.transparent});const f=c.programConfigurations.get(n.id),p=t.useProgram("heatmap",f),d=t.style.map.terrain.getTerrainData(i);p.draw(a,o.TRIANGLES,Br.disabled,s,l,Vr.disabled,Pe(i.posMatrix,r,t.transform.zoom,n.paint.get("heatmap-intensity")),d,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,t.transform.zoom,f)}function Qr(t,e,r){const n=t.context,i=n.gl;n.setColorMode(t.colorModeForRenderPass());const a=en(n,e),o=r.key,s=e.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Br.disabled,Ur.disabled,t.colorModeForRenderPass(),Vr.disabled,ze(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),s.destroy(),e.heatmapFbos.delete(o))}function tn(t,e,r){var n,i;const a=t.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const s=null!==(n=t.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=t.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,e,r,0,a.RGBA,s,null);const c=t.createFramebuffer(e,r,!1,!1);return c.colorAttachment.set(o),c}function en(t,e){return e.colorRampTexture||(e.colorRampTexture=new w(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function rn(t,e,r,n,i){if(!r||!n||!n.imageAtlas)return;const a=n.imageAtlas.patternPositions;let o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){const t=i.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function nn(t,e,r,n,i,a,o){const s=t.context.gl,l="fill-pattern",c=r.paint.get(l),u=c&&c.constantOr(1),h=r.getCrossfadeParameters();let f,p,d,m,g;o?(p=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",f=s.LINES):(p=u?"fillPattern":"fill",f=s.TRIANGLES);const y=c.constantOr(null);for(const c of n){const n=e.getTile(c);if(u&&!n.patternsLoaded())continue;const v=n.getBucket(r);if(!v)continue;const x=v.programConfigurations.get(r.id),_=t.useProgram(p,x),b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c);u&&(t.context.activeTexture.set(s.TEXTURE0),n.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),x.updatePaintBuffers(h)),rn(x,l,y,n,r);const w=b?c:null,T=t.translatePosMatrix(w?w.posMatrix:c.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){m=v.indexBuffer2,g=v.segments2;const e=[s.drawingBufferWidth,s.drawingBufferHeight];d="fillOutlinePattern"===p&&u?Se(T,t,h,n,e):Me(T,e)}else m=v.indexBuffer,g=v.segments,d=u?Ae(T,t,h,n):ke(T);_.draw(t.context,f,i,t.stencilModeForClipping(c),a,Vr.disabled,d,b,r.id,v.layoutVertexBuffer,m,g,r.paint,t.transform.zoom,x)}}function an(t,e,r,n,i,a,o){const s=t.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),f=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=u.constantOr(null);for(const u of n){const n=e.getTile(u),m=n.getBucket(r);if(!m)continue;const g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(u),y=m.programConfigurations.get(r.id),v=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(f)),rn(y,c,d,n,r);const x=t.translatePosMatrix(u.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),_=r.paint.get("fill-extrusion-vertical-gradient"),b=h?Te(x,t,_,p,u,f,n):we(x,t,_,p);v.draw(s,s.gl.TRIANGLES,i,a,o,Vr.backCCW,b,g,r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,r.paint,t.transform.zoom,y,t.style.map.terrain&&m.centroidVertexBuffer)}}function on(t,e,r,n,i,a,o){const s=t.context,l=s.gl,c=r.fbo;if(!c)return;const u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,Vr.disabled,((t,e,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);const l=!t.options.moving;return{u_matrix:n?n.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:De(0,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(t,r,n,h?e:null),h,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function sn(t,r,n,i,a,o){const s=t.context,l=s.gl,c=r.dem;if(c&&c.data){const u=c.dim,h=c.stride,f=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){const t=r.demTexture;t.update(f,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new w(s,f,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=r.fbo;if(!p){const t=new w(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=r.fbo=s.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Vr.disabled,((t,r)=>{const n=r.stride,i=e.H();return e.aP(i,0,e.X,-e.X,0,0,1),e.J(i,i,[0,-e.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(t,r,n,i,o,s){const l=i.paint.get("raster-fade-duration");if(!s&&l>0){const i=a.now(),s=(i-t.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),f=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),p=f&&t.refreshedUponExpiration?1:e.ac(f?s:1-c,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const cn=new e.aM(1,0,0,1),un=new e.aM(0,1,0,1),hn=new e.aM(0,0,1,1),fn=new e.aM(1,0,1,1),pn=new e.aM(0,1,1,1);function dn(t,e,r,n){gn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){gn(t,e-r/2,0,r,t.transform.height,n)}function gn(t,e,r,n,i,a){const o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio,i*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function yn(t,r,n){const i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Br.disabled,c=Ur.disabled,u=t.colorModeForRenderPass(),h="$debug",f=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);const p=r.getTileByID(n.key).latestRawTileData,d=Math.floor((p&&p.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5;let y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${y} ${d}kB`),s.draw(i,a.TRIANGLES,l,c,Fr.alphaBlended,Vr.disabled,Ie(o,e.aM.transparent,g),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,Vr.disabled,Ie(o,e.aM.red),f,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function vn(t,e,r){const n=t.context,i=n.gl,a=t.colorModeForRenderPass(),o=new Br(i.LEQUAL,Br.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]);for(const c of r){const r=t.renderToTexture.getTexture(c),u=e.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);const h=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),f=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(c.tileID.toUnwrapped()),d=ve(h,f,p,t.style.sky,t.transform.pitch);s.draw(n,i.TRIANGLES,o,Ur.disabled,a,Vr.backCCW,d,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class xn{constructor(t,e,r){this.vertexBuffer=t,this.indexBuffer=e,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class _n{constructor(t,r){this.context=new jr(t),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ft.maxUnderzooming+ft.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ue}resize(t,e,r){if(this.width=Math.floor(t*r),this.height=Math.floor(e*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style._order)this.style._layers[t].resize()}setup(){const t=this.context,r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(r,de.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const n=new e.aX;n.emplaceBack(0,0),n.emplaceBack(e.X,0),n.emplaceBack(0,e.X),n.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(n,de.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const i=new e.$;i.emplaceBack(0,0,0,0),i.emplaceBack(e.X,0,e.X,0),i.emplaceBack(0,e.X,0,e.X),i.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(i,Q.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,de.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const o=new e.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);const s=new e.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const l=this.context.gl;this.stencilClearMode=new Ur({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=e.H();e.aP(n,0,this.width,this.height,0,0,1),e.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Br.disabled,this.stencilClearMode,Fr.disabled,Vr.disabled,Le(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;const r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Fr.disabled),r.setDepthMode(Br.disabled);const i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of e){const e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);i.draw(r,n.TRIANGLES,Br.disabled,new Ur({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),Fr.disabled,Vr.disabled,Le(t.posMatrix),a,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new Ur({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new Ur({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,r=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const t={};for(let r=0;r=0;this.currentLayer--){const t=this.style._layers[n[this.currentLayer]],e=i[t.source],r=o[t.source];this._renderTileClippingMasks(t,r),this.renderLayer(this,e,t,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerr.source&&!r.isHidden(e)?[t.sourceCaches[r.source]]:[])),i=n.filter((t=>"vector"===t.getSource().type)),a=n.filter((t=>"vector"!==t.getSource().type)),o=t=>{(!r||r.getSource().maxzoomo(t))),r||a.forEach((t=>o(t))),r}(this.style,this.transform.zoom);t&&function(t,e,r){for(let n=0;n0),i&&(e.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){const n=t.context,i=n.gl,a=Fr.unblended,o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1});for(const e of l){const l=r.getTerrainData(e.tileID),u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};c.draw(n,i.TRIANGLES,o,Ur.disabled,a,Vr.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,r){const n=t.context,i=n.gl,a=Fr.unblended,o=new Br(i.LEQUAL,Br.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aM.transparent,depth:1}),r.coordsIndex=[];for(const e of c){const c=r.getTerrainData(e.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);const h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(t.transform.zoom)};u.draw(n,i.TRIANGLES,o,Ur.disabled,a,Vr.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(e.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,r,n,i,a){if("translucent"!==t.renderPass)return;const o=Ur.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,r,n,i,a,o,s,l,c){const u=r.transform,h=ne(),f="map"===a,p="map"===o;for(const a of t){const t=i.getTile(a),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const d=e.ag(o.textSizeData,u.zoom),m=jt(t,1,r.transform.zoom),g=vt(a.posMatrix,p,f,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(d){const e=Math.pow(2,u.zoom-t.tileID.overscaledZ),n=r.style.map.terrain?(t,e)=>r.style.map.terrain.getElevation(a,t,e):null,i=h.translatePosition(u,t,s,l);Yr(o,f,p,c,u,g,a.posMatrix,e,d,y,h,i,a.toUnwrapped(),n)}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&$r(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&$r(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(Hr(t,r,n,i,!0),Hr(t,r,n,i,!1))}(t,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(t,r,n,i){if("translucent"!==t.renderPass)return;const a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.depthModeForSublayer(0,Br.ReadOnly),f=Ur.disabled,p=t.colorModeForRenderPass(),d=[];for(let a=0;at.sortKey-e.sortKey));for(const e of d){const{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;i.draw(c,u.TRIANGLES,h,f,p,Vr.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,r)}}(t,r,n,i);break;case"heatmap":!function(t,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;const a=t.context;if(t.style.map.terrain){for(const e of i){const i=r.getTile(e);r.hasRenderableParent(e)||("offscreen"===t.renderPass?Kr(t,i,n,e):"translucent"===t.renderPass&&Qr(t,n,e))}a.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,r,n,i){const a=t.context,o=a.gl,s=Ur.disabled,l=new Fr([o.ONE,o.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,r,n){const i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(e.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=tn(t,r.width/4,r.height/4),n.heatmapFbos.set(e.aU,a))})(a,t,n),a.clear({color:e.aM.transparent});for(let e=0;e20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);const _=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n),b=_?n:null,w=b?b.posMatrix:t.transform.calculatePosMatrix(n.toUnwrapped(),f),T=Ue(w,v||[0,0],y||1,g,r);o instanceof tt?s.draw(i,a.TRIANGLES,u,Ur.disabled,l,Vr.disabled,T,_,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,u,c[n.overscaledZ],l,Vr.disabled,T,_,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,r,n,i);break;case"background":!function(t,e,r,n){const i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const o=t.context,s=o.gl,l=t.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(t.isPatternMissing(u))return;const h=!u&&1===i.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;const f=Ur.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Br.ReadWrite:Br.ReadOnly),d=t.colorModeForRenderPass(),m=t.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));const y=r.getCrossfadeParameters();for(const e of g){const l=n?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),h=u?We(l,a,t,u,{tileID:e,tileSize:c},y):Ze(l,a,i),g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);m.draw(o,s.TRIANGLES,p,f,d,Vr.disabled,h,g,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,i);break;case"custom":!function(t,e,r){const n=t.context,i=r.implementation;if("offscreen"===t.renderPass){const e=i.prerender;e&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),e.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Ur.disabled);const e="3d"===i.renderingMode?new Br(t.context.gl.LEQUAL,Br.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Br.ReadOnly);n.setDepthMode(e),i.render(n.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}(t,0,n)}}translatePosMatrix(t,r,n,i,a){if(!n[0]&&!n[1])return t;const o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){const t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}const s=[a?n[0]:jt(r,n[0],this.transform.zoom),a?n[1]:jt(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,s),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r}useProgram(t,e){this.cache=this.cache||{};const r=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new _e(this.context,me[t],e,Ye[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new w(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class bn{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,r,n){const i=Math.pow(2,n),a=[[-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((n=>{const a=1/(n=e.af([],n,t))[3]/r*i;return e.b1(n,n,[a,a,1/n[3],a])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}([],(n=[],i=y([],a[t[0]],a[t[1]]),o=y([],a[t[2]],a[t[1]]),s=i[0],l=i[1],c=i[2],u=o[0],h=o[1],f=o[2],n[0]=l*f-c*h,n[1]=c*u-s*f,n[2]=s*h-l*u,n)),r=-((p=e)[0]*(d=a[t[1]])[0]+p[1]*d[1]+p[2]*d[2]);var n,i,o,s,l,c,u,h,f,p,d;return e.concat(r)}));return new bn(a,o)}}class wn{constructor(t,e){var r,n,i;this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(t){const e=[t%2==0,t<2],r=m(this.min),n=m(this.max);for(let t=0;t=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;ithis.max[e]-this.min[e])return 0}return 1}}class Tn{constructor(t=0,e=0,r=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n}interpolate(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.y.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.y.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.y.number(t.right,r.right,n)),this}getCenter(t,r){const n=e.ac((this.left+t-this.right)/2,0,t),i=e.ac((this.top+r-this.bottom)/2,0,r);return new e.P(n,i)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Tn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const kn=85.051129;class An{constructor(t,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new An(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.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.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){void 0===t?t=!0:null===t&&(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 e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const r=-e.b3(t,-180,180)*Math.PI/180;var n;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(n=new e.A(4),e.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const r=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,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){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),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,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){const r=[new e.b4(0,t)];if(this._renderWorldCopies){const n=this.pointCoordinate(new e.P(0,0)),i=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let n=s-c;n<=l+c;n++)0!==n&&r.push(new e.b4(n,t))}return r}coveringTiles(t){var r,n;let i=this.coveringZoomLevel(t);const a=i;if(void 0!==t.minzoom&&it.maxzoom&&(i=t.maxzoom);const o=this.pointCoordinate(this.getCameraPoint()),s=e.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i);let f=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(f=i);const p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,d=t=>({aabb:new wn([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],g=[],y=i,v=t.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(d(-t)),m.push(d(t));for(m.push(d(0));m.length>0;){const i=m.pop(),a=i.x,o=i.y;let s=i.fullyVisible;if(!s){const t=i.aabb.intersects(h);if(0===t)continue;s=2===t}const l=t.terrain?c:u,d=i.aabb.distanceX(l),_=i.aabb.distanceY(l),b=Math.max(Math.abs(d),Math.abs(_));if(i.zoom===y||b>p+(1<=f){const t=y-i.zoom,r=c[0]-.5-(a<>1),h=i.zoom+1;let f=i.aabb.quadrant(l);if(t.terrain){const a=new e.S(h,i.wrap,h,c,u),o=t.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,l=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;f=new wn([f.min[0],f.min[1],s],[f.max[0],f.max[1],l])}m.push({aabb:f,zoom:h,x:c,y:u,wrap:i.wrap,fullyVisible:s})}}return g.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],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){const r=e.ac(t.lat,-85.051129,kn);return new e.P(e.O(t.lng)*this.worldSize,e.Q(r)*this.worldSize)}unproject(t){return new e.Z(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){const r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;const o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/e.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(t,r){const n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,r){if(r){const e=r.pointCoordinate(t);if(null!=e)return e}const n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(i,i,this.pixelMatrixInverse);const a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new e.Z(e.y.number(n[0]/a,i[0]/o,h)/this.worldSize,e.y.number(s,l,h)/this.worldSize)}coordinatePoint(t,r=0,n=this.pixelMatrix){const i=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.af(i,i,n),new e.P(i[0]/i[3],i[1]/i[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([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=[-85.051129,kn])}calculateTileMatrix(t){const r=t.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*t.wrap,a=e.an(new Float64Array(16));return e.J(a,a,[i*n,r.y*n,0]),e.K(a,a,[n/e.X,n/e.X,1]),a}calculatePosMatrix(t,r=!1){const n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];const a=this.calculateTileMatrix(t);return e.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(t){const r=t.key,n=this._fogMatrixCache;if(n[r])return n[r];const i=this.calculateTileMatrix(t);return e.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,r){r=e.ac(+r,this.minZoom,this.maxZoom);const n={center:new e.N(t.lng,t.lat),zoom:r};let i=this.lngRange;if(!this._renderWorldCopies&&null===i){const t=180-1e-10;i=[-t,t]}const a=this.tileSize*this.zoomScale(n.zoom);let o=0,s=a,l=0,c=a,u=0,h=0;const{x:f,y:p}=this.size;if(this.latRange){const t=this.latRange;o=e.Q(t[1])*a,s=e.Q(t[0])*a,s-os&&(y=s-t)}if(i){const t=(l+c)/2;let r=d;this._renderWorldCopies&&(r=e.b3(d,t-a/2,t+a/2));const n=f/2;r-nc&&(g=c-n)}if(void 0!==g||void 0!==y){const t=new e.P(null!=g?g:d,null!=y?y:m);n.center=this.unproject.call({worldSize:a},t).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=r,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let i=e.an(new Float64Array(16));e.K(i,i,[this.width/2,-this.height/2,1]),e.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=e.an(new Float64Array(16)),e.K(i,i,[1,-1,1]),e.J(i,i,[-1,-1,0]),e.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),h=Math.sin(u)*l/Math.sin(e.ac(Math.PI-c-u,.01,Math.PI-.01)),f=this.getHorizon(),p=2*Math.atan(f/this.cameraToCenterDistance)*(.5+t.y/(2*f)),d=Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(h,d);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),e.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.projectionMatrix=e.ae(i),e.K(i,i,[1,-1,1]),e.J(i,i,[0,0,-this.cameraToCenterDistance]),e.b7(i,i,this._pitch),e.ad(i,i,this.angle),e.J(i,i,[-r,-n,0]),this.mercatorMatrix=e.K([],i,[this.worldSize,this.worldSize,this.worldSize]),e.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,i),e.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=e.as([],i),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,i);const g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),_=r-Math.round(r)+v*g+x*y,b=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(e.J(w,w,[_>.5?_-1:_,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,i=e.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new e.P(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){const r=this.getCameraPoint();if(1===t.length)return[t[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(const e of t)n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,i),new e.P(a,i),new e.P(a,o),new e.P(n,o),new e.P(n,i)]}}lngLatToCameraDepth(t,r){const n=this.locationCoordinate(t),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return e.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Mn(t,e){let r,n=!1,i=null,a=null;const o=()=>{i=null,n&&(t.apply(a,r),i=setTimeout(o,e),n=!1)};return(...t)=>(n=!0,a=this,r=t,i||o(),i)}class Sn{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let r=e;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${e}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Mn(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===t?(e=!0,`${n}=${c}`):r})).filter((t=>t));return e||r.push(`${t}=${c}`),`#${r.join("&")}`}return`#${c}`}}const En={linearity:.3,easing:e.b8(0,0,.3,1)},Cn=e.e({deceleration:2500,maxSpeed:1400},En),In=e.e({deceleration:20,maxSpeed:1400},En),Ln=e.e({deceleration:1e3,maxSpeed:360},En),Pn=e.e({deceleration:1e3,maxSpeed:90},En);class zn{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=a.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const a=On(r.pan.mag(),n,e.e({},Cn,t||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,Dn(i,a)}if(r.zoom){const t=On(r.zoom,n,In);i.zoom=this._map.transform.zoom+t.amount,Dn(i,t)}if(r.bearing){const t=On(r.bearing,n,Ln);i.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),Dn(i,t)}if(r.pitch){const t=On(r.pitch,n,Pn);i.pitch=this._map.transform.pitch+t.amount,Dn(i,t)}if(i.zoom||i.bearing){const t=void 0===r.pinchAround?r.around:r.pinchAround;i.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(i,{noMoveStart:!0})}}function Dn(t,e){(!t.duration||t.durationr.unproject(t))),l=a.reduce(((t,e,r,n)=>t.add(e.div(n.length))),new e.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class jn extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,r){super(t,{originalEvent:r}),this._defaultPrevented=!1}}class Bn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new jn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Rn(t.type,this._map,t))}mouseup(t){this._map.fire(new Rn(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Rn(t.type,this._map,t))}mouseover(t){this._map.fire(new Rn(t.type,this._map,t))}mouseout(t){this._map.fire(new Rn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Fn(t.type,this._map,t))}touchmove(t){this._map.fire(new Fn(t.type,this._map,t))}touchend(t){this._map.fire(new Fn(t.type,this._map,t))}touchcancel(t){this._map.fire(new Fn(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Rn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Un{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(e.P.convert(t),this._map.terrain)}}class Vn{constructor(t,e){this._map=t,this._tr=new Un(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const r=e;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)t.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.k(t,{originalEvent:r}))}}function qn(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const r={};for(let n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const r=new e.P(0,0);for(const e of t)r._add(e);return r.div(t.length)}(r),this.touches=qn(n,r)))}touchmove(t,e,r){if(this.aborted||!this.centroid)return;const n=qn(r,e);for(const t in this.touches){const e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class Gn{constructor(t){this.singleTap=new Hn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,r){this.singleTap.touchstart(t,e,r)}touchmove(t,e,r){this.singleTap.touchmove(t,e,r)}touchend(t,e,r){const n=this.singleTap.touchend(t,e,r);if(n){const e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Zn{constructor(t){this._tr=new Un(t),this._zoomIn=new Gn({numTouches:1,numTaps:2}),this._zoomOut=new Gn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)}touchmove(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)}touchend(t,e,r){const n=this._zoomIn.touchend(t,e,r),i=this._zoomOut.touchend(t,e,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):i?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{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 Wn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const r=this._lastPoint;if(!r)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const n=e.length?e[0]:e;return!this._moved&&n.dist(r){t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Kn=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{const n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Jn})},Qn=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{const n=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&t.ctrlKey||2===o.mouseButton(t)});return new Wn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Jn})};class ti{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,r){return this._calculateTransform(t,e,r)}touchmove(t,e,r){if(this._active){if(!this._shouldBePrevented(r.length))return t.preventDefault(),this._calculateTransform(t,e,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,r){this._calculateTransform(t,e,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,n){n.length>0&&(this._active=!0);const i=qn(n,r),a=new e.P(0,0),o=new e.P(0,0);let s=0;for(const t in i){const e=i[t],r=this._touches[t];r&&(a._add(e),o._add(e.sub(r)),s++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;const l=o.div(s);return this._sum._add(l),this._sum.mag()Math.abs(t.x)}class li extends ei{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,r){super.touchstart(t,e,r),this._currentTouchCount=r.length}_start(t){this._lastPoints=t,si(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,r){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,i=e.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const a=t.y>0==e.y>0;return si(t)&&si(e)&&a}}const ci={panStep:100,bearingStep:15,pitchStep:10};class ui{constructor(t){this._tr=new Un(t);const e=ci;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{const s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:hi,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.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 hi(t){return t*(2-t)}const fi=4.000244140625;class pi{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Un(t),this._triggerRenderFrame=e,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||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==e&&e%fi==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,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);const r=o.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?e.N.convert(this._aroundCenter?n.center:n.unproject(r)):e.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>fi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:t.zoom,n=this._startZoom,i=this._easing;let o,s=!1;const l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&n&&i&&l){const t=Math.min(l/200,1),a=i(t);o=e.y.number(n,r,a),t<1?this._frameId||(this._frameId=!0):s=!0}else o=r,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.b9;if(this._prevEase){const t=this._prevEase,n=(a.now()-t.start)/t.duration,i=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:t,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 mi{constructor(t){this._tr=new Un(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(){this._tap=new Gn({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,e,r){if(!this._swipePoint)if(this._tapTime){const n=e[0],i=t.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(t,e,r)}touchmove(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)}touchend(t,e,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{const n=this._tap.touchend(t,e,r);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yi{constructor(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}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 vi{constructor(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}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 xi{constructor(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,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()}}class _i{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);const i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.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(t){return t[this._bypassKey]}notifyGestureBlocked(t,r){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const bi=t=>t.zoom||t.drag||t.pitch||t.rotate;class wi extends e.k{}function Ti(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class ki{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},i={},a={},s=t.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),t);for(const{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,u,o)?s.reset():s[e||t.type]&&(h=s[e||t.type](t,c,l),this.mergeHandlerResult(n,i,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}const u={};for(const t in this._previousActiveHandlers)a[t]||(u[t]=r);this._previousActiveHandlers=a,(Object.keys(u).length||Ti(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||Ti(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zn(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[t,e,r]of this._listeners)o.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(const[t,e,r]of this._listeners)o.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(t){const e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Bn(e,t));const n=e.boxZoom=new Vn(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();const i=e.cooperativeGestures=new _i(e,t.cooperativeGestures);this._add("cooperativeGestures",i),t.cooperativeGestures&&i.enable();const a=new Zn(e),s=new mi(e);e.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();const l=new gi;this._add("tapDragZoom",l);const c=e.touchPitch=new li(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);const u=Kn(t),h=Qn(t);e.dragRotate=new vi(t,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();const f=(({enable:t,clickTolerance:e})=>{const r=new Xn({checkCorrectEvent:t=>0===o.mouseButton(t)&&!t.ctrlKey});return new Wn({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:r,enable:t,assignEvents:Jn})})(t),p=new ti(t,e);e.dragPan=new yi(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);const d=new oi,m=new ii;e.touchZoomRotate=new xi(r,m,d,l),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);const g=e.scrollZoom=new pi(e,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);const y=e.keyboard=new ui(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new Nn(e))}_add(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(bi(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,r){for(const n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const r of t)this._el.contains(r.target)&&e.push(r);return e}mergeHandlerResult(t,r,n,i,a){if(!n)return;e.e(t,n);const o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){const t={},r={},n={};for(const[i,a,o]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.e(r,a),e.e(n,o);this._updateMapTransform(t,r,n),this._changes=[]}_updateMapTransform(t,e,r){const n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(Ti(t)||a&&this._terrainMovement))return this._fireEvents(e,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=t;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;const f=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),a?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(f,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(f,u)):i.setLocationAtPoint(f,u),n._applyUpdatedTransform(i),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)}_fireEvents(t,r,n){const i=bi(this._eventsInProgress),o=bi(t),s={};for(const e in t){const{originalEvent:r}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:r}=t[e];this._fireEvent(e,r)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=r[e]||n,l[`${t}end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(n&&h){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=t=>0!==t&&-this._bearingSnap{delete this._frameId,this.handleEvent(new wi("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ai extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{const t=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,r,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},r),n)}panTo(t,r,n){return this.easeTo(e.e({center:t},r),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,r,n){return this.easeTo(e.e({zoom:t},r),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,r,n){return this.easeTo(e.e({bearing:t},r),n)}resetNorth(t,r){return this.rotateTo(0,e.e({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(t,e){return Math.abs(this.getBearing()){if(this._zooming&&(i.zoom=e.y.number(o,y,n)),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,f,n),d=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),b)i.setLocationAtPoint(b,w);else{const t=i.zoomScale(i.zoom-o),e=y>o?Math.min(2,_):Math.max(.5,_),r=Math.pow(e,1-n),a=i.unproject(v.add(x.mult(n*r)).mult(t));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,d)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r,e)}),t),this}_prepareEase(t,r,n={}){this._moving=!0,r||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("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.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&r!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(r-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=r}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_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(t){const e=t.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitudethis._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;const r=t.clone();for(const t of e){const e=r.clone(),{center:n,zoom:i,pitch:a,bearing:o,elevation:s}=t(e);n&&(e.center=n),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==o&&(e.bearing=o),void 0!==s&&(e.elevation=s),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),i&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,r){var n;if(!t.essential&&a.prefersReducedMotion){const n=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,f="padding"in t?t.padding:i.padding,p=e.P.convert(t.offset);let d=i.centerPoint.add(p);const m=i.pointLocation(d),{center:g,zoom:y}=i.getConstrained(e.N.convert(t.center||m),null!==(n=t.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.zoomScale(y-o),x=i.project(m),_=i.project(g).sub(x);let b=t.curve;const w=Math.max(i.width,i.height),T=w/v,k=_.mag();if("minZoom"in t){const r=e.ac(Math.min(t.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);b=Math.sqrt(n/k*2)}const A=b*b;function M(t){const e=(T*T-w*w+(t?-1:1)*A*A*k*k)/(2*(t?T:w)*A*k);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}const C=M(!1);let I=function(t){return E(C)/E(C+b*t)},L=function(t){return w*((E(C)*(S(e=C+b*t)/E(e))-S(C))/A)/k;var e},P=(M(!0)-C)/b;if(Math.abs(k)<1e-6||!isFinite(P)){if(Math.abs(w-T)<1e-6)return this.easeTo(t,r);const e=T0,I=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(f),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{const a=n*P,m=1/I(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=e.y.number(s,u,n)),this._pitching&&(i.pitch=e.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,f,n),d=i.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);const v=1===n?g:i.unproject(x.add(_.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,d),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(t,e,r){!1===r.animate||0===r.duration?(t(1),e()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,r){t=e.b3(t,-180,180);const n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Mi={compact:!0,customAttribution:'MapLibre'};class Si{constructor(t=Mi){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=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.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(){o.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,e){const r=this._map._getUIString(`AttributionControl.${e}`);t.title=r,t.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.sourceCaches;for(const r in e){const n=e[r];if(n.used||n.usedForTerrain){const e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,r)=>{for(let n=r+1;n=0)return!1;return!0}));const r=t.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,t.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ei{constructor(t={}){this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.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=o.create("div","maplibregl-ctrl");const e=o.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ci{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,r=e?this._queue.concat(e):this._queue;for(const e of r)if(e.id===t)return void(e.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const r of e)if(!r.cancelled&&(r.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ii=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Li extends e.E{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,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];const n={};for(const i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),this._tiles[i.key]=new ct(i,this.tileSize));for(const t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(t){for(const e in this._tiles){const r=this._tiles[e];(!t||r.tileID.equals(t)||r.tileID.isChildOf(t)||t.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const r={};for(const n of this._renderableTilesKeys){const i=this._tiles[n].tileID;if(i.canonical.equals(t.canonical)){const i=t.clone();i.posMatrix=new Float64Array(16),e.aP(i.posMatrix,0,e.X,0,e.X,0,1),r[n]=i}else if(i.canonical.isChildOf(t.canonical)){const a=t.clone();a.posMatrix=new Float64Array(16);const o=i.canonical.z-t.canonical.z,s=i.canonical.x-(i.canonical.x>>o<>o<>o;e.aP(a.posMatrix,0,c,0,c,0,1),e.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=a}else if(t.canonical.isChildOf(i.canonical)){const a=t.clone();a.posMatrix=new Float64Array(16);const o=t.canonical.z-i.canonical.z,s=t.canonical.x-(t.canonical.x>>o<>o<>o;e.aP(a.posMatrix,0,e.X,0,e.X,0,1),e.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),e.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(t,e){const r=this.sourceCache._source;let n=t.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(t.scaledTo(n--).key);return i}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter((e=>e.timeAdded>=t))}}class Pi{constructor(t,e,r){this.painter=t,this.sourceCache=new Li(e),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,r,n,i=e.X){var a;if(!(r>=0&&r=0&&nt.canonical.z&&(t.canonical.z>=n?i=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=t.canonical.x-(t.canonical.x>>i<>i<>8<<4|t>>8,r[e+3]=0;const n=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new w(t,n,t.gl.RGBA,{premultiply:!1});return i.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;const f=this._coordsTextureSize,p=(1<t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse))}}const Di={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new zi(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((r=>!t._layers[r].isHidden(e))),this._coordsDescendingInv={};for(const e in t.sourceCaches){this._coordsDescendingInv[e]={};const r=t.sourceCaches[e].getVisibleCoordinates();for(const t of r){const r=this.terrain.sourceCache.getTerrainCoords(t);for(const t in r)this._coordsDescendingInv[e][t]||(this._coordsDescendingInv[e][t]=[]),this._coordsDescendingInv[e][t].push(r[t])}}this._coordsDescendingInvStr={};for(const e of t._order){const r=t._layers[e],n=r.source;if(Di[r.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(const t in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map((t=>t.key)).sort().join()}}for(const t of this._renderableTiles)for(const e in this._coordsDescendingInvStr){const r=this._coordsDescendingInvStr[e][t.tileID.key];r&&r!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const r=t.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Di[r]&&(this._prevType&&Di[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!i))return!0;if(Di[this._prevType]||Di[r]&&i){this._prevType=r;const t=this._stacks.length-1,i=this._stacks[t]||[];for(const r of this._renderableTiles){if(this.pool.isFull()&&(vn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[t]){const e=this.pool.getObjectForId(r.rtt[t].id);if(e.stamp===r.rtt[t].stamp){this.pool.useObject(e);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},Ni={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ui{constructor(t,r,n=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),o.mousePos(this.element,t)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,o.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&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;const i=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Kn({clickTolerance:i,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:r=.8})=>{const n=new $n;return new Wn({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*r}),moveStateManager:n,enable:t,assignEvents:Bi})})({clickTolerance:i,enable:!0}),this.map=t,n&&(this.mousePitch=Qn({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:r=-.5})=>{const n=new $n;return new Wn({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:t,assignEvents:Bi})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),o.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),o.disableDrag()}moveMouse(t,e){const r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){const{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(t,e){const r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){const{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&r.setPitch(r.getPitch()+n)}}off(){const t=this.element;o.removeEventListener(t,"mousedown",this.mousedown),o.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let Vi;function qi(t,r,n){const i=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),r){const i=new e.N(t.lng-360,t.lat),a=new e.N(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)180;){const e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==i.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:i}const Hi={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 Gi(t,e,r){const n=t.classList;for(const t in Hi)n.remove(`maplibregl-${r}-anchor-${t}`);n.add(`maplibregl-${r}-anchor-${e}`)}class Zi extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{const e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;const r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.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 n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${Hi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.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),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const t of c){const e=o.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.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"),u.appendChild(h);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");const p=o.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),f.appendChild(p);const d=o.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(f),s.appendChild(d),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),Gi(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),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("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),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,r=13.5,n=Math.abs(r)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-r+n)],"bottom-right":[-n,-1*(e-r+n)],left:[r,-1*(e-r)],right:[-r,-1*(e-r)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var r,n;if(!(null===(r=this._map)||void 0===r?void 0:r.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);const s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null===(n=this._popup)||void 0===n?void 0:n.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Yi=0,Xi=!1;const $i={maxWidth:100,unit:"metric"};function Ji(t,e,r){const n=r&&r.maxWidth||100,i=t._container.clientHeight/2,a=t.unproject([0,i]),o=t.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){const r=3.2808*s;r>5280?Ki(e,n,r/5280,t._getUIString("ScaleControl.Miles")):Ki(e,n,r,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Ki(e,n,s,t._getUIString("ScaleControl.Meters"))}function Ki(t,e,r,n){const i=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(r),e*r}(r);t.style.width=e*(i/r)+"px",t.innerHTML=`${i} ${n}`}const Qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ta=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(t){if(t){if("number"==typeof t){const r=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(r,r),"top-right":new e.P(-r,r),bottom:new e.P(0,-t),"bottom-left":new e.P(r,-r),"bottom-right":new e.P(-r,-r),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const r=e.P.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return ea(new e.P(0,0))}const ra=r;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Si,t.BoxZoomHandler=Vn,t.CanvasSource=rt,t.CooperativeGesturesHandler=_i,t.DoubleClickZoomHandler=di,t.DragPanHandler=yi,t.DragRotateHandler=vi,t.EdgeInsets=Tn,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.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(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.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()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("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&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const r=new e.N(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.e({bearing:i},this.options.fitBoundsOptions),o=W.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const r=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).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(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Xi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zi({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",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))}))}},this.options=e.e({},Wi,t)}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function*(t=!1){if(void 0!==Vi&&!t)return Vi;if(void 0===window.navigator.permissions)return Vi=!!window.navigator.geolocation,Vi;try{const t=yield window.navigator.permissions.query({name:"geolocation"});Vi="denied"!==t.state}catch(t){Vi=!!window.navigator.geolocation}return Vi}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Yi=0,Xi=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.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(){const t=this._map.getBounds(),e=t.getSouthEast(),r=t.getNorthEast(),n=e.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return e.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 e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Yi--,Xi=!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 e.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 e.k("trackuserlocationstart")),this.fire(new e.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("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Yi++,Yi>1?(t={maximumAge:6e5,timeout:0},Xi=!0):(t=this.options.positionOptions,Xi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}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)}},t.Hash=Sn,t.ImageSource=tt,t.KeyboardHandler=ui,t.LngLatBounds=W,t.LogoControl=Ei,t.Map=class extends Ai{constructor(t){e.bf.mark(e.bg.create);const r=Object.assign(Object.assign({},ji),t);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new An(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("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=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Ri),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new d(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.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})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1;const e=Mn((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{t?e(r):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new Sn("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,e.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Si("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Ei,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,r,n)}resize(t){var r;const n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const e=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,e),this.painter.resize(i,a,e)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);const s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){const{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=t*i,o=e*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(W.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,r){if("mouseenter"===t||"mouseover"===t){let n=!1;const i=i=>{const a=e.filter((t=>this.getLayer(t))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(t,this,i.originalEvent,{features:o}))):n=!1};return{layers:e,listener:r,delegates:{mousemove:i,mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const i=i=>{const a=e.filter((t=>this.getLayer(t)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(t,this,i.originalEvent)))},a=e=>{n&&(n=!1,r.call(this,new Rn(t,this,e.originalEvent)))};return{layers:e,listener:r,delegates:{mousemove:i,mouseout:a}}}{const n=t=>{const n=e.filter((t=>this.getLayer(t))),i=0!==n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];i.length&&(t.features=i,r.call(this,t),delete t.features)};return{layers:e,listener:r,delegates:{[t]:n}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,r){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const n=this._delegatedListeners[t];for(let t=0;te.includes(t)))){for(const t in i.delegates)this.off(t,i.delegates[t]);return void n.splice(t,1)}}}on(t,e,r){if(void 0===r)return super.on(t,e);const n=this._createDelegatedListener(t,"string"==typeof e?[e]:e,r);this._saveDelegatedListener(t,n);for(const t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,r){if(void 0===r)return super.once(t,e);const n="string"==typeof e?[e]:e,i=this._createDelegatedListener(t,n,r);for(const e in i.delegates){const a=i.delegates[e];i.delegates[e]=(...e)=>{this._removeDelegatedListener(t,n,r),a(...e)}}this._saveDelegatedListener(t,i);for(const t in i.delegates)this.once(t,i.delegates[t]);return this}off(t,e,r){return void 0===r?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,r),this)}queryRenderedFeatures(t,r){if(!this.style)return[];let n;const i=t instanceof e.P||Array.isArray(t),a=i?t:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{const t=e.P.convert(a[0]),r=e.P.convert(a[1]);n=[t,new e.P(r.x,t.y),r,new e.P(t.x,r.y),t]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,r){return!1!==(r=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));const r=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new pe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,r):this.style.loadJSON(t,e,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){const n=this._requestManager.transformRequest(t,"Style");e.h(n,new AbortController).then((t=>{this._updateDiff(t.data,r)})).catch((t=>{t&&this.fire(new e.j(t))}))}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t,r)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const r=this.style.sourceCaches[t.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&r.reload();for(const r in this.style._layers){const n=this.style._layers[r];"hillshade"===n.type&&n.source===t.source&&e.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 Pi(this.painter,r,t),this.painter.renderToTexture=new Oi(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=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.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(e.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 e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.sourceCaches;for(const e in t){const r=t[e]._tiles;for(const t in r){const e=r[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,r,n={}){const{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||e.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:n,height:a,data:f}=r,p=r;return this.style.addImage(t,{data:new e.R({width:n,height:a},new Uint8Array(f)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:n,height:f,data:p}=a.getImageData(r);this.style.addImage(t,{data:new e.R({width:n,height:f},p),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(t,r){const n=this.style.getImage(t);if(!n)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof HTMLImageElement||e.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new e.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!==n.data.width||s!==n.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(r instanceof HTMLImageElement||e.b(r));return n.data.replace(l,c),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)}setFilter(t,e,r={}){return this.style.setFilter(t,e,r),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,r,n={}){return this.style.setPaintProperty(t,e,r,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,r,n={}){return this.style.setLayoutProperty(t,e,r,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,r,(t=>{t||this._update(!0)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(!0)})),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=o.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=o.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");const r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);const i=this._controlContainer=o.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{a[t]=o.create("div",`maplibregl-ctrl-${t} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,r){this._canvas.width=Math.floor(r*t),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{e={requestedAttributes:t},r&&(e.statusMessage=r.statusMessage,e.type=r.type)}),{once:!0});const r=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!r){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new _n(r,this.transform),s.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=a.now();this.style.zoomHistory.update(t,i);const o=new e.z(t,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}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,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const t of this._controls)t.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),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return Fi}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Rn,t.MapTouchEvent=Fn,t.MapWheelEvent=jn,t.Marker=Zi,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{const 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,e)=>{const r=this._map._getUIString(`NavigationControl.${e}`);t.title=r,t.setAttribute("aria-label",r)},this.options=e.e({},Ni,t),this._container=o.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}))),o.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}))),o.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=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,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 Ui(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.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(t,e){const r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.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 e.k("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=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);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?qi(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;const r=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor;const i=ea(this.options.offset);if(!n){const t=this._container.offsetWidth,e=this._container.offsetHeight;let a;a=r.y+i.bottom.ythis._map.transform.height-e?["bottom"]:[],r.xthis._map.transform.width-t/2&&a.push("right"),n=0===a.length?"bottom":a.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${Hi[n]} translate(${a.x}px,${a.y}px)`),Gi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Qi),t)}addTo(t){return this._map&&this.remove(),this._map=t,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 e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),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(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),r=document.createElement("body");let n;for(r.innerHTML=t;n=r.firstChild,n;)e.appendChild(n);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.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;const t=this._container.querySelector(ta);t&&t.focus()}},t.RasterDEMTileSource=J,t.RasterTileSource=$,t.ScaleControl=class{constructor(t){this._onMove=()=>{Ji(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ji(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},$i),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=pi,t.Style=pe,t.TerrainControl=class{constructor(t){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=t}onAdd(t){return this._map=t,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.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(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=li,t.TwoFingersTouchRotateHandler=oi,t.TwoFingersTouchZoomHandler=ii,t.TwoFingersTouchZoomRotateHandler=xi,t.VectorTileSource=X,t.VideoSource=et,t.addSourceType=(t,r)=>e._(void 0,void 0,void 0,(function*(){if(it(t))throw new Error(`A source type called "${t}" already exists.`);var e;e=r,nt[t]=e})),t.clearPrewarmedResources=function(){const t=j;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(O),j=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()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return lt().getRTLTextPluginStatus()},t.getVersion=function(){return ra},t.getWorkerCount=function(){return R.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return V().broadcast("IS",t)},t.prewarm=function(){N().acquire(O)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return lt().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){R.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}})),t},"object"==typeof t&&void 0!==e?e.exports=a():(n="undefined"!=typeof globalThis?globalThis:n||self).maplibregl=a()}}),ib=f({"src/plots/map/layers.js"(t,e){var r=se(),n=Me().sanitizeHTML,i=J_(),a=G_();function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var n=0;n0}function c(t){var e={},n={};switch(t.type){case"circle":r.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":r.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:n}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,i=t.source,a={type:r};return"geojson"===r?e="data":"vector"===r?e="string"==typeof i?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates),a[e]=i,t.sourceattribution&&(a.attribution=n(t.sourceattribution)),a}(t);e.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&l.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,i=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var l=e.dragOptions;e.dragOptions=n.extendDeep(l||{},{dragmode:t.dragmode,element:e.div,gd:i,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},s.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;ex/2){var _=m.split("|").join("
");y.text(_).attr("data-unformatted",_).call(l.convertToTspans,t),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>x&&(b=x/(v.width+6));var w=[c.l+c.w*p.x[1],c.t+c.h*(1-p.y[0])];g.attr("transform",r(w[0],w[1])+n(b))}},t.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots[u],n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,i=new a(t,n.uid),o=i.sourceId,s=r(e),l=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}}}),db=f({"src/traces/choroplethmap/index.js"(t,e){e.exports={attributes:ub(),supplyDefaults:hb(),colorbar:No(),calc:kg(),plot:pb(),hoverPoints:Sg(),eventData:Eg(),selectPoints:Cg(),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+p[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var _=a.extractOpts(e),b=_.reversescale?a.flipScale(_.colorscale):_.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u=0;r--)t.removeLayer(e[r][1])},a.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var n=e[0].trace,a=new i(t,n.uid),o=a.sourceId,s=r(e),l=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),bb=f({"src/traces/densitymap/hover.js"(t,e){var r=nr(),n=tb().hoverPoints,i=tb().getExtraText;e.exports=function(t,e,a){var o=n(t,e,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),wb=f({"src/traces/densitymap/event_data.js"(t,e){e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}}}),Tb=f({"src/traces/densitymap/index.js"(t,e){e.exports={attributes:gb(),supplyDefaults:yb(),colorbar:No(),formatLabels:$_(),calc:vb(),plot:_b(),hoverPoints:bb(),eventData:wb(),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(g);var _=new Array(v);for(d=0;dx&&(x=l.source[e]),l.target[e]>x&&(x=l.target[e]);var _,b=x+1;t.node._count=b;var w=t.node.groups,T={};for(e=0;e0&&o(C,b)&&o(I,b)&&(!T.hasOwnProperty(C)||!T.hasOwnProperty(I)||T[C]!==T[I])){T.hasOwnProperty(I)&&(I=T[I]),T.hasOwnProperty(C)&&(C=T[C]),I=+I,p[C=+C]=p[I]=!0;var L="";l.label&&l.label[e]&&(L=l.label[e]);var P=null;L&&d.hasOwnProperty(L)&&(P=d[L]),c.push({pointNumber:e,label:L,color:u?l.color[e]:l.color,hovercolor:h?l.hovercolor[e]:l.hovercolor,customdata:f?l.customdata[e]:l.customdata,concentrationscale:P,source:C,target:I,value:+E}),S.source.push(C),S.target.push(I)}}var z=b+w.length,D=a(i.color),O=a(i.customdata),R=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:F,color:D?i.color[e]:i.color,customdata:O?i.customdata[e]:i.customdata})}var j=!1;return function(t,e,i){for(var a=n.init2dArray(t,0),o=0;o1}))}(z,S.source,S.target)&&(j=!0),{circular:j,links:c,nodes:R,groups:w,groupLookup:T}}e.exports=function(t,e){var r=l(e);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}}}),Cb=f({"node_modules/d3-quadtree/dist/d3-quadtree.js"(t,e){var r,n;r=t,n=function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,h,f,p=t._root,d={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=u<<1|c]))return i[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,t}function r(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function n(t){return t[0]}function i(t){return t[1]}function a(t,e,r){var a=new o(null==e?n:e,null==r?i:r,NaN,NaN,NaN,NaN);return null==t?a:a.addAll(t)}function o(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=a.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),n=0;nt||t>=i||n>e||e>=a;)switch(s=(ep||(o=c.y0)>d||(s=c.x1)=v)<<1|t>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=x*x+_*_;if(b=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=l.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var s,c,h,f=-1,p=r.length,d=l[i++],m=n(),g=a();++fl.length)return t;var n,i=c[r-1];return null!=e&&r>=l.length?n=t.entries():(n=[],t.each((function(t,e){n.push({key:e,values:h(t,r)})}))),null!=i?n.sort((function(t,e){return i(t.key,e.key)})):n}return r={object:function(t){return u(t,0,i,a)},map:function(t){return u(t,0,o,s)},entries:function(t){return h(u(t,0,o,s),0)},key:function(t){return l.push(t),r},sortKeys:function(t){return c[l.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}},t.set=u,t.map=n,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:r.d3=r.d3||{})}}),Lb=f({"node_modules/d3-dispatch/dist/d3-dispatch.js"(t,e){var r,n;r=t,n=function(t){var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var r,n,i=new Array(r),a=0;a=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var t,n,i=e,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(n=i._next,i._next=null,i=t?t._next=n:e=n);r=t,v(a)}(),s=0}}function y(){var t=c.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(i&&(i=clearTimeout(i)),t-s>24?(t<1/0&&(i=setTimeout(g,t-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}p.prototype=d.prototype={constructor:p,restart:function(t,n,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.interval=function(t,e,r){var n=new p,i=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=e,r),t(o)}),e,r),n)},t.now=h,t.timeout=function(t,e,r){var n=new p;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.timer=d,t.timerFlush=m,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}}),zb=f({"node_modules/d3-force/dist/d3-force.js"(t,e){var r,n;r=t,n=function(t,e,r,n,i){function a(t){return function(){return t}}function o(){return 1e-6*(Math.random()-.5)}function s(t){return t.x+t.vx}function l(t){return t.y+t.vy}function c(t){return t.index}function u(t,e){var r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function h(t){return t.x}function f(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,e){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;nf+c||np+c||au.index){var h=f-s.x-s.vx,g=p-s.y-s.vy,y=h*h+g*g;yt.r&&(t.r=t[e].r)}function f(){if(r){var e,i,a=r.length;for(n=new Array(a),e=0;e=c)){(t.data!==r||t.next)&&(0===h&&(d+=(h=o())*h),0===f&&(d+=(f=o())*f),d1?(null==r?u.remove(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(f.on(t,r),e):f.on(t)}}},t.forceX=function(t){var e,r,n,i=a(.1);function o(t){for(var i,a=0,o=e.length;an)if(Math.abs(f*c-u*h)>n&&o){var d=i-s,m=a-l,g=c*c+u*u,y=d*d+m*m,v=Math.sqrt(g),x=Math.sqrt(p),_=o*Math.tan((e-Math.acos((g+p-y)/(2*v*x)))/2),b=_/x,w=_/v;Math.abs(b-1)>n&&(this._+="L"+(t+b*h)+","+(r+b*f)),this._+="A"+o+","+o+",0,0,"+ +(f*d>h*m)+","+(this._x1=t+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,o,s,l,c){t=+t,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),f=t+u,p=a+h,d=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+f+","+p:(Math.abs(this._x1-f)>n||Math.abs(this._y1-p)>n)&&(this._+="L"+f+","+p),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+d+","+(t-u)+","+(a-h)+"A"+o+","+o+",0,1,"+d+","+(this._x1=f)+","+(this._y1=p):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=e)+","+d+","+(this._x1=t+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&void 0!==e?t:(r=r||self).d3=r.d3||{})}}),Ob=f({"node_modules/d3-shape/dist/d3-shape.js"(t,e){var r,n;r=t,n=function(t,e){function r(t){return function(){return t}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,f=h/2,p=2*h;function d(t){return t>=1?f:t<=-1?-f:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function _(t,e,r,n,i,a,s){var l=t-r,u=e-n,h=(s?a:-a)/c(l*l+u*u),f=h*u,p=-h*l,d=t+f,m=e+p,g=r+f,y=n+p,v=(d+g)/2,x=(m+y)/2,_=g-d,b=y-m,w=_*_+b*b,T=i-a,k=d*y-g*m,A=(b<0?-1:1)*c(o(0,T*T*w-k*k)),M=(k*b-_*A)/w,S=(-k*_-b*A)/w,E=(k*b+_*A)/w,C=(-k*_+b*A)/w,I=M-v,L=S-x,P=E-v,z=C-x;return I*I+L*L>P*P+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-f,y01:-p,x11:M*(i/T-1),y11:S*(i/T-1)}}function b(t){this._context=t}function w(t){return new b(t)}function T(t){return t[0]}function k(t){return t[1]}function A(){var t=T,n=k,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,f=!1;for(null==a&&(s=o(u=e.path())),l=0;l<=h;++l)!(l=h;--f)c.point(y[f],v[f]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+t(p,u,r),v[u]=+i(p,u,r),c.point(n?+n(p,u,r):y[u],a?+a(p,u,r):v[u]))}if(d)return c=null,d+""||null}function h(){return A().defined(o).curve(l).context(s)}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),u):t},u.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),u):n},u.y=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),a=null,u):i},u.y0=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),u):i},u.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:r(+t),u):a},u.lineX0=u.lineY0=function(){return h().x(t).y(i)},u.lineY1=function(){return h().x(t).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),u):o},u.curve=function(t){return arguments.length?(l=t,null!=s&&(c=l(s)),u):l},u.context=function(t){return arguments.length?(null==t?s=c=null:c=l(s=t),u):s},u}function S(t,e){return et?1:e>=t?0:NaN}function E(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var C=L(w);function I(t){this._curve=t}function L(t){function e(e){return new I(t(e))}return e._curve=t,e}function P(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function z(){return P(A().curve(C))}function D(){var t=M().curve(C),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(i())},delete t.lineY0,t.lineOuterRadius=function(){return P(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(L(t)):e()._curve},t}function O(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var R=Array.prototype.slice;function F(t){return t.source}function j(t){return t.target}function B(t){var n=F,i=j,a=T,o=k,s=null;function l(){var r,l=R.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=e.path()),t(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(i=t,l):i},l.x=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),l):a},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function N(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function U(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+i)/2,n,r,n,i)}function V(t,e,r,n,i){var a=O(e,r),o=O(e,r=(r+i)/2),s=O(n,r),l=O(n,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,p)}},H={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},G=Math.sqrt(1/3),Z=2*G,W={draw:function(t,e){var r=Math.sqrt(e/Z),n=r*G;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(p/10)*Y,$=-Math.cos(p/10)*Y,J={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=X*r,i=$*r;t.moveTo(0,-r),t.lineTo(n,i);for(var a=1;a<5;++a){var o=p*a/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},K={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),it=3*(nt/2+1),at={draw:function(t,e){var r=Math.sqrt(e/it),n=r/2,i=r*nt,a=n,o=r*nt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(et*n-rt*i,rt*n+et*i),t.lineTo(et*a-rt*o,rt*a+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*i,et*i-rt*n),t.lineTo(et*a+rt*o,et*o-rt*a),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[q,H,W,K,J,tt,at];function st(){}function lt(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ct(t){this._context=t}function ut(t){this._context=t}function ht(t){this._context=t}function ft(t,e){this._basis=new ct(t),this._beta=e}ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ut.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ft.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var pt=function t(e){function r(t){return 1===e?new ct(t):new ft(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function dt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:dt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function xt(t,e){this._context=t,this._k=(1-e)/6}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:dt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _t=function t(e){function r(t){return new xt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>u){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>u){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new kt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var St=function t(e){function r(t){return e?new Mt(t,e):new xt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Et(t){this._context=t}function Ct(t){return t<0?-1:1}function It(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ct(a)+Ct(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Lt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function zt(t){this._context=t}function Dt(t){this._context=new Ot(t)}function Ot(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function Ut(t,e){return t[e]}function Vt(t){var e=t.map(qt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function qt(t){for(var e,r=-1,n=0,i=t.length,a=-1/0;++ra&&(a=e,n=r);return n}function Ht(t){var e=t.map(Gt);return Nt(t).sort((function(t,r){return e[t]-e[r]}))}function Gt(t){for(var e,r=0,n=-1,i=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,b=r(0),w=null,T=y,k=v,A=x,M=null;function S(){var r,m,g,y=+t.apply(this,arguments),v=+o.apply(this,arguments),x=T.apply(this,arguments)-f,S=k.apply(this,arguments)-f,E=n(S-x),C=S>x;if(M||(M=r=e.path()),vu)if(E>p-u)M.moveTo(v*a(x),v*l(x)),M.arc(0,0,v,x,S,!C),y>u&&(M.moveTo(y*a(S),y*l(S)),M.arc(0,0,y,S,x,C));else{var I,L,P=x,z=S,D=x,O=S,R=E,F=E,j=A.apply(this,arguments)/2,B=j>u&&(w?+w.apply(this,arguments):c(y*y+v*v)),N=s(n(v-y)/2,+b.apply(this,arguments)),U=N,V=N;if(B>u){var q=d(B/y*l(j)),H=d(B/v*l(j));(R-=2*q)>u?(D+=q*=C?1:-1,O-=q):(R=0,D=O=(x+S)/2),(F-=2*H)>u?(P+=H*=C?1:-1,z-=H):(F=0,P=z=(x+S)/2)}var G=v*a(P),Z=v*l(P),W=y*a(O),Y=y*l(O);if(N>u){var X,$=v*a(z),J=v*l(z),K=y*a(D),Q=y*l(D);if(E1?0:g<-1?h:Math.acos(g))/2),at=c(X[0]*X[0]+X[1]*X[1]);U=s(N,(y-at)/(it-1)),V=s(N,(v-at)/(it+1))}}F>u?V>u?(I=_(K,Q,G,Z,v,V,C),L=_($,J,W,Y,v,V,C),M.moveTo(I.cx+I.x01,I.cy+I.y01),Vu&&R>u?U>u?(I=_(W,Y,$,J,y,-U,C),L=_(G,Z,K,Q,y,-U,C),M.lineTo(I.cx+I.x01,I.cy+I.y01),U0&&(d+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,c=d?(v-f*_)/d:0;s0?h*c:0)+_,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.pointRadial=O,t.radialArea=D,t.radialLine=z,t.stack=function(){var t=r([]),e=Nt,n=Bt,i=Ut;function a(r){var a,o,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},t.stackOffsetExpand=function(t,e){if((n=t.length)>0){for(var r,n,i,a=0,o=t[0].length;a0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;o0;--o)d(a*=.99),m(),l(a),m();function s(){var r=e.max(i,(function(t){return t.length})),a=M*(v-n)/(r-1);_>a&&(_=a);var o=e.min(i,(function(t){return(v-n-(t.length-1)*_)/e.sum(t,u)}));i.forEach((function(t){t.forEach((function(t,e){t.y1=(t.y0=e)+t.value*o}))})),t.links.forEach((function(t){t.width=t.value*o}))}function l(t){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(e.sum(r.targetLinks,f)/e.sum(r.targetLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function d(t){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(e.sum(r.sourceLinks,p)/e.sum(r.sourceLinks,u)-h(r))*t;r.y0+=n,r.y1+=n}}))}))}function m(){i.forEach((function(t){var e,r,i,a=n,o=t.length;for(t.sort(c),i=0;i0&&(e.y0+=r,e.y1+=r),a=e.y1+_;if((r=a-_-v)>0)for(a=e.y0-=r,e.y1-=r,i=o-2;i>=0;--i)(r=(e=t[i]).y1+_-a)>0&&(e.y0-=r,e.y1-=r),a=e.y0}))}}(a),E(a),a}function E(t){t.nodes.forEach((function(t){t.sourceLinks.sort(l),t.targetLinks.sort(s)})),t.nodes.forEach((function(t){var e=t.y0,r=e;t.sourceLinks.forEach((function(t){t.y0=e+t.width/2,e+=t.width})),t.targetLinks.forEach((function(t){t.y1=r+t.width/2,r+=t.width}))}))}return S.update=function(t){return E(t),t},S.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),S):b},S.nodeAlign=function(t){return arguments.length?(w="function"==typeof t?t:o(t),S):w},S.nodeWidth=function(t){return arguments.length?(x=+t,S):x},S.nodePadding=function(t){return arguments.length?(_=+t,S):_},S.nodes=function(t){return arguments.length?(T="function"==typeof t?t:o(t),S):T},S.links=function(t){return arguments.length?(k="function"==typeof t?t:o(t),S):k},S.size=function(e){return arguments.length?(t=n=0,i=+e[0],v=+e[1],S):[i-t,v-n]},S.extent=function(e){return arguments.length?(t=+e[0][0],i=+e[1][0],n=+e[0][1],v=+e[1][1],S):[[t,n],[i,v]]},S.iterations=function(t){return arguments.length?(A=+t,S):A},S},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?e.min(t.sourceLinks,i)-1:0},t.sankeyLeft=function(t){return t.depth},t.sankeyRight=function(t,e){return e-1-t.height},t.sankeyJustify=a,t.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?n(t,fg(),Ib(),Ob()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),Fb=f({"node_modules/elementary-circuits-directed-graph/johnson.js"(t,e){var r=Sb();e.exports=function(t,e){var n,i=[],a=[],o=[],s={},l=[];function c(t){o[t]=!1,s.hasOwnProperty(t)&&Object.keys(s[t]).forEach((function(e){delete s[t][e],o[e]&&c(e)}))}function u(t){var r,h,f,p,d=!1;for(a.push(t),o[t]=!0,r=0;r=e}))}(e);for(var n,i=r(t).components.filter((function(t){return t.length>1})),a=1/0,o=0;o1||i>1)}function S(t,e,r){return t.sort(C),t.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&M(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=t[l].circularPathData.verticalBuffer+t[l].width/2+e;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),t}function E(t,r,i,a){var o=e.min(t.links,(function(t){return t.source.y0}));t.links.forEach((function(t){t.circular&&(t.circularPathData={})})),S(t.links.filter((function(t){return"top"==t.circularLinkType})),r,a),S(t.links.filter((function(t){return"bottom"==t.circularLinkType})),r,a),t.links.forEach((function(e){if(e.circular){if(e.circularPathData.arcRadius=e.width+w,e.circularPathData.leftNodeBuffer=5,e.circularPathData.rightNodeBuffer=5,e.circularPathData.sourceWidth=e.source.x1-e.source.x0,e.circularPathData.sourceX=e.source.x0+e.circularPathData.sourceWidth,e.circularPathData.targetX=e.target.x0,e.circularPathData.sourceY=e.y0,e.circularPathData.targetY=e.y1,H(e,a)&&M(e))e.circularPathData.leftSmallArcRadius=w+e.width/2,e.circularPathData.leftLargeArcRadius=w+e.width/2,e.circularPathData.rightSmallArcRadius=w+e.width/2,e.circularPathData.rightLargeArcRadius=w+e.width/2,"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=e.source.y1+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=e.source.y0-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius);else{var s=e.source.column,l=e.circularLinkType,c=t.links.filter((function(t){return t.source.column==s&&t.circularLinkType==l}));"bottom"==e.circularLinkType?c.sort(L):c.sort(I);var u=0;c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.leftSmallArcRadius=w+e.width/2+u,e.circularPathData.leftLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),s=e.target.column,c=t.links.filter((function(t){return t.target.column==s&&t.circularLinkType==l})),"bottom"==e.circularLinkType?c.sort(z):c.sort(P),u=0,c.forEach((function(t,n){t.circularLinkID==e.circularLinkID&&(e.circularPathData.rightSmallArcRadius=w+e.width/2+u,e.circularPathData.rightLargeArcRadius=w+e.width/2+n*r+u),u+=t.width})),"bottom"==e.circularLinkType?(e.circularPathData.verticalFullExtent=Math.max(i,e.source.y1,e.target.y1)+b+e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent-e.circularPathData.rightLargeArcRadius):(e.circularPathData.verticalFullExtent=o-b-e.circularPathData.verticalBuffer,e.circularPathData.verticalLeftInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.leftLargeArcRadius,e.circularPathData.verticalRightInnerExtent=e.circularPathData.verticalFullExtent+e.circularPathData.rightLargeArcRadius)}e.circularPathData.leftInnerExtent=e.circularPathData.sourceX+e.circularPathData.leftNodeBuffer,e.circularPathData.rightInnerExtent=e.circularPathData.targetX-e.circularPathData.rightNodeBuffer,e.circularPathData.leftFullExtent=e.circularPathData.sourceX+e.circularPathData.leftLargeArcRadius+e.circularPathData.leftNodeBuffer,e.circularPathData.rightFullExtent=e.circularPathData.targetX-e.circularPathData.rightLargeArcRadius-e.circularPathData.rightNodeBuffer}if(e.circular)e.path=function(t){return"top"==t.circularLinkType?"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 0 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY-t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 0 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 0 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY-t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 0 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY:"M"+t.circularPathData.sourceX+" "+t.circularPathData.sourceY+" L"+t.circularPathData.leftInnerExtent+" "+t.circularPathData.sourceY+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftSmallArcRadius+" 0 0 1 "+t.circularPathData.leftFullExtent+" "+(t.circularPathData.sourceY+t.circularPathData.leftSmallArcRadius)+" L"+t.circularPathData.leftFullExtent+" "+t.circularPathData.verticalLeftInnerExtent+" A"+t.circularPathData.leftLargeArcRadius+" "+t.circularPathData.leftLargeArcRadius+" 0 0 1 "+t.circularPathData.leftInnerExtent+" "+t.circularPathData.verticalFullExtent+" L"+t.circularPathData.rightInnerExtent+" "+t.circularPathData.verticalFullExtent+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightLargeArcRadius+" 0 0 1 "+t.circularPathData.rightFullExtent+" "+t.circularPathData.verticalRightInnerExtent+" L"+t.circularPathData.rightFullExtent+" "+(t.circularPathData.targetY+t.circularPathData.rightSmallArcRadius)+" A"+t.circularPathData.rightLargeArcRadius+" "+t.circularPathData.rightSmallArcRadius+" 0 0 1 "+t.circularPathData.rightInnerExtent+" "+t.circularPathData.targetY+" L"+t.circularPathData.targetX+" "+t.circularPathData.targetY}(e);else{var h=n.linkHorizontal().source((function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]})).target((function(t){return[t.target.x0,t.y1]}));e.path=h(e)}}))}function C(t,e){return D(t)==D(e)?"bottom"==t.circularLinkType?L(t,e):I(t,e):D(e)-D(t)}function I(t,e){return t.y0-e.y0}function L(t,e){return e.y0-t.y0}function P(t,e){return t.y1-e.y1}function z(t,e){return e.y1-t.y1}function D(t){return t.target.column-t.source.column}function O(t){return t.target.x0-t.source.x1}function R(t,e){var r=k(t),n=O(e)/Math.tan(r);return"up"==q(t)?t.y1+n:t.y1-n}function F(t,e){var r=k(t),n=O(e)/Math.tan(r);return"up"==q(t)?t.y1-n:t.y1+n}function j(t,e,r,n){t.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)t.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),f=3*u*Math.pow(1-u,2),p=3*Math.pow(u,2)*(1-u),d=Math.pow(u,3),m=h*i.y0+f*i.y0+p*i.y1+d*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&ga.y0&&i.y0a.y0&&i.y1a.y1)&&B(t,c,e,r)}))):(y>o.y0&&yo.y1)&&(c=y-o.y0+10,o=B(o,c,e,r),t.nodes.forEach((function(t){_(t,n)!=_(o,n)&&t.column==o.column&&t.y0o.y1&&B(t,c,e,r)})))}}))}}))}function B(t,e,r,n){return t.y0+e>=r&&t.y1+e<=n&&(t.y0=t.y0+e,t.y1=t.y1+e,t.targetLinks.forEach((function(t){t.y1=t.y1+e})),t.sourceLinks.forEach((function(t){t.y0=t.y0+e}))),t}function N(t,e,r,n){t.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>e&&(i.y=i.y-(i.y+(i.y1-i.y0)-e));var a=t.links.filter((function(t){return _(t.source,r)==_(i,r)})),o=a.length;o>1&&a.sort((function(t,e){if(!t.circular&&!e.circular){if(t.target.column==e.target.column)return t.y1-e.y1;if(!V(t,e))return t.y1-e.y1;if(t.target.column>e.target.column){var r=F(e,t);return t.y1-r}if(e.target.column>t.target.column)return F(t,e)-e.y1}return t.circular&&!e.circular?"top"==t.circularLinkType?-1:1:e.circular&&!t.circular?"top"==e.circularLinkType?1:-1:t.circular&&e.circular?t.circularLinkType===e.circularLinkType&&"top"==t.circularLinkType?t.target.column===e.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:t.circularLinkType===e.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===e.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:"top"==t.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(t){t.y0=s+t.width/2,s+=t.width})),a.forEach((function(t,e){if("bottom"==t.circularLinkType){for(var r=e+1,n=0;r1&&n.sort((function(t,e){if(!t.circular&&!e.circular){if(t.source.column==e.source.column)return t.y0-e.y0;if(!V(t,e))return t.y0-e.y0;if(e.source.column0?"up":"down"}function H(t,e){return _(t.source,e)==_(t.target,e)}t.sankeyCircular=function(){var t,n,a=0,_=0,k=1,M=1,S=24,C=g,I=o,L=y,P=v,z=32,D=2,O=null;function R(){var o={nodes:L.apply(null,arguments),links:P.apply(null,arguments)};!function(t){t.nodes.forEach((function(t,e){t.index=e,t.sourceLinks=[],t.targetLinks=[]}));var e=r.map(t.nodes,C);t.links.forEach((function(t,r){t.index=r;var n=t.source,i=t.target;"object"!==(void 0===n?"undefined":l(n))&&(n=t.source=x(e,n)),"object"!==(void 0===i?"undefined":l(i))&&(i=t.target=x(e,i)),n.sourceLinks.push(t),i.targetLinks.push(t)}))}(o),function(t,e,r){var n=0;if(null===r){for(var a=[],o=0;o0;--u)y(c*=.99,s),v();function g(r){if(n){var o=1/0;l.forEach((function(t){var e=M*n/(t.length+1);o=e0?r+b+w:r,bottom:n=n>0?n+b+w:n,left:a=a>0?a+b+w:a,right:i=i>0?i+b+w:i}}(i),u=function(t,r){var n=e.max(t.nodes,(function(t){return t.column})),i=k-a,o=M-_,s=i+r.right+r.left,l=o+r.top+r.bottom,c=i/s,u=o/l;return a=a*c+r.left,k=0==r.right?k:k*c,_=_*u+r.top,M*=u,t.nodes.forEach((function(t){t.x0=a+t.column*((k-a-S)/n),t.x1=t.x0+S})),u}(i,c);s*=u,i.links.forEach((function(t){t.width=t.value*s})),l.forEach((function(t){var e=t.length;t.forEach((function(t,n){t.depth==l.length-1&&1==e||0==t.depth&&1==e?(t.y0=M/2-t.value*s,t.y1=t.y0+t.value*s):t.partOfCycle?0==A(t,r)?(t.y0=M/2+n,t.y1=t.y0+t.value*s):"top"==t.circularLinkType?(t.y0=_+n,t.y1=t.y0+t.value*s):(t.y0=M-t.value*s-n,t.y1=t.y0+t.value*s):0==c.top||0==c.bottom?(t.y0=(M-_)/e*n,t.y1=t.y0+t.value*s):(t.y0=(M-_)/2-e/2+n,t.y1=t.y0+t.value*s)}))}))}function y(t,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&A(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=M/2-s/2,i.y1=M/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=M/2-s/2,i.y1=M/2+s/2;else{var l=e.mean(i.sourceLinks,m),c=e.mean(i.targetLinks,d),u=((l&&c?(l+c)/2:l||c)-p(i))*t;i.y0+=u,i.y1+=u}}))}))}function v(){l.forEach((function(e){var r,n,i,a=_,o=e.length;for(e.sort(h),i=0;i0&&(r.y0+=n,r.y1+=n),a=r.y1+t;if((n=a-t-M)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=e[i]).y1+t-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,C),F(o);for(var s=0;s<4;s++)N(o,M,C),U(o,0,C),j(o,_,M,C),N(o,M,C),U(o,0,C);return function(t,r,n){var i=t.nodes,a=t.links,o=!1,s=!1;if(a.forEach((function(t){"top"==t.circularLinkType?o=!0:"bottom"==t.circularLinkType&&(s=!0)})),0==o||0==s){var l=e.min(i,(function(t){return t.y0})),c=(n-r)/(e.max(i,(function(t){return t.y1}))-l);i.forEach((function(t){var e=(t.y1-t.y0)*c;t.y0=(t.y0-l)*c,t.y1=t.y0+e})),a.forEach((function(t){t.y0=(t.y0-l)*c,t.y1=(t.y1-l)*c,t.width=t.width*c}))}}(o,_,M),E(o,D,M,C),o}function F(t){t.nodes.forEach((function(t){t.sourceLinks.sort(u),t.targetLinks.sort(c)})),t.nodes.forEach((function(t){var e=t.y0,r=e,n=t.y1,i=n;t.sourceLinks.forEach((function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=e+t.width/2,e+=t.width)})),t.targetLinks.forEach((function(t){t.circular?(t.y1=i-t.width/2,i-=t.width):(t.y1=r+t.width/2,r+=t.width)}))}))}return R.nodeId=function(t){return arguments.length?(C="function"==typeof t?t:s(t),R):C},R.nodeAlign=function(t){return arguments.length?(I="function"==typeof t?t:s(t),R):I},R.nodeWidth=function(t){return arguments.length?(S=+t,R):S},R.nodePadding=function(e){return arguments.length?(t=+e,R):t},R.nodes=function(t){return arguments.length?(L="function"==typeof t?t:s(t),R):L},R.links=function(t){return arguments.length?(P="function"==typeof t?t:s(t),R):P},R.size=function(t){return arguments.length?(a=_=0,k=+t[0],M=+t[1],R):[k-a,M-_]},R.extent=function(t){return arguments.length?(a=+t[0][0],k=+t[1][0],_=+t[0][1],M=+t[1][1],R):[[a,_],[k,M]]},R.iterations=function(t){return arguments.length?(z=+t,R):z},R.circularLinkGap=function(t){return arguments.length?(D=+t,R):D},R.nodePaddingRatio=function(t){return arguments.length?(n=+t,R):n},R.sortNodes=function(t){return arguments.length?(O=t,R):O},R.update=function(t){return T(t,C),F(t),t.links.forEach((function(t){t.circular&&(t.circularLinkType=t.y0+t.y1o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=A.nodes);P.forEach((function(t){var e,r,n,i=0,a=t.length;for(t.sort((function(t,e){return t.y0-e.y0})),n=0;n=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}n.update(A)}return{circular:b,key:r,trace:c,guid:h.randstr(),horizontal:f,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?y:g,dragPerpendicular:f?g:y,arrangement:c.arrangement,sankey:n,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,e,r){var n=l(e.color),i=l(e.hovercolor),a=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:a,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:S,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function S(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r="",n=t.width/2,i=t.circularPathData,a=i.sourceX+i.verticalBuffer0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-e)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-e)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-e)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-e)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-e-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-e-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-e+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-e-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-e)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-e)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-e)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-e)+" "+(i.targetY+n)+" L "+(i.targetX-e)+" "+(i.targetY+n)+(e>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var i=t.link.source.x1,a=t.link.target.x0-e,o=n(i,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,h=t.link.y1-t.link.width/2,f=t.link.y1+t.link.width/2,p="M"+i+","+c,d="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+f+" "+s+","+u+" "+i+","+u,g=e>0?"L"+(a+e)+","+(h+t.link.width/2):"";return p+d+(g+="L"+a+","+f)+m+"Z"}}function E(t,e){var r=l(e.color),n=s.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),u="node_"+e.pointNumber;return e.group&&(u=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:u,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,u].join("_"),interactionState:t.interactionState,figure:t}}function C(t){t.attr("transform",(function(t){return f(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function I(t){t.call(C)}function L(t,e){t.call(I),e.attr("d",S())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function z(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return f(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function R(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function F(t,e,n,a){var o=i.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(t){a._fullLayout._dragCover=t})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,B(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(t,e,n){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,i,n)).stop()}(0,o,i),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,j(r,i)}}))}(t,e,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),B(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(N(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;e"),color:b(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:b(l,"bordercolor"),fontFamily:b(l,"font.family"),fontSize:b(l,"font.size"),fontColor:b(l,"font.color"),fontWeight:b(l,"font.weight"),fontStyle:b(l,"font.style"),fontVariant:b(l,"font.variant"),fontTextcase:b(l,"font.textcase"),fontLineposition:b(l,"font.lineposition"),fontShadow:b(l,"font.shadow"),nameLength:b(l,"namelength"),textAlign:b(l,"align"),idealAlign:r.event.x"),color:b(s,"bgcolor")||a.tinyColorHue,borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),fontWeight:b(s,"font.weight"),fontStyle:b(s,"font.style"),fontVariant:b(s,"font.variant"),fontTextcase:b(s,"font.textcase"),fontLineposition:b(s,"font.lineposition"),fontShadow:b(s,"font.shadow"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});f(w,.85),p(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(r.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(e,n,i){var a=n.node;a.originalEvent=r.event,t._hoverdata=[a],r.select(e).call(y,n,i),o.click(t,{target:!0})}}})}}}),Vb=f({"src/traces/sankey/base_plot.js"(t){var e=Lt().overrideAll,r=be().getModuleCalcData,n=Ub(),i=j(),a=fr(),o=hr(),s=Sn().prepSelect,l=se(),c=Vt(),u="sankey";function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var f={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:h.node(),plotinfo:{id:e,xaxis:f,yaxis:p,fillRangeItems:l.noop},subplot:e,xaxes:[f],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;r0}function k(t){t.each((function(t){x.stroke(r.select(this),t.line.color)})).each((function(t){x.fill(r.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function A(t,e,r){var n=t._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),o={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(t,e){return a.coerce(i,o,y,t,e)}return d(i,o,l,s,n),g(i,o,l,s),o}function M(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function S(t,e,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",t).call(f.convertToTspans,i).call(u.font,e),u.bBox(o.node())}function E(t,e,r,n,i,o){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=a.aggNums(o,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,d,m){var g,y=t._fullLayout;T(d)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,e,"trace").each((function(e){var m,v,C,I,L,P=e[0].trace,z=r.select(this),D=P._hasGauge,O=P._isAngular,R=P._isBullet,F=P.domain,j={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},B=j.l+j.w/2,N=j.t+j.h/2,U=Math.min(j.w/2,j.h),V=h.innerRadius*U,q=P.align||"center";if(v=N,D){if(O&&(m=B,v=N+U/2,C=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),n=e/r;return[n,t,e]}(t,.9*V)}),R){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=j.l+(G+(1-G)*b[q])*j.w,C=function(t){return M(t,(h.bulletNumberDomainSize-H)*j.w,j.h)}}}else m=j.l+b[q]*j.w,C=function(t){return M(t,j.w,j.h)};!function(t,e,n,l){var c,h,d,m=n[0].trace,g=l.numbersX,y=l.numbersY,v=m.align||"center",k=_[v],M=l.transitionOpts,C=l.onComplete,I=a.ensureSingle(e,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var P=I.selectAll("text").data(L);function z(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=A(t,{tickformat:a});return function(t){return Math.abs(t)<1?p.tickText(o,t).text:r(t)}}function D(){var e=A(t,{tickformat:m.number.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=I.select("text.number");function h(){var e="number"==typeof n[0].y?s+a(n[0].y)+o:"-";l.text(e).call(u.font,m.number.font).call(f.convertToTspans,t)}return T(M)?l.transition().duration(M.duration).ease(M.easing).each("end",(function(){h(),C&&C()})).each("interrupt",(function(){h(),C&&C()})).attrTween("text",(function(){var t=r.select(this),e=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){t.text(s+l(e(r))+o)}})):h(),c=S(s+a(n[0].y)+o,m.number.font,k,t),l}function O(){var e=A(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),p.prepTicks(e);var a=function(t){return p.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},d=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=I.select("text.delta");function y(){g.text(c(l(n[0]),a)).call(x.fill,d(n[0])).call(f.convertToTspans,t)}return g.call(u.font,m.delta.font).call(x.fill,d({delta:m._deltaLastValue})),T(M)?g.transition().duration(M.duration).ease(M.easing).tween("text",(function(){var t=r.select(this),e=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,e),u=i(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(x.fill,d({delta:u(e)}))}})).each("end",(function(){y(),C&&C()})).each("interrupt",(function(){y(),C&&C()})):y(),h=S(c(l(n[0]),a),m.delta.font,k,t),g}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var R,F=m.mode+m.align;if(m._hasDelta&&(R=O(),F+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,F+=m.delta.increasing.symbol+m.delta.decreasing.symbol,d=h),m._hasNumber&&(D(),F+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,d=c),m._hasDelta&&m._hasNumber){var j,B,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],U=[(h.left+h.right)/2,(h.top+h.bottom)/2],V=.75*m.delta.font.size;"left"===m.delta.position&&(j=E(m,"deltaPos",0,-1*(c.width*b[m.align]+h.width*(1-b[m.align])+V),F,Math.min),B=N[1]-U[1],d={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:h.left+j,right:c.right,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"right"===m.delta.position&&(j=E(m,"deltaPos",0,c.width*(1-b[m.align])+h.width*b[m.align]+V,F,Math.max),B=N[1]-U[1],d={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:c.left,right:h.right+j,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"bottom"===m.delta.position&&(j=null,B=h.height,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(j=null,B=c.top,d={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),R.attr({dx:j,dy:B})}(m._hasNumber||m._hasDelta)&&I.attr("transform",(function(){var t=l.numbersScaler(d);F+=t[2];var e,r=E(m,"numbersScale",1,t[0],F,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*d.bottom:y-r*(d.top+d.bottom)/2,m._numbersTop=r*d.top+e;var n=d[v];"center"===v&&(n=(d.left+d.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,F,Math.max),s(i,e)+o(r)}))}(t,z,e,{numbersX:m,numbersY:v,numbersScaler:C,transitionOpts:d,onComplete:g}),D&&(I={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},L={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var Z=z.selectAll("g.angular").data(O?e:[]);Z.exit().remove();var W=z.selectAll("g.angularaxis").data(O?e:[]);W.exit().remove(),O&&function(t,e,i,a){var o,u,h,f,d=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,_=[m.l+m.w/2,m.t+m.h/2+g/2],b=a.gauge,w=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function C(t){var e=d.gauge.axis.range[0],r=(t-e)/(d.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function I(t){return r.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-E)}function L(t){t.attr("d",(function(t){return I(t.thickness).startAngle(C(t.range[0])).endAngle(C(t.range[1]))()}))}b.enter().append("g").classed("angular",!0),b.attr("transform",s(_[0],_[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=A(t,d.gauge.axis)).type="linear",o.range=d.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},D=p.makeLabelFns(o,0).labelStandoff;z.xFn=function(t){var e=P(t);return Math.cos(e)*D},z.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(D+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*c)},z.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var O=function(t){return s(_[0]+g*Math.cos(t),_[1]-g*Math.sin(t))};h=function(t){return O(P(t))};var R=function(t){var e=P(t);return O(e)+"rotate("+-l(e)+")"};if(u=p.calcTicks(o),f=p.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var F=(o.linewidth||1)/2;p.drawTicks(t,o,{vals:u,layer:w,path:"M"+f*F+",0h"+f*o.ticklen,transFn:R}),p.drawLabels(t,o,{vals:u,layer:w,transFn:h,labelFns:z})}var j=[v].concat(d.gauge.steps),B=b.selectAll("g.bg-arc").data(j);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(k),B.exit().remove();var N=I(d.gauge.bar.thickness),U=b.selectAll("g.value-arc").data([d.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var V,q,H,G=U.select("path");T(M)?(G.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=N,q=C(i[0].lastY),H=C(i[0].y),function(){var t=n(q,H);return function(e){return V.endAngle(t(e))()}})),d._lastValue=i[0].y):G.attr("d","number"==typeof i[0].y?N.endAngle(C(i[0].y)):"M0,0Z"),G.call(k),U.exit().remove(),j=[];var Z=d.gauge.threshold.value;(Z||0===Z)&&j.push({range:[Z,Z],color:d.gauge.threshold.color,line:{color:d.gauge.threshold.line.color,width:d.gauge.threshold.line.width},thickness:d.gauge.threshold.thickness});var W=b.selectAll("g.threshold-arc").data(j);W.enter().append("g").classed("threshold-arc",!0).append("path"),W.select("path").call(L).call(k),W.exit().remove();var Y=b.selectAll("g.gauge-outline").data([x]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(L).call(k),Y.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Z,layer:W,size:j,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var Y=z.selectAll("g.bullet").data(R?e:[]);Y.exit().remove();var X=z.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,l,c,u=r[0].trace,f=n.gauge,d=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,v=u.domain,_=n.transitionOpts,b=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",s(y.l,y.t)),d.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),d.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,M=u.gauge.bar.thickness*w,S=v.x[0],E=v.x[0]+(v.x[1]-v.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function C(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*w})).attr("height",(function(t){return t.thickness*w}))}(i=A(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=p.calcTicks(i),o=p.makeTransTickFn(i),l=p.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(p.drawTicks(t,i,{vals:"inside"===i.ticks?p.clipEnds(i,a):a,layer:d,path:p.makeTickPath(i,c,l),transFn:o}),p.drawLabels(t,i,{vals:a,layer:d,transFn:o,labelFns:p.makeLabelFns(i,c)}));var I=[m].concat(u.gauge.steps),L=f.selectAll("g.bg-bullet").data(I);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(k),L.exit().remove();var P=f.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(w-M)/2).call(k),T(_)?P.select("rect").transition().duration(_.duration).ease(_.easing).each("end",(function(){b&&b()})).each("interrupt",(function(){b&&b()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),P.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),D=f.selectAll("g.threshold-bullet").data(z);D.enter().append("g").classed("threshold-bullet",!0).append("line"),D.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(x.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),D.exit().remove();var O=f.selectAll("g.gauge-outline").data([g]);O.enter().append("g").classed("gauge-outline",!0).append("rect"),O.select("rect").call(C).call(k),O.exit().remove()}(t,0,e,{gauge:Y,layer:X,size:j,gaugeBg:I,gaugeOutline:L,transitionOpts:d,onComplete:g});var $=z.selectAll("text.title").data(e);$.exit().remove(),$.enter().append("text").classed("title",!0),$.attr("text-anchor",(function(){return R?_.right:_[P.title.align]})).text(P.title.text).call(u.font,P.title.font).call(f.convertToTspans,t),$.attr("transform",(function(){var t,e=j.l+j.w*b[P.title.align],r=h.titlePadding,n=u.bBox($.node());return D?(O&&(t=P.gauge.axis.visible?u.bBox(W.node()).top-r-n.bottom:j.t+j.h/2-U/2-n.bottom-r),R&&(t=v-(n.top+n.bottom)/2,e=j.l-h.bulletPadding*j.w)):t=P._numbersTop-r-n.bottom,s(e,t)}))}))}}}),Kb=f({"src/traces/indicator/index.js"(t,e){e.exports={moduleType:"trace",name:"indicator",basePlotModule:Zb(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:Wb(),supplyDefaults:Xb().supplyDefaults,calc:$b().calc,plot:Jb(),meta:{}}}}),Qb=f({"lib/indicator.js"(t,e){e.exports=Kb()}}),tw=f({"src/traces/table/attributes.js"(t,e){var r=xn(),n=O().extendFlat,i=Lt().overrideAll,a=R(),o=Ta().attributes,s=Ee().descriptionOnlyNumbers;e.exports=i({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))}},"calc","from-root")}}),ew=f({"src/traces/table/defaults.js"(t,e){var r=se(),n=tw(),i=Ta().defaults;e.exports=function(t,e,a,o){function s(i,a){return r.coerce(t,e,n,i,a)}i(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),iw=f({"src/traces/table/data_preparation_helper.js"(t,e){var r=nw(),n=O().extendFlat,i=T(),a=S().isTypedArray,o=S().isArrayOrTypedArray;function s(t){if(o(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var a=c(e.cells.values),d=function(t){return t.slice(e.header.values.length,t.length)},m=c(e.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(d(a).map((function(){return u((m[0]||[""]).length)}))),y=e.domain,v=Math.floor(t._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(t._fullLayout._size.h*(y.y[1]-y.y[0])),_=e.header.values.length?g[0].map((function(){return e.header.height})):[r.emptyHeaderHeight],b=a.length?a[0].map((function(){return e.cells.height})):[],w=_.reduce(l,0),T=p(b,x-w+r.uplift),k=f(p(_,w),[]),A=f(T,k),M={},S=e._fullInput.columnorder;o(S)&&(S=Array.from(S)),S=S.concat(d(a.map((function(t,e){return e}))));var E=g.map((function(t,r){var n=o(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return i(n)?Number(n):1})),C=E.reduce(l,0);E=E.map((function(t){return t/C*v}));var I=Math.max(s(e.header.line.width),s(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:y.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-y.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:I,height:x,columnOrder:S,groupHeight:x,rowBlocks:A,headerRowBlocks:k,scrollY:0,cells:n({},e.cells,{values:a}),headerCells:n({},e.header,{values:g}),gdColumns:g.map((function(t){return t[0]})),gdColumnsOriginalOrder:g.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(t,e){var r=M[t];return M[t]=(r||0)+1,{key:t+"__"+M[t],label:t,specIndex:e,xIndex:S[e],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=h(t)})),L}}}),aw=f({"src/traces/table/data_split_helpers.js"(t){var e=O().extendFlat;t.splitToPanels=function(t){var r=[0,0],n=e({},t,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:e({},t.calcdata,{cells:t.calcdata.headerCells})});return[e({},t,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),e({},t,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},t.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}}}),ow=f({"src/traces/table/plot.js"(t,e){var r=nw(),n=v(),i=se(),a=i.numberFormat,o=Dx(),s=Ke(),l=Me(),c=se().raiseToTop,u=se().strTranslate,h=se().cancelTransition,f=iw(),p=aw(),d=q();function m(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function g(t,e){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+e.key}function y(t,e){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+e.calcdata.key+"_"+e.specIndex}function x(t){return[].concat.apply([],t.map((function(t){return t}))).map((function(t){return t.__data__}))}function _(t,e,i){var a=t.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(t){var e=t.scrollbarState;e.totalHeight=function(t){var e=t.rowBlocks;return R(e,e.length-1)+(e.length?F(e[e.length-1],1/0):1)}(t),e.scrollableAreaHeight=t.groupHeight-E(t),e.currentlyVisibleHeight=Math.min(e.totalHeight,e.scrollableAreaHeight),e.ratio=e.currentlyVisibleHeight/e.totalHeight,e.barLength=Math.max(e.ratio*e.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),e.barWiggleRoom=e.currentlyVisibleHeight-e.barLength,e.wiggleRoom=Math.max(0,e.totalHeight-e.scrollableAreaHeight),e.topY=0===e.barWiggleRoom?0:t.scrollY/e.wiggleRoom*e.barWiggleRoom,e.bottomY=e.topY+e.barLength,e.dragMultiplier=e.wiggleRoom/e.barWiggleRoom})).attr("transform",(function(t){var e=t.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(e,E(t))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(t){return u(0,t.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(t){return t.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||I(e,t,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(t){return n.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t})).on("drag",I(e,t)).on("dragend",(function(){}))),h.attr("y2",(function(t){return t.scrollbarState.scrollableAreaHeight})),e._context.staticPlot&&(c.remove(),h.remove())}function b(t,e,i,a){var l=function(t){var e=t.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return e.enter().append("g").classed(r.cn.columnCells,!0),e.exit().remove(),e}(i),c=function(t){var e=t.selectAll("."+r.cn.columnCell).data(p.splitToCells,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.columnCell,!0),e.exit().remove(),e}(l);!function(t){t.each((function(t,e){var r=t.calcdata.cells.font,n=t.column.specIndex,i={size:k(r.size,n,e),color:k(r.color,n,e),family:k(r.family,n,e),weight:k(r.weight,n,e),style:k(r.style,n,e),variant:k(r.variant,n,e),textcase:k(r.textcase,n,e),lineposition:k(r.lineposition,n,e),shadow:k(r.shadow,n,e)};t.rowNumber=t.key,t.align=k(t.calcdata.cells.align,n,e),t.cellBorderWidth=k(t.calcdata.cells.line.width,n,e),t.font=i}))}(c);var u=function(t){var e=t.selectAll("."+r.cn.cellRect).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("rect").classed(r.cn.cellRect,!0),e}(c);!function(t){t.attr("width",(function(t){return t.column.columnWidth})).attr("stroke-width",(function(t){return t.cellBorderWidth})).each((function(t){var e=n.select(this);d.stroke(e,k(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),d.fill(e,k(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))}))}(u);var h=function(t){var e=t.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),e}(c),f=function(t){var e=t.selectAll("."+r.cn.cellText).data(o.repeat,(function(t){return t.keyWithinBlock}));return e.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),e}(h);!function(t){t.each((function(t){s.font(n.select(this),t.font)}))}(f),w(f,e,a,t),O(c)}function w(t,e,i,o){t.text((function(t){var e=t.column.specIndex,n=t.rowNumber,i=t.value,o="string"==typeof i,s=o&&i.match(/
/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(r.latexCheck);t.latex=u;var h,f,p=u?"":k(t.calcdata.cells.prefix,e,n)||"",d=u?"":k(t.calcdata.cells.suffix,e,n)||"",m=u?null:k(t.calcdata.cells.format,e,n)||null,g=p+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(h=T(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===h?T(g):h),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===r.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=R(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(L(t,r,e,c,n.prevPages,n,0),L(t,r,e,c,n.prevPages,n,1),_(r,t))}}function I(t,e,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(M);return C(t,h,l),s.scrollY===u}}function L(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,i,a){return function(){var o=n.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var n,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*r.cellPad;for(t.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(t.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(t.value+=l.join(r.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,t,a),n.select(e.parentNode.parentNode).call(O)}}function z(t,e,i,a,o){return function(){if(!o.settledY){var s=n.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,f=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*r.cellPad:h,p=Math.max(f,h);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+r.cn.columnCell).call(O),C(null,t.filter(M),0),_(i,a,!0)),s.attr("transform",(function(){var t=this,e=t.parentNode.getBoundingClientRect(),i=n.select(t.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),s=i.top-e.top+(a?a.matrix.f:r.cellPad);return u(D(o,n.select(t.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function D(t,e){switch(t.align){case"left":default:return r.cellPad;case"right":return t.column.columnWidth-(e||0)-r.cellPad;case"center":return(t.column.columnWidth-(e||0))/2}}function O(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+F(e,1/0)}),0),r=F(B(t),t.key);return u(0,r+e)})).selectAll("."+r.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function R(t,e){for(var r=0,n=e-1;n>=0;n--)r+=j(t[n]);return r}function F(t,e){for(var r=0,n=0;ne.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}}}),xw=f({"src/traces/carpet/plot.js"(t,e){var r=v(),n=Ke(),i=gw(),a=yw(),o=vw(),s=Me(),l=se(),c=l.strRotate,u=l.strTranslate,h=Ae();function f(t,e,o,s,l,c,u){var h="const-"+l+"-lines",f=o.selectAll("."+h).data(c);f.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),f.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,t.c2p),h=i([],c,e.c2p),f="M"+a(u,h,s.smoothing);r.select(this).attr("d",f).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function p(t,e,i,a,l,h,f,p){var d=h.selectAll("text."+p).data(f);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(l,h){var f;if("auto"===l.axis.tickangle)f=o(a,e,i,l.xy,l.dxy);else{var p=(l.axis.tickangle+180)*Math.PI/180;f=o(a,e,i,l.xy,[Math.cos(p),Math.sin(p)])}h||(g={angle:f.angle,flip:f.flip});var d=(l.endAnchor?-1:1)*f.flip,y=r.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,t),v=n.bBox(this);y.attr("transform",u(f.p[0],f.p[1])+c(f.angle)+u(l.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,n,s){var c=t._context.staticPlot,u=e.xaxis,h=e.yaxis,d=t._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(e){var n=r.select(this),s=e[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),_=l.ensureSingle(n,"g","majorlayer"),b=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),f(u,h,_,0,"a",y._gridlines,!0),f(u,h,_,0,"b",v._gridlines,!0),f(u,h,x,0,"a",y._minorgridlines,!0),f(u,h,x,0,"b",v._minorgridlines,!0),f(u,h,b,0,"a-boundary",y._boundarylines,c),f(u,h,b,0,"b-boundary",v._boundarylines,c);var T=p(t,u,h,m,0,w,y._labels,"a-label"),k=p(t,u,h,m,0,w,v._labels,"b-label");!function(t,e,r,n,i,a,s,c){var u,h,f,p,d=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(d+m),h=y,f=r.ab2xy(u,h,!0),p=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,f,r.dxydb_rough(u,h))),g(t,e,r,0,f,p,r.aaxis,i,a,s,"a-title"),u=d,h=.5*(y+v),f=r.ab2xy(u,h,!0),p=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,f,r.dxyda_rough(u,h))),g(t,e,r,0,f,p,r.baxis,i,a,c,"b-title")}(t,w,m,0,u,h,T,k),function(t,e,r,n,o){var s,c,u,h,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var p=l.ensureSingle(f,"path","carpetboundary"),d=e.clipsegments,m=[];for(h=0;h90&&v<270,_=r.select(this);_.text(f.title.text).call(s.convertToTspans,t),x&&(b=(-s.lineCount(_)+m)*d*a-b),_.attr("transform",u(e.p[0],e.p[1])+c(e.angle)+u(0,b)).attr("text-anchor","middle").call(n.font,f.title.font)})),_.exit().remove()}}}),_w=f({"src/traces/carpet/cheater_basis.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n){var i,a,o,s,l,c,u=[],h=r(t)?t.length:t,f=r(e)?e.length:e,p=r(t)?t:null,d=r(e)?e:null;p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(h-1)),d&&(s=(d.length-1)/(d[d.length-1]-d[0])/(f-1));var m=1/0,g=-1/0;for(a=0;a=10)return null;for(var i=1/0,a=-1/0,o=t.length,s=0;s0&&(p=t.dxydi([],n-1,o,0,s),y.push(l[0]+p[0]/3),v.push(l[1]+p[1]/3),d=t.dxydi([],n-1,o,1,s),y.push(h[0]-d[0]/3),v.push(h[1]-d[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=t.a2i(r),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=L,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=e,x.axis=_,x.crossAxis=A,x.value=r,x.constvar=i,x.index=f,x.x=y,x.y=v,x.smoothing=A.smoothing,x}function D(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(e){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nx.length-1||b.push(n(D(o),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u;fx.length-1||m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<_.minorgridcount;a++)(v=m-s)<=0||(d=g+(y-g)*(a+1)/(_.minorgridcount+1)*(_.arraydtick/v))x[x.length-1]||w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(D(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(D(x.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-_.tick0)/_.dtick*(1+l)),Math.ceil((x[0]-_.tick0)/_.dtick/(1+l))].sort((function(t,e){return t-e})))[0],h=c[1],f=u;f<=h;f++)p=_.tick0+_.dtick*f,b.push(n(z(p),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=u-1;fx[x.length-1]||w.push(n(z(d),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&T.push(n(z(x[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&T.push(n(z(x[x.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}}}),Tw=f({"src/traces/carpet/calc_labels.js"(t,e){var r=nr(),n=O().extendFlat;e.exports=function(t,e){var i,a,o,s=e._labels=[],l=e._gridlines;for(i=0;i=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),Aw=f({"src/traces/carpet/smooth_fill_2d_array.js"(t,e){var r=se();e.exports=function(t,e,n){var i,a,o,s,l,c,u,h,f,p,d,m,g,y,v,x,_,b,w,T=[],k=[],A=t[0].length,M=t.length,S=0;for(i=0;i0&&void 0!==(c=t[l][s-1])&&(h++,u+=c),s0&&void 0!==(c=t[l-1][s])&&(h++,u+=c),l0&&a0&&i1e-5);return r.log("Smoother converged to",E,"after",C,"iterations"),t}}}),Mw=f({"src/traces/carpet/constants.js"(t,e){e.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Sw=f({"src/traces/carpet/catmull_rom.js"(t,e){e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,f=c*(l+c)*3,p=l*(l+c)*3;return[[e[0]+(f&&u/f),e[1]+(f&&h/f)],[e[0]-(p&&u/p),e[1]-(p&&h/p)]]}}}),Ew=f({"src/traces/carpet/compute_control_points.js"(t,e){var r=Sw(),n=se().ensureArray;function i(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}e.exports=function(t,e,a,o,s,l){var c,u,h,f,p,d,m,g,y,v,x=a[0].length,_=a.length,b=s?3*x-2:x,w=l?3*_-2:_;for(t=n(t,w),e=n(e,w),h=0;hp&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=i(t._xctrl,t._yctrl,e,r,h.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=a([t._xctrl,t._yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=o([t._xctrl,t._yctrl],h.smoothing,f.smoothing),t.dxydj=s([t._xctrl,t._yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),r=t[1]-e;return(1-r)*l[e]+r*l[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(n(t,e),c-2)),i=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-i)/(a-i)))},t.b2j=function(t){var e=Math.max(0,Math.min(n(t,l),u-2)),r=l[e],i=l[e+1];return Math.max(0,Math.min(u-1,e+(t-r)/(i-r)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(r,n,i){if(!i&&(re[c-1]|nl[u-1]))return[!1,!1];var a=t.a2i(r),o=t.b2j(n),s=t.evalxy([],a,o);if(i){var h,f,p,d,m=0,g=0,y=[];re[c-1]?(h=c-2,f=1,m=(r-e[c-1])/(e[c-1]-e[c-2])):f=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),nl[u-1]?(p=u-2,d=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):d=o-(p=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(t.dxydi(y,h,p,f,d),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(t.dxydj(y,h,p,f,d),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(l.length-2,t));return l[e+1]-l[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}}}),zw=f({"src/traces/carpet/calc.js"(t,e){var r=nr(),n=se().isArray1D,i=_w(),a=bw(),o=ww(),s=Tw(),l=kw(),c=Po(),u=Aw(),h=Lo(),f=Pw();e.exports=function(t,e){var p=r.getFromId(t,e.xaxis),d=r.getFromId(t,e.yaxis),m=e.aaxis,g=e.baxis,y=e.x,v=e.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(e,m,g,"a","b",x);var _=e._a=e._a||e.a,b=e._b=e._b||e.b;y=e._x||e.x,v=e._y||e.y;var w={};if(e._cheater){var T="index"===m.cheatertype?_.length:_,k="index"===g.cheatertype?b.length:b;y=i(T,k,e.cheaterslope)}e._x=y=c(y),e._y=v=c(v),u(y,_,b),u(v,_,b),f(e),e.setScale();var A=a(y),M=a(v),S=.5*(A[1]-A[0]),E=.5*(A[1]+A[0]),C=.5*(M[1]-M[0]),I=.5*(M[1]+M[0]),L=1.3;return A=[E-S*L,E+S*L],M=[I-C*L,I+C*L],e._extremes[p._id]=r.findExtremes(p,A,{padded:!0}),e._extremes[d._id]=r.findExtremes(d,M,{padded:!0}),o(e,"a","b"),o(e,"b","a"),s(e,m),s(e,g),w.clipsegments=l(e._xctrl,e._yctrl,m,g),w.x=y,w.y=v,w.a=_,w.b=b,[w]}}}),Dw=f({"src/traces/carpet/index.js"(t,e){e.exports={attributes:hw(),supplyDefaults:mw(),plot:xw(),calc:zw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Mi(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Ow=f({"lib/carpet.js"(t,e){e.exports=Dw()}}),Rw=f({"src/traces/scattercarpet/attributes.js"(t,e){var r=bn(),n=wn(),i=N(),a=Dt().hovertemplateAttrs,o=Dt().texttemplateAttrs,s=Le(),l=O().extendFlat,c=n.marker,u=n.line,h=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}}),Fw=f({"src/traces/scattercarpet/defaults.js"(t,e){var r=se(),n=_n(),i=We(),a=Zn(),o=Wn(),s=Yn(),l=Xn(),c=$n(),u=Rw();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}p("carpet"),e.xaxis="x",e.yaxis="y";var d=p("a"),m=p("b"),g=Math.min(d.length,m.length);if(g){e._length=g,p("text"),p("texttemplate"),p("hovertext"),p("mode",g")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}}}),qw=f({"src/traces/scattercarpet/event_data.js"(t,e){e.exports=function(t,e,r,n,i){var a=n[i];return t.a=a.a,t.b=a.b,t.y=a.y,t}}}),Hw=f({"src/traces/scattercarpet/index.js"(t,e){e.exports={attributes:Rw(),supplyDefaults:Fw(),colorbar:fi(),formatLabels:jw(),calc:Nw(),plot:Uw(),style:di().style,styleOnSelect:di().styleOnSelect,hoverPoints:Vw(),selectPoints:yi(),eventData:qw(),moduleType:"trace",name:"scattercarpet",basePlotModule:Mi(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Gw=f({"lib/scattercarpet.js"(t,e){e.exports=Hw()}}),Zw=f({"src/traces/contourcarpet/attributes.js"(t,e){var r=_o(),n=ss(),i=Le(),a=O().extendFlat,o=n.contours;e.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),Ww=f({"src/traces/contourcarpet/defaults.js"(t,e){var r=se(),n=bo(),i=Zw(),a=Is(),o=cs(),s=hs();e.exports=function(t,e,l,c){function u(n,a){return r.coerce(t,e,i,n,a)}if(u("carpet"),t.a&&t.b){if(!n(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?a(t,e,u,c,l,{hasHover:!1}):(o(t,e,u,(function(n){return r.coerce2(t,e,i,n)})),s(t,e,u,c,{hasHover:!1}))}else e._defaultColor=l,e._length=null;u("zorder")}}}),Yw=f({"src/traces/contourcarpet/calc.js"(t,e){var r=Ge(),n=se(),i=Lo(),a=Po(),o=zo(),s=Do(),l=Oo(),c=Ww(),u=Bw(),h=ps();e.exports=function(t,e){var f=e._carpetTrace=u(t,e);if(f&&f.visible&&"legendonly"!==f.visible){if(!e.a||!e.b){var p=t.data[f.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),c(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var c,u,h,f,p,d,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(e.z)&&i(e,y,v,"a","b",["z"]),c=e._a=e._a||e.a,f=e._b=e._b||e.b,c=c?y.makeCalcdata(e,"_a"):[],f=f?v.makeCalcdata(e,"_b"):[],u=e.a0||0,h=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=a(e._z||e.z,e.transpose),e._emptypoints=s(m),o(m,e._emptypoints);var x=n.maxRowLength(m),_="scaled"===e.xtype?"":c,b=l(e,_,u,h,x,y),w="scaled"===e.ytype?"":f,T=l(e,w,p,d,m.length,v),k={a:b,b:T,z:m};return"levels"===e.contours.type&&"none"!==e.contours.coloring&&r(t,e,{vals:m,containerStr:"",cLetter:"z"}),[k]}(t,e);return h(e,e._z),m}}}}),Xw=f({"src/traces/carpet/axis_aligned_line.js"(t,e){var r=se().isArrayOrTypedArray;e.exports=function(t,e,n,i){var a,o,s,l,c,u,h,f,p,d,m,g,y,v=r(n)?"a":"b",x=("a"===v?t.aaxis:t.baxis).smoothing,_="a"===v?t.a2i:t.b2j,b="a"===v?n:i,w="a"===v?i:n,T="a"===v?e.a.length:e.b.length,k="a"===v?e.b.length:e.a.length,A=Math.floor("a"===v?t.b2j(w):t.a2i(w)),M="a"===v?function(e){return t.evalxy([],e,A)}:function(e){return t.evalxy([],A,e)};x&&(s=Math.max(0,Math.min(k-2,A)),l=A-s,o="a"===v?function(e,r){return t.dxydi([],e,s,r,l)}:function(e,r){return t.dxydj([],s,e,l,r)});var S=_(b[0]),E=_(b[1]),C=S0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,D=C>0?Math.max:Math.min,O=L(S+I),R=P(E-I),F=[[h=M(S)]];for(a=O;a*C=0;N--)F=M.clipsegments[N],j=n([],F.x,b.c2p),B=n([],F.y,w.c2p),j.reverse(),B.reverse(),V.push(i(j,B,F.bicubic));var q="M"+V.join("L")+"Z";!function(t,e,r,a,s,l){var c,u,h,f,p=o.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(f=0;f=0&&(f=C,d=g):Math.abs(h[1]-f[1])=0&&(f=C,d=g):o.log("endpt to newendpt is not vert. or horz.",h,f,C)}if(d>=0)break;v+=S(h,f),h=f}if(d===e.edgepaths.length){o.log("unclosed perimeter path");break}u=d,(_=-1===x.indexOf(u))&&(u=x[0],v+=S(h,f)+"Z",h=null)}for(u=0;um&&(n.max=m),n.len=n.max-n.min}function v(t,e){var r,n=0,o=.1;return(Math.abs(t[0]-l)y):g=A>w,y=A;var M=c(w,T,k,A);M.pos=b,M.yc=(w+A)/2,M.i=_,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],v&&(M.orig_p=a[_]),d&&(M.tx=e.text[_]),m&&(M.htx=e.hovertext[_]),x.push(M)}else x.push({pos:b,empty:!0})}return e._extremes[l._id]=i.findExtremes(l,r.concat(f,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(t,"open:")+" ",high:n(t,"high:")+" ",low:n(t,"low:")+" ",close:n(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var n=i.getFromId(t,e.xaxis),o=i.getFromId(t,e.yaxis),c=function(t,e,n){var i=n._minDiff;if(!i){var o,s=t._fullData,l=[];for(i=1/0,o=0;o"+u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat):((v=n.extendFlat({},f)).y0=v.y1=b,v.yLabelVal=_,v.yLabel=u.labels[x]+r.hoverLabelText(s,_,l.yhoverformat),v.name="",h.push(v),g[_]=v)}return h}function h(t,e,n,i){var a=t.cd,s=t.ya,u=a[0].trace,h=a[0].t,f=c(t,e,n,i);if(!f)return[];var p=a[f.index],d=f.index=p.i,m=p.dir;function g(t){return h.labels[t]+r.hoverLabelText(s,u[t][d],u.yhoverformat)}var y=p.hi||u.hoverinfo,v=y.split("+"),x="all"===y,_=x||-1!==v.indexOf("y"),b=x||-1!==v.indexOf("text"),w=_?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return b&&o(p,u,w),f.extraText=w.join("
"),f.y0=f.y1=s.c2p(p.yc,!0),[f]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?u(t,e,r,n):h(t,e,r,n)},hoverSplit:u,hoverOnPoints:h}}}),oT=f({"src/traces/ohlc/select.js"(t,e){e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;rn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var n=t.type;if("linear"===n){var o=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?i(t):t}(o(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?a(t):t}(t,e))}}t.makeCalcdata=function(e,r){var n,i,a=e[r],o=e._length,s=function(r){return t.d2c(r,e.thetaunit)};if(a)for(n=new Array(o),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),a=r.mod(n+1,e.length);return[e[n],e[a]]},findIntersectionXY:l,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:u,pathPolygon:function(t,e,r,n,i,a){return"M"+h(c(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t0?1:0}function n(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function i(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function a(t,e){return e*t.radius}e.exports={smith:n,reactanceArc:function(t,e,r,o){var s=i(t,n([r,e])),l=s[0],c=s[1],u=i(t,n([o,e])),h=u[0],f=u[1];if(0===e)return["M"+l+","+c,"L"+h+","+f].join(" ");var p=a(t,1/Math.abs(e));return["M"+l+","+c,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+h+","+f].join(" ")},resistanceArc:function(t,e,o,s){var l=a(t,1/(e+1)),c=i(t,n([e,o])),u=c[0],h=c[1],f=i(t,n([e,s])),p=f[0],d=f[1];if(r(o)!==r(s)){var m=i(t,n([e,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0=90||l>90&&c>=450?1:h<=0&&p<=0?0:Math.max(h,p),e=l<=180&&c>=180||l>180&&c>=540?-1:u>=0&&f>=0?0:Math.min(u,f),r=l<=270&&c>=270||l>270&&c>=630?-1:h>=0&&p>=0?0:Math.min(h,p),n=c>=360?1:u<=0&&f<=0?0:Math.max(u,f),[e,r,n,i]}(d),b=_[2]-_[0],w=_[3]-_[1],T=p/f,k=Math.abs(w/b);T>k?(m=f,x=(p-(g=f*k))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=p,x=(f-(m=p/k))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var A,M=r.xOffset2=i.l+i.w*y[0],S=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/b,C=r.innerRadius=r.getHole(e)*E,I=r.cx=M-E*_[0],L=r.cy=S+E*_[3],P=r.cxx=I-M,z=r.cyy=L-S,D=a.side;"counterclockwise"===D?(A=D,D="top"):"clockwise"===D&&(A=D,D="bottom"),r.radialAxis=r.mockAxis(t,e,a,{_id:"x",side:D,_trueSide:A,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(t,e,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(t,e),r.updateAngularAxis(t,e),r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.xaxis=r.mockCartesianAxis(t,e,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(t,e,{_id:"y",domain:v});var O=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",O).attr("transform",s(P,z)),n.frontplot.attr("transform",s(M,S)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",O).attr("transform",s(I,L)).call(l.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=a.extendFlat({},r,n);return p(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);f(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*a,t[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(e);d(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]90&&m<=270&&(g.tickangle=180);var x=v?function(t){var e=z(r,I([t.x,0]));return s(e[0]-f,e[1]-p)}:function(t){return s(g.l2p(t.x)+u,0)},_=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},b=U(d);if(r.radialTickLayout!==b&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=b),y){g.setScale();var w=0,T=v?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return h.tickText(g,t,!0,!1)})):h.calcTicks(g),k=v?T:h.clipEnds(g,T),A=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(A=-A),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,A),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?j(V(F(d.angle),r.vangles)):d.angle,S=s(f,p),E=S+o(-M);H(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:E}),H(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),H(i["radial-line"].select("line"),y&&d.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(e),u=n.id+"title",h=0;if(l.title){var f=c.bBox(n.layers["radial-axis"].node()).height,p=l.title.font.size,d=l.side;h="top"===d?p:"counterclockwise"===d?-(f+.4*p):f+.8*p}var m=void 0!==r?r:n.radialAxisAngle,g=F(m),y=Math.cos(g),v=Math.sin(g),_=o+a/2*y+h*v,b=s-a/2*v+h*y;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:O(i,"Click to enter radial axis title"),attributes:{x:_,y:b,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=z(r,I([0,t.x]));return Math.atan2(e[0]-f,e[1]-p)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=j(m.tick0),m.dtick=j(m.dtick));var v=function(t){return s(f+c*Math.cos(t),p-c*Math.sin(t))},x=g?function(t){var e=z(r,I([0,t.x]));return s(e[0],e[1])}:function(t){return v(y(t))},_=g?function(t){var e=z(r,I([0,t.x])),n=Math.atan2(e[0]-f,e[1]-p)-Math.PI/2;return s(e[0],e[1])+o(-j(n))}:function(t){var e=y(t);return v(e)+o(-j(e))},b=g?function(t){return L(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,p-u*n]+"L"+[f+c*r,p-c*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},k=U(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var A,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return h.tickText(m,t,!0,!1)})):h.calcTicks(m);if(g&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===e.gridshape?(A=S.map(y),a.angleDelta(A[0],A[1])<0&&(A=A.slice().reverse())):A=null,r.vangles=A,"category"===m.type&&(S=S.filter((function(t){return a.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:_,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}H(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:s(f,p)}).attr("stroke-width",d.linewidth).call(l.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,f=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,v=l.radius,x=l.innerRadius,T=l.cx,k=l.cy,A=l.cxx,M=l.cyy,C=l.sectorInRad,I=l.vangles,L=l.radialAxis,P=E.clampTiny,z=E.findXYatLength,D=E.findEnclosingVertexAngles,O=S.cornerHalfWidth,R=S.cornerLen/2,F=m.makeDragger(h,"path","maindrag",!1===t.dragmode?"none":"crosshair");r.select(F).attr("d",l.pathSubplot()).attr("transform",s(T,k)),F.onmousemove=function(t){y.hover(u,t,l.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=l.id},F.onmouseout=function(t){u._dragging||g.unhover(u,t)};var j,B,N,U,V,q,H,G,Z,W={element:F,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Y(t-A,e-M)}function $(t,e){return Math.atan2(M-e,t-A)}function J(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function K(t,e){if(0===t)return l.pathSector(2*O);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,v)),o=a-O,s=a+O;return"M"+J(o,n)+"A"+[o,o]+" 0,0,0 "+J(o,i)+"L"+J(s,i)+"A"+[s,s]+" 0,0,1 "+J(s,n)+"Z"}function Q(t,e,r){if(0===t)return l.pathSector(2*O);var n,i,a=J(t,e),o=J(t,r),s=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,f=z(O,u,s,c);n=z(R,h,f[0][0],f[0][1]),i=z(R,h,f[1][0],f[1][1])}else{var p,d;c?(p=R,d=O):(p=O,d=R),n=[[s-p,c-d],[s+p,c-d]],i=[[s-p,c+d],[s+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,v),x),tp?(t-1&&1===t&&b(e,u,[l.xaxis],[l.yaxis],l.id,W),r.indexOf("event")>-1&&y.click(u,e,l.id)}W.prepFn=function(t,r,i){var s=u._fullLayout.dragmode,h=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var d=a.apply3DTransform(p)(r-h.left,i-h.top);if(j=d[0],B=d[1],I){var g=E.findPolygonOffset(v,C[0],C[1],I);j+=A+g[0],B+=M+g[1]}switch(s){case"zoom":W.clickFn=st,c||(W.moveFn=I?it:rt,W.doneFn=at,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var t=u._fullLayout[l.id];H=n(t.bgcolor).getLuminance(),(G=m.makeZoombox(f,H,T,k,V)).attr("fill-rule","evenodd"),Z=m.makeCorners(f,T,k),w(u)}());break;case"select":case"lasso":_(t,r,i,W,s)}},g.init(W)},N.updateRadialDrag=function(t,e,n){var l=this,c=l.gd,u=l.layers,h=l.radius,f=l.innerRadius,p=l.cx,d=l.cy,y=l.radialAxis,v=S.radialDragBoxSize,x=v/2;if(y.visible){var _,b,T,M=F(l.radialAxisAngle),E=y._rl,C=E[0],I=E[1],L=E[n],P=.75*(E[1]-E[0])/(1-l.getHole(e))/h;n?(_=p+(h+x)*Math.cos(M),b=d-(h+x)*Math.sin(M),T="radialdrag"):(_=p+(f-x)*Math.cos(M),b=d-(f-x)*Math.sin(M),T="radialdrag-inner");var z,D,O,R=m.makeRectDragger(u,T,"crosshair",-x,-x,v,v),B={element:R,gd:c};!1===t.dragmode&&(B.dragmode=!1),H(r.select(R),y.visible&&f0==(n?O>C:O")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),ET=f({"src/traces/scatterpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:bT(),categories:["polar","symbols","showLegend","scatter-like"],attributes:wT(),supplyDefaults:TT().supplyDefaults,colorbar:fi(),formatLabels:kT(),calc:AT(),plot:MT(),style:di().style,styleOnSelect:di().styleOnSelect,hoverPoints:ST().hoverPoints,selectPoints:yi(),meta:{}}}}),CT=f({"lib/scatterpolar.js"(t,e){e.exports=ET()}}),IT=f({"src/traces/scatterpolargl/attributes.js"(t,e){var r=wT(),n=Dg(),i=Dt().texttemplateAttrs;e.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}}),LT=f({"src/traces/scatterpolargl/defaults.js"(t,e){var r=se(),n=We(),i=TT().handleRThetaDefaults,a=Zn(),o=Wn(),s=Xn(),l=$n(),c=_n().PTS_LINESONLY,u=IT();e.exports=function(t,e,h,f){function p(n,i){return r.coerce(t,e,u,n,i)}var d=i(t,e,f,p);d?(p("thetaunit"),p("mode",d=l&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=b),v.line&&b.length>1&&s.extendFlat(v.line,o.linePositions(t,p,b)),v.text&&(s.extendFlat(v.text,{positions:b},o.textPosition(t,p,v.text,v.marker)),s.extendFlat(v.textSel,{positions:b},o.textPosition(t,p,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:b},o.textPosition(t,p,v.text,v.markerUnsel))),v.fill&&!f.fill2d&&(f.fill2d=!0),v.marker&&!f.scatter2d&&(f.scatter2d=!0),v.line&&!f.line2d&&(f.line2d=!0),v.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(v.line),f.fillOptions.push(v.fill),f.markerOptions.push(v.marker),f.markerSelectedOptions.push(v.markerSel),f.markerUnselectedOptions.push(v.markerUnsel),f.textOptions.push(v.text),f.textSelectedOptions.push(v.textSel),f.textUnselectedOptions.push(v.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=y,d.positions=b,d._scene=f,d.index=f.count,f.count++}})),i(t,e,c)}},e.exports.reglPrecompiled={}}}),FT=f({"src/traces/scatterpolargl/index.js"(t,e){var r=OT();r.plot=RT(),e.exports=r}}),jT=f({"lib/scatterpolargl.js"(t,e){e.exports=FT()}}),BT=f({"src/traces/barpolar/attributes.js"(t,e){var r,n=Dt().hovertemplateAttrs,i=O().extendFlat,a=wT(),o=Ha();e.exports={r:a.r,theta:a.theta,r0:a.r0,dr:a.dr,theta0:a.theta0,dtheta:a.dtheta,thetaunit:a.thetaunit,base:i({},o.base,{}),offset:i({},o.offset,{}),width:i({},o.width,{}),text:i({},o.text,{}),hovertext:i({},o.hovertext,{}),marker:(r=i({},o.marker),delete r.cornerradius,r),hoverinfo:a.hoverinfo,hovertemplate:n(),selected:o.selected,unselected:o.unselected}}}),NT=f({"src/traces/barpolar/layout_attributes.js"(t,e){e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),UT=f({"src/traces/barpolar/defaults.js"(t,e){var r=se(),n=TT().handleRThetaDefaults,i=Za(),a=BT();e.exports=function(t,e,o,s){function l(n,i){return r.coerce(t,e,a,n,i)}n(t,e,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(t,e,l,o,s),r.coerceSelectionMarkerOpacity(e,l)):e.visible=!1}}}),VT=f({"src/traces/barpolar/layout_defaults.js"(t,e){var r=se(),n=NT();e.exports=function(t,e,i){var a,o={};function s(i,o){return r.coerce(t[a]||{},e[a],n,i,o)}for(var l=0;l0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,t.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,e,r)}:function(t,n,a,o){return i.pathAnnulus(t,n,a,o,e,r)}}(e),d=e.layers.frontplot.select("g.barlayer");i.makeTraceGroups(d,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,a=r.select(this),o=t.rp0=h.c2p(t.s0),s=t.rp1=h.c2p(t.s1),l=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(n(o)&&n(s)&&n(l)&&n(d)&&o!==s&&l!==d){var m=h.c2g(t.s1),g=(l+d)/2;t.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],e=p(o,s,l,d)}else e="M0,0Z";i.ensureSingle(a,"path").attr("d",e)})),a.setClipUrl(o,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}}}),GT=f({"src/traces/barpolar/hover.js"(t,e){var r=zr(),n=se(),i=eo().getTraceColor,a=n.fillText,o=ST().makeHoverPointText,s=gT().isPtInsidePolygon;e.exports=function(t,e,l){var c=t.cd,u=c[0].trace,h=t.subplot,f=h.radialAxis,p=h.angularAxis,d=h.vangles,m=d?s:n.isPtInsideSector,g=t.maxHoverDistance,y=p._period||2*Math.PI,v=Math.abs(f.g2p(Math.sqrt(e*e+l*l))),x=Math.atan2(l,e);if(f.range[0]>f.range[1]&&(x+=Math.PI),r.getClosest(c,(function(t){return m(v,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var _=c[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var b=n.extendFlat({},_,{r:_.s,theta:_.p});return a(_,u,t),o(b,u,h,t),t.hovertemplate=u.hovertemplate,t.color=i(u,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}}}),ZT=f({"src/traces/barpolar/index.js"(t,e){e.exports={moduleType:"trace",name:"barpolar",basePlotModule:bT(),categories:["polar","bar","showLegend"],attributes:BT(),layoutAttributes:NT(),supplyDefaults:UT(),supplyLayoutDefaults:VT(),calc:qT().calc,crossTraceCalc:qT().crossTraceCalc,plot:HT(),colorbar:fi(),formatLabels:kT(),style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:GT(),selectPoints:no(),meta:{}}}}),WT=f({"lib/barpolar.js"(t,e){e.exports=ZT()}}),YT=f({"src/plots/smith/constants.js"(t,e){e.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),XT=f({"src/plots/smith/layout_attributes.js"(t,e){var r=V(),n=Ce(),i=Ta().attributes,a=se().extendFlat,o=Lt().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);e.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),$T=f({"src/plots/smith/layout_defaults.js"(t,e){var r,n,i,a=se(),o=q(),s=ge(),l=qs(),c=be().getSubplotData,u=Ne(),h=Be(),f=bi(),p=tr(),d=XT(),m=YT(),g=m.axisNames,y=(r=function(t){return a.isTypedArray(t)&&(t=Array.from(t)),t.slice().reverse().map((function(t){return-t})).concat([0]).concat(t)},n=String,i={},function(t){var e=n?n(t):t;if(e in i)return i[e];var a=r(t);return i[e]=a,a});function v(t,e,r,n){var i=r("bgcolor");n.bgColor=o.combine(i,n.paper_bgcolor);var l,v=c(n.fullData,m.name,n.id),x=n.layoutOut;function _(t,e){return r(l+"."+t,e)}for(var b=0;b")}}e.exports={hoverPoints:function(t,e,i,a){var o=r(t,e,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),ik=f({"src/traces/scattersmith/index.js"(t,e){e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:JT(),categories:["smith","symbols","showLegend","scatter-like"],attributes:KT(),supplyDefaults:QT(),colorbar:fi(),formatLabels:tk(),calc:ek(),plot:rk(),style:di().style,styleOnSelect:di().styleOnSelect,hoverPoints:nk().hoverPoints,selectPoints:yi(),meta:{}}}}),ak=f({"lib/scattersmith.js"(t,e){e.exports=ik()}}),ok=f({"node_modules/world-calendars/dist/main.js"(t,e){var r=uy();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}r(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),r(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day(),"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var l=e.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),sk=f({"node_modules/world-calendars/dist/plus.js"(){var t=uy(),e=ok();t(e.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),e.local=e.regionalOptions[""],t(e.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),t(e.baseCalendar.prototype,{UNIX_EPOCH:e.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:e.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,r,n){if("string"!=typeof t&&(n=r,r=t,t=""),!r)return"";if(r.calendar()!==this)throw e.local.invalidFormat||e.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var i,a,o,s,l,c=(n=n||{}).dayNamesShort||this.local.dayNamesShort,u=n.dayNames||this.local.dayNames,h=n.monthNumbers||this.local.monthNumbers,f=n.monthNamesShort||this.local.monthNamesShort,p=n.monthNames||this.local.monthNames,d=(n.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),m=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length1},x=function(t,n){var i=v(t,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(A).match(o);if(!s)throw(e.local.missingNumberAt||e.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},_=this,b=function(){if("function"==typeof l){v("m");var t=l.call(_,r.substring(A));return A+=t.length,t}return x("m")},w=function(t,n,i,a){for(var o=v(t,a)?i:n,s=0;s-1){p=1,d=m;for(var E=this.daysInMonth(f,p);d>E;E=this.daysInMonth(f,p))p++,d-=E}return h>-1?this.fromJD(h):this.newDate(f,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})}}),lk=f({"node_modules/world-calendars/dist/calendars/chinese.js"(){var t=ok(),e=uy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(a);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),o=""+this.toChineseMonth(n,i);return e&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(t){if("string"==typeof t){var e=t.match(o);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(s);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="闰"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"闰"===e[0]&&(r=!0,e=e.substring(1)),"月"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(e,r,n){var i=this.intercalaryMonth(e);if(n&&r!==i||r<1||r>12)throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(e,r){e.year&&(r=(e=e.year()).month());var n=this.intercalaryMonth(e);if(r<0||r>(n?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(e,n,i){var a,o=this._validateYear(e,t.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,n,i)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(e,r){e.year&&(r=e.month(),e=e.year()),e=this._validateYear(e);var n=l[e-l[0]];if(r>(n>>13?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,s,i,t.local.invalidDate);e=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(e,n),s=this.toChineseMonth(e,n),u=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var u;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:u}}s=o.day-1;var h,f=l[o.year-l[0]],p=f>>13;h=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(e,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=r.fromJD(t),n=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=c[i.year-c[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=c[a.year-c[0]];var u,h=new Date(o>>9&4095,(o>>5&15)-1,31&o),f=new Date(i.year,i.month-1,i.day);u=Math.round((f-h)/864e5);var p,d=l[a.year-l[0]];for(p=0;p<13;p++){var m=d&1<<12-p?30:29;if(u>13;return!g||p=2&&n<=6},extraInfo:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};t.calendars.discworld=r}}),hk=f({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()+(r.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return(e=i.year())<0&&e++,i.day()+30*(i.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),t.calendars.ethiopian=r}}),fk=f({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(t){return n(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),12===r&&this.leapYear(e)||8===r&&5===n(this.daysInYear(e),10)?30:9===r&&3===n(this.daysInYear(e),10)?29:this.daysPerMonth[r-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=e<=0?e+1:e,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(e);s++)o+=this.daysInMonth(e,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.hebrew=r}}),pk=f({"node_modules/world-calendars/dist/calendars/islamic.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),e=e<=0?e+1:e,(n=i.day())+Math.ceil(29.5*(r-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),t.calendars.islamic=r}}),dk=f({"node_modules/world-calendars/dist/calendars/julian.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return(e=r.year()<0?r.year()+1:r.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return e=i.year(),r=i.month(),n=i.day(),e<0&&e++,r<=2&&(e--,r+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),t.calendars.julian=r}}),mk=f({"node_modules/world-calendars/dist/calendars/mayan.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,e){return t-e*Math.floor(t/e)}function i(t,e){return n(t-1,e)+1}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year();var r=Math.floor(e/400);return e%=400,e+=e<0?400:0,r+"."+Math.floor(e/20)+"."+e%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),18},weekOfYear:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,t.local.invalidYear),360},daysInMonth:function(e,r){return this._validate(e,r,this.minDay,t.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate).day()},weekDay:function(e,r,n){return this._validate(e,r,n,t.local.invalidDate),!0},extraInfo:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=n(8+(t-=this.jdEpoch)+340,365);return[Math.floor(e/20)+1,n(e,20)]},_toTzolkin:function(t){return[i(20+(t-=this.jdEpoch),20),i(t+4,13)]},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),t.calendars.mayan=r}}),gk=f({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar;var n=t.instance("gregorian");e(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidMonth);(e=a.year())<0&&e++;for(var o=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),t.calendars.nanakshahi=r}}),yk=f({"node_modules/world-calendars/dist/calendars/nepali.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[e][n];return r},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,t.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[e][r]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(e,r,n){var i=this._validate(e,r,n,t.local.invalidDate);e=i.year(),r=i.month(),n=i.day();var a=t.instance(),o=0,s=r,l=e;this._createMissingCalendarData(e);var c=e-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var r=t.instance().fromJD(e),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate);e=a.year(),r=a.month(),i=a.day();var o=e-(e>=0?474:473),s=474+n(o,2820);return i+(r<=7?31*(r-1):30*(r-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),i=n(e,1029983),a=2820;if(1029982!==i){var o=Math.floor(i/366),s=n(i,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),t.calendars.persian=r,t.calendars.jalali=r}}),xk=f({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var t=ok(),e=uy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),t.calendars.taiwan=n}}),_k=f({"node_modules/world-calendars/dist/calendars/thai.js"(){var t=ok(),e=uy(),r=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,e(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var n=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(n.year()),r.leapYear(e)},weekOfYear:function(e,n,i){var a=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return e=this._t2gYear(a.year()),r.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,r){var n=this._validate(e,r,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(e,n,i){var a=this._validate(e,n,i,t.local.invalidDate);return e=this._t2gYear(a.year()),r.toJD(e,a.month(),a.day())},fromJD:function(t){var e=r.fromJD(t),n=this._g2tYear(e.year());return this.newDate(n,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),t.calendars.thai=n}}),bk=f({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var t=ok(),e=uy();function r(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}r.prototype=new t.baseCalendar,e(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,t.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(e,r){for(var i=this._validate(e,r,this.minDay,t.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;oi)return n[a]-n[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(e,r,i){var a=this._validate(e,r,i,t.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,i=0;ie);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=e-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(e,r,n){var i=t.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(e=null!=e.year?e.year:e)>=1276&&e<=1500),i},_validate:function(e,r,n,i){var a=t.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),t.calendars.ummalqura=r;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),wk=f({"src/components/calendars/calendars.js"(t,e){e.exports=ok(),sk(),lk(),ck(),uk(),hk(),fk(),pk(),dk(),mk(),gk(),yk(),vk(),xk(),_k(),bk()}}),Tk=f({"src/components/calendars/index.js"(t,e){var r=wk(),n=se(),i=k(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(t,e,r,i){var a={};return a[r]=s,n.coerce(t,e,a,r,i)},c="##",u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function f(t){var e=h[t];return e||(e=h[t]=r.instance(t))}function p(t){return n.extendFlat({},s,{description:t})}function d(t){return"Sets the calendar system to use with `"+t+"` date data."}var m={xcalendar:p(d("x"))},g=n.extendFlat({},m,{ycalendar:p(d("y"))}),y=n.extendFlat({},g,{zcalendar:p(d("z"))}),v=p(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:p(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(t,e,r,n){for(var i=0;i{"use strict";t.exports=function(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===e){l.length=d;break}}h.push(g);var _=new Array(v);for(d=0;d{"use strict";function n(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}r.d(e,{A:()=>n})},37:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(902),i=r(180);function a(t){let e,r,a;function s(t,n,i=0,a=t.length){if(i>>1;r(t[e],n)<0?i=e+1:a=e}while(i(0,n.A)(t(e),r),a=(e,r)=>t(e)-r):(e=t===n.A||t===i.A?t:o,r=t,a=t),{left:s,center:function(t,e,r=0,n=t.length){const i=s(t,e,r,n-1);return i>r&&a(t[i-1],e)>-a(t[i],e)?i-1:i},right:function(t,n,i=0,a=t.length){if(i>>1;r(t[e],n)<=0?i=e+1:a=e}while(i{"use strict";function n(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}r.d(e,{A:()=>n})},47:(t,e,r)=>{"use strict";r.d(e,{KS:()=>i,Nn:()=>a,ph:()=>n});class n{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let r=0;for(let n=0;n0){for(a=t[--i];i>0&&(e=a,r=t[--i],a=e+r,n=r-(a-e),!n););i>0&&(n<0&&t[i-1]<0||n>0&&t[i-1]>0)&&(r=2*n,e=a+r,r==e-a&&(a=e))}return a}}function i(t,e){const r=new n;if(void 0===e)for(let e of t)(e=+e)&&r.add(e);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&r.add(i)}return+r}function a(t,e){const r=new n;let i=-1;return Float64Array.from(t,void 0===e?t=>r.add(+t||0):n=>r.add(+e(n,++i,t)||0))}},882:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Adder:()=>E.ph,InternMap:()=>C,InternSet:()=>I,ascending:()=>n.A,bin:()=>it,bisect:()=>u,bisectCenter:()=>c,bisectLeft:()=>l,bisectRight:()=>s,bisector:()=>i.A,blur:()=>h,blur2:()=>f,blurImage:()=>p,count:()=>v,cross:()=>w,cumsum:()=>T,descending:()=>k.A,deviation:()=>M,difference:()=>Vt,disjoint:()=>qt,every:()=>Rt,extent:()=>S,fcumsum:()=>E.Nn,filter:()=>jt,flatGroup:()=>B,flatRollup:()=>N,fsum:()=>E.KS,greatest:()=>ht,greatestIndex:()=>Et,group:()=>R,groupSort:()=>K,groups:()=>F,histogram:()=>it,index:()=>q,indexes:()=>H,intersection:()=>Ht,least:()=>Mt,leastIndex:()=>St,map:()=>Bt,max:()=>at,maxIndex:()=>ot,mean:()=>yt,median:()=>vt,medianIndex:()=>xt,merge:()=>_t.A,min:()=>st,minIndex:()=>lt,mode:()=>bt,nice:()=>rt,pairs:()=>wt,permute:()=>W,quantile:()=>ft,quantileIndex:()=>dt,quantileSorted:()=>pt,quickselect:()=>ct,range:()=>kt.A,rank:()=>At,reduce:()=>Nt,reverse:()=>Ut,rollup:()=>U,rollups:()=>V,scan:()=>Ct,shuffle:()=>It,shuffler:()=>Lt,some:()=>Ft,sort:()=>Y,subset:()=>Yt,sum:()=>Pt,superset:()=>Zt,thresholdFreedmanDiaconis:()=>mt,thresholdScott:()=>gt,thresholdSturges:()=>nt,tickIncrement:()=>et.lq,tickStep:()=>et.sG,ticks:()=>et.Ay,transpose:()=>zt,union:()=>Xt,variance:()=>A,zip:()=>Ot});var n=r(902),i=r(37);function a(t){return null===t?NaN:+t}const o=(0,i.A)(n.A),s=o.right,l=o.left,c=(0,i.A)(a).center,u=s;function h(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let r=t.length;if(!((r=Math.floor(r))>=0))throw new RangeError("invalid length");if(!r||!e)return t;const n=y(e),i=t.slice();return n(t,i,0,r,1),n(i,t,0,r,1),n(t,i,0,r,1),t}const f=d(y),p=d((function(t){const e=y(t);return(t,r,n,i,a)=>{e(t,r,(n<<=2)+0,(i<<=2)+0,a<<=2),e(t,r,n+1,i+1,a),e(t,r,n+2,i+2,a),e(t,r,n+3,i+3,a)}}));function d(t){return function(e,r,n=r){if(!((r=+r)>=0))throw new RangeError("invalid rx");if(!((n=+n)>=0))throw new RangeError("invalid ry");let{data:i,width:a,height:o}=e;if(!((a=Math.floor(a))>=0))throw new RangeError("invalid width");if(!((o=Math.floor(void 0!==o?o:i.length/a))>=0))throw new RangeError("invalid height");if(!a||!o||!r&&!n)return e;const s=r&&t(r),l=n&&t(n),c=i.slice();return s&&l?(m(s,c,i,a,o),m(s,i,c,a,o),m(s,c,i,a,o),g(l,i,c,a,o),g(l,c,i,a,o),g(l,i,c,a,o)):s?(m(s,i,c,a,o),m(s,c,i,a,o),m(s,i,c,a,o)):l&&(g(l,i,c,a,o),g(l,c,i,a,o),g(l,i,c,a,o)),e}}function m(t,e,r,n,i){for(let a=0,o=n*i;a{if(!((a-=o)>=i))return;let s=t*n[i];const l=o*t;for(let t=i,e=i+l;t{if(!((o-=s)>=a))return;let l=e*i[a];const c=s*e,u=c+s;for(let t=a,e=a+c;t=e&&++r;else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(i=+i)>=i&&++r}return r}function x(t){return 0|t.length}function _(t){return!(t>0)}function b(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function w(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),r=(t=t.map(b)).map(x),n=t.length-1,i=new Array(n+1).fill(0),a=[];if(n<0||r.some(_))return a;for(;;){a.push(i.map(((e,r)=>t[r][e])));let o=n;for(;++i[o]===r[o];){if(0===o)return e?a.map(e):a;i[o--]=0}}}function T(t,e){var r=0,n=0;return Float64Array.from(t,void 0===e?t=>r+=+t||0:i=>r+=+e(i,n++,t)||0)}var k=r(180);function A(t,e){let r,n=0,i=0,a=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(r=e-i,i+=r/++n,a+=r*(e-i));else{let o=-1;for(let s of t)null!=(s=e(s,++o,t))&&(s=+s)>=s&&(r=s-i,i+=r/++n,a+=r*(s-i))}if(n>1)return a/(n-1)}function M(t,e){const r=A(t,e);return r?Math.sqrt(r):r}function S(t,e){let r,n;if(void 0===e)for(const e of t)null!=e&&(void 0===r?e>=e&&(r=n=e):(r>e&&(r=e),n=a&&(r=n=a):(r>a&&(r=a),nt.pop().map((([e,r])=>[...t,e,r]))));return t}function B(t,...e){return j(F(t,...e),e)}function N(t,e,...r){return j(V(t,e,...r),r)}function U(t,e,...r){return Z(t,O,e,r)}function V(t,e,...r){return Z(t,Array.from,e,r)}function q(t,...e){return Z(t,O,G,e)}function H(t,...e){return Z(t,Array.from,G,e)}function G(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Z(t,e,r,n){return function t(i,a){if(a>=n.length)return r(i);const o=new C,s=n[a++];let l=-1;for(const t of i){const e=s(t,++l,i),r=o.get(e);r?r.push(t):o.set(e,[t])}for(const[e,r]of o)o.set(e,t(r,a));return e(o)}(t,0)}function W(t,e){return Array.from(e,(e=>t[e]))}function Y(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[r]=e;if(r&&2!==r.length||e.length>1){const n=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),n.sort(((t,r)=>{for(const n of e){const e=$(n[t],n[r]);if(e)return e}}))):(r=t.map(r),n.sort(((t,e)=>$(r[t],r[e])))),W(t,n)}return t.sort(X(r))}function X(t=n.A){if(t===n.A)return $;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||0===n?n:(0===t(r,r))-(0===t(e,e))}}function $(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function K(t,e,r){return(2!==e.length?Y(U(t,e,r),(([t,e],[r,i])=>(0,n.A)(e,i)||(0,n.A)(t,r))):Y(R(t,r),(([t,r],[i,a])=>e(r,a)||(0,n.A)(t,i)))).map((([t])=>t))}var J=Array.prototype,Q=J.slice;J.map;function tt(t){return()=>t}var et=r(946);function rt(t,e,r){let n;for(;;){const i=(0,et.lq)(t,e,r);if(i===n||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),n=i}}function nt(t){return Math.max(1,Math.ceil(Math.log(v(t))/Math.LN2)+1)}function it(){var t=O,e=S,r=nt;function n(n){Array.isArray(n)||(n=Array.from(n));var i,a,o,s=n.length,l=new Array(s);for(i=0;i=f)if(t>=f&&e===S){const t=(0,et.lq)(h,f,r);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else p.pop()}for(var d=p.length,m=0,g=d;p[m]<=h;)++m;for(;p[g-1]>f;)--g;(m||g0?p[i-1]:h,y.x1=i0)for(i=0;i=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r=i)&&(r=i)}return r}function ot(t,e){let r,n=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(r=e)&&(r=e,n=i);else for(let a of t)null!=(a=e(a,++i,t))&&(r=a)&&(r=a,n=i);return n}function st(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function lt(t,e){let r,n=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(r>e||void 0===r&&e>=e)&&(r=e,n=i);else for(let a of t)null!=(a=e(a,++i,t))&&(r>a||void 0===r&&a>=a)&&(r=a,n=i);return n}function ct(t,e,r=0,n=1/0,i){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(i=void 0===i?$:X(i);n>r;){if(n-r>600){const a=n-r+1,o=e-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);ct(t,e,Math.max(r,Math.floor(e-o*l/a+c)),Math.min(n,Math.floor(e+(a-o)*l/a+c)),i)}const a=t[e];let o=r,s=n;for(ut(t,r,e),i(t[n],a)>0&&ut(t,r,n);o0;)--s}0===i(t[r],a)?ut(t,r,s):(++s,ut(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}return t}function ut(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function ht(t,e=n.A){let r,i=!1;if(1===e.length){let a;for(const o of t){const t=e(o);(i?(0,n.A)(t,a)>0:0===(0,n.A)(t,t))&&(r=o,a=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r}function ft(t,e,r){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let r=-1;for(let n of t)null!=(n=e(n,++r,t))&&(n=+n)>=n&&(yield n)}}(t,r)),(n=t.length)&&!isNaN(e=+e)){if(e<=0||n<2)return st(t);if(e>=1)return at(t);var n,i=(n-1)*e,a=Math.floor(i),o=at(ct(t,a).subarray(0,a+1));return o+(st(t.subarray(a+1))-o)*(i-a)}}function pt(t,e,r=a){if((n=t.length)&&!isNaN(e=+e)){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,o=Math.floor(i),s=+r(t[o],o,t);return s+(+r(t[o+1],o+1,t)-s)*(i-o)}}function dt(t,e,r=a){if(!isNaN(e=+e)){if(n=Float64Array.from(t,((e,n)=>a(r(t[n],n,t)))),e<=0)return lt(n);if(e>=1)return ot(n);var n,i=Uint32Array.from(t,((t,e)=>e)),o=n.length-1,s=Math.floor(o*e);return ct(i,s,0,o,((t,e)=>$(n[t],n[e]))),(s=ht(i.subarray(0,s+1),(t=>n[t])))>=0?s:-1}}function mt(t,e,r){const n=v(t),i=ft(t,.75)-ft(t,.25);return n&&i?Math.ceil((r-e)/(2*i*Math.pow(n,-1/3))):1}function gt(t,e,r){const n=v(t),i=M(t);return n&&i?Math.ceil((r-e)*Math.cbrt(n)/(3.49*i)):1}function yt(t,e){let r=0,n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++r,n+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++r,n+=a)}if(r)return n/r}function vt(t,e){return ft(t,.5,e)}function xt(t,e){return dt(t,.5,e)}var _t=r(128);function bt(t,e){const r=new C;if(void 0===e)for(let e of t)null!=e&&e>=e&&r.set(e,(r.get(e)||0)+1);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&i>=i&&r.set(i,(r.get(i)||0)+1)}let n,i=0;for(const[t,e]of r)e>i&&(i=e,n=t);return n}function wt(t,e=Tt){const r=[];let n,i=!1;for(const a of t)i&&r.push(e(n,a)),n=a,i=!0;return r}function Tt(t,e){return[t,e]}var kt=r(561);function At(t,e=n.A){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let r=Array.from(t);const i=new Float64Array(r.length);2!==e.length&&(r=r.map(e),e=n.A);const a=(t,n)=>e(r[t],r[n]);let o,s;return(t=Uint32Array.from(r,((t,e)=>e))).sort(e===n.A?(t,e)=>$(r[t],r[e]):X(a)),t.forEach(((t,e)=>{const r=a(t,void 0===o?t:o);r>=0?((void 0===o||r>0)&&(o=t,s=e),i[t]=s):i[t]=NaN})),i}function Mt(t,e=n.A){let r,i=!1;if(1===e.length){let a;for(const o of t){const t=e(o);(i?(0,n.A)(t,a)<0:0===(0,n.A)(t,t))&&(r=o,a=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r}function St(t,e=n.A){if(1===e.length)return lt(t,e);let r,i=-1,a=-1;for(const n of t)++a,(i<0?0===e(n,n):e(n,r)<0)&&(r=n,i=a);return i}function Et(t,e=n.A){if(1===e.length)return ot(t,e);let r,i=-1,a=-1;for(const n of t)++a,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=a);return i}function Ct(t,e){const r=St(t,e);return r<0?void 0:r}const It=Lt(Math.random);function Lt(t){return function(e,r=0,n=e.length){let i=n-(r=+r);for(;i;){const n=t()*i--|0,a=e[i+r];e[i+r]=e[n+r],e[n+r]=a}return e}}function Pt(t,e){let r=0;if(void 0===e)for(let e of t)(e=+e)&&(r+=e);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function zt(t){if(!(i=t.length))return[];for(var e=-1,r=st(t,Dt),n=new Array(r);++ee(r,n,t)))}function Nt(t,e,r){if("function"!=typeof e)throw new TypeError("reducer is not a function");const n=t[Symbol.iterator]();let i,a,o=-1;if(arguments.length<3){if(({done:i,value:r}=n.next()),i)return;++o}for(;({done:i,value:a}=n.next()),!i;)r=e(r,a,++o,t);return r}function Ut(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function Vt(t,...e){t=new I(t);for(const r of e)for(const e of r)t.delete(e);return t}function qt(t,e){const r=e[Symbol.iterator](),n=new I;for(const e of t){if(n.has(e))return!1;let t,i;for(;({value:t,done:i}=r.next())&&!i;){if(Object.is(e,t))return!1;n.add(t)}}return!0}function Ht(t,...e){t=new I(t),e=e.map(Gt);t:for(const r of t)for(const n of e)if(!n.has(r)){t.delete(r);continue t}return t}function Gt(t){return t instanceof I?t:new I(t)}function Zt(t,e){const r=t[Symbol.iterator](),n=new Set;for(const t of e){const e=Wt(t);if(n.has(e))continue;let i,a;for(;({value:i,done:a}=r.next());){if(a)return!1;const t=Wt(i);if(n.add(t),Object.is(e,t))break}}return!0}function Wt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Yt(t,e){return Zt(e,t)}function Xt(...t){const e=new I;for(const r of t)for(const t of r)e.add(t);return e}},128:(t,e,r)=>{"use strict";function n(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}r.d(e,{A:()=>n})},561:(t,e,r)=>{"use strict";function n(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++nn})},946:(t,e,r)=>{"use strict";r.d(e,{Ay:()=>s,lq:()=>l,sG:()=>c});const n=Math.sqrt(50),i=Math.sqrt(10),a=Math.sqrt(2);function o(t,e,r){const s=(e-t)/Math.max(0,r),l=Math.floor(Math.log10(s)),c=s/Math.pow(10,l),u=c>=n?10:c>=i?5:c>=a?2:1;let h,f,p;return l<0?(p=Math.pow(10,-l)/u,h=Math.round(t*p),f=Math.round(e*p),h/pe&&--f,p=-p):(p=Math.pow(10,l)*u,h=Math.round(t/p),f=Math.round(e/p),h*pe&&--f),f0))return[];if((t=+t)===(e=+e))return[t];const n=e=i))return[];const l=a-i+1,c=new Array(l);if(n)if(s<0)for(let t=0;t{"use strict";r.r(e),r.d(e,{dispatch:()=>l});var n={value:()=>{}};function i(){for(var t,e=0,r=arguments.length,n={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),l=-1,c=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var r,n,i=new Array(r),a=0;a{"use strict";r.r(e),r.d(e,{geoAlbers:()=>An,geoAlbersUsa:()=>Mn,geoArea:()=>it,geoAzimuthalEqualArea:()=>In,geoAzimuthalEqualAreaRaw:()=>Cn,geoAzimuthalEquidistant:()=>Pn,geoAzimuthalEquidistantRaw:()=>Ln,geoBounds:()=>Bt,geoCentroid:()=>Kt,geoCircle:()=>le,geoClipAntimeridian:()=>_e,geoClipCircle:()=>be,geoClipExtent:()=>Ce,geoClipRectangle:()=>Ee,geoConicConformal:()=>jn,geoConicConformalRaw:()=>Fn,geoConicEqualArea:()=>kn,geoConicEqualAreaRaw:()=>Tn,geoConicEquidistant:()=>Vn,geoConicEquidistantRaw:()=>Un,geoContains:()=>Ze,geoDistance:()=>Fe,geoEqualEarth:()=>Xn,geoEqualEarthRaw:()=>Yn,geoEquirectangular:()=>Nn,geoEquirectangularRaw:()=>Bn,geoGnomonic:()=>Kn,geoGnomonicRaw:()=>$n,geoGraticule:()=>$e,geoGraticule10:()=>Ke,geoIdentity:()=>Jn,geoInterpolate:()=>Je,geoLength:()=>De,geoMercator:()=>Dn,geoMercatorRaw:()=>zn,geoNaturalEarth1:()=>ti,geoNaturalEarth1Raw:()=>Qn,geoOrthographic:()=>ri,geoOrthographicRaw:()=>ei,geoPath:()=>on,geoProjection:()=>_n,geoProjectionMutator:()=>bn,geoRotation:()=>ae,geoStereographic:()=>ii,geoStereographicRaw:()=>ni,geoStream:()=>D,geoTransform:()=>sn,geoTransverseMercator:()=>oi,geoTransverseMercatorRaw:()=>ai});var n=r(47),i=1e-6,a=1e-12,o=Math.PI,s=o/2,l=o/4,c=2*o,u=180/o,h=o/180,f=Math.abs,p=Math.atan,d=Math.atan2,m=Math.cos,g=Math.ceil,y=Math.exp,v=(Math.floor,Math.hypot),x=Math.log,_=Math.pow,b=Math.sin,w=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,k=Math.tan;function A(t){return t>1?0:t<-1?o:Math.acos(t)}function M(t){return t>1?s:t<-1?-s:Math.asin(t)}function S(t){return(t=b(t/2))*t}function E(){}function C(t,e){t&&L.hasOwnProperty(t.type)&&L[t.type](t,e)}var I={Feature:function(t,e){C(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=m(e=(e*=h)/2+l),o=b(e),s=B*o,c=j*a+s*m(i),u=s*n*b(i);K.add(d(u,c)),F=t,j=a,B=o}function it(t){return J=new n.ph,D(t,Q),2*J}function at(t){return[d(t[1],t[0]),M(t[2])]}function ot(t){var e=t[0],r=t[1],n=m(r);return[n*m(e),n*b(e),b(r)]}function st(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lt(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ct(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ut(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ht(t){var e=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var ft,pt,dt,mt,gt,yt,vt,xt,_t,bt,wt,Tt,kt,At,Mt,St,Et={point:Ct,lineStart:Lt,lineEnd:Pt,polygonStart:function(){Et.point=zt,Et.lineStart=Dt,Et.lineEnd=Ot,Y=new n.ph,Q.polygonStart()},polygonEnd:function(){Q.polygonEnd(),Et.point=Ct,Et.lineStart=Lt,Et.lineEnd=Pt,K<0?(N=-(V=180),U=-(q=90)):Y>i?q=90:Y<-i&&(U=-90),$[0]=N,$[1]=V},sphere:function(){N=-(V=180),U=-(q=90)}};function Ct(t,e){X.push($=[N=t,V=t]),eq&&(q=e)}function It(t,e){var r=ot([t*h,e*h]);if(W){var n=lt(W,r),i=lt([n[1],-n[0],0],n);ht(i),i=at(i);var a,o=t-H,s=o>0?1:-1,l=i[0]*u*s,c=f(o)>180;c^(s*Hq&&(q=a):c^(s*H<(l=(l+360)%360-180)&&lq&&(q=e)),c?tRt(N,V)&&(V=t):Rt(t,V)>Rt(N,V)&&(N=t):V>=N?(tV&&(V=t)):t>H?Rt(N,t)>Rt(N,V)&&(V=t):Rt(t,V)>Rt(N,V)&&(N=t)}else X.push($=[N=t,V=t]);eq&&(q=e),W=r,H=t}function Lt(){Et.point=It}function Pt(){$[0]=N,$[1]=V,Et.point=Ct,W=null}function zt(t,e){if(W){var r=t-H;Y.add(f(r)>180?r+(r>0?360:-360):r)}else G=t,Z=e;Q.point(t,e),It(t,e)}function Dt(){Q.lineStart()}function Ot(){zt(G,Z),Q.lineEnd(),f(Y)>i&&(N=-(V=180)),$[0]=N,$[1]=V,W=null}function Rt(t,e){return(e-=t)<0?e+360:e}function Ft(t,e){return t[0]-e[0]}function jt(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eRt(n[0],n[1])&&(n[1]=i[1]),Rt(i[0],n[1])>Rt(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,e=0,n=a[r=a.length-1];e<=r;n=i,++e)i=a[e],(s=Rt(n[1],i[0]))>o&&(o=s,N=i[0],V=n[1])}return X=$=null,N===1/0||U===1/0?[[NaN,NaN],[NaN,NaN]]:[[N,U],[V,q]]}var Nt={sphere:E,point:Ut,lineStart:qt,lineEnd:Zt,polygonStart:function(){Nt.lineStart=Wt,Nt.lineEnd=Yt},polygonEnd:function(){Nt.lineStart=qt,Nt.lineEnd=Zt}};function Ut(t,e){t*=h;var r=m(e*=h);Vt(r*m(t),r*b(t),b(e))}function Vt(t,e,r){++ft,dt+=(t-dt)/ft,mt+=(e-mt)/ft,gt+=(r-gt)/ft}function qt(){Nt.point=Ht}function Ht(t,e){t*=h;var r=m(e*=h);At=r*m(t),Mt=r*b(t),St=b(e),Nt.point=Gt,Vt(At,Mt,St)}function Gt(t,e){t*=h;var r=m(e*=h),n=r*m(t),i=r*b(t),a=b(e),o=d(T((o=Mt*a-St*i)*o+(o=St*n-At*a)*o+(o=At*i-Mt*n)*o),At*n+Mt*i+St*a);pt+=o,yt+=o*(At+(At=n)),vt+=o*(Mt+(Mt=i)),xt+=o*(St+(St=a)),Vt(At,Mt,St)}function Zt(){Nt.point=Ut}function Wt(){Nt.point=Xt}function Yt(){$t(Tt,kt),Nt.point=Ut}function Xt(t,e){Tt=t,kt=e,t*=h,e*=h,Nt.point=$t;var r=m(e);At=r*m(t),Mt=r*b(t),St=b(e),Vt(At,Mt,St)}function $t(t,e){t*=h;var r=m(e*=h),n=r*m(t),i=r*b(t),a=b(e),o=Mt*a-St*i,s=St*n-At*a,l=At*i-Mt*n,c=v(o,s,l),u=M(c),f=c&&-u/c;_t.add(f*o),bt.add(f*s),wt.add(f*l),pt+=u,yt+=u*(At+(At=n)),vt+=u*(Mt+(Mt=i)),xt+=u*(St+(St=a)),Vt(At,Mt,St)}function Kt(t){ft=pt=dt=mt=gt=yt=vt=xt=0,_t=new n.ph,bt=new n.ph,wt=new n.ph,D(t,Nt);var e=+_t,r=+bt,o=+wt,s=v(e,r,o);return so&&(t-=Math.round(t/c)*c),[t,e]}function ee(t,e,r){return(t%=c)?e||r?Qt(ne(t),ie(e,r)):ne(t):e||r?ie(e,r):te}function re(t){return function(e,r){return f(e+=t)>o&&(e-=Math.round(e/c)*c),[e,r]}}function ne(t){var e=re(t);return e.invert=re(-t),e}function ie(t,e){var r=m(t),n=b(t),i=m(e),a=b(e);function o(t,e){var o=m(e),s=m(t)*o,l=b(t)*o,c=b(e),u=c*r+s*n;return[d(l*i-u*a,s*r-c*n),M(u*i+l*a)]}return o.invert=function(t,e){var o=m(e),s=m(t)*o,l=b(t)*o,c=b(e),u=c*i-l*a;return[d(l*i+c*a,s*r+u*n),M(u*r-s*n)]},o}function ae(t){function e(e){return(e=t(e[0]*h,e[1]*h))[0]*=u,e[1]*=u,e}return t=ee(t[0]*h,t[1]*h,t.length>2?t[2]*h:0),e.invert=function(e){return(e=t.invert(e[0]*h,e[1]*h))[0]*=u,e[1]*=u,e},e}function oe(t,e,r,n,i,a){if(r){var o=m(e),s=b(e),l=n*r;null==i?(i=e+n*c,a=e-l/2):(i=se(o,i),a=se(o,a),(n>0?ia)&&(i+=n*c));for(var u,h=i;n>0?h>a:h1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function ue(t,e){return f(t[0]-e[0])=0;--o)a.point((h=u[o])[0],h[1]);else n(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,d=!d}while(!p.v);a.lineEnd()}}}function pe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,F=R*O,j=F>o,B=S*z;if(y.add(d(B*R*b(F),E*D+B*m(F))),p+=j?O+R*c:O,j^k>=r^L>=r){var N=lt(ot(T),ot(I));ht(N);var U=lt(f,N);ht(U);var V=(j^O>=0?-1:1)*M(U[2]);(u>V||u===V&&(N[0]||N[1]))&&(g+=j^O>=0?1:-1)}}return(p<-i||p0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(ve))}return f}}function ve(t){return t.length>1}function xe(t,e){return((t=t.x)[0]<0?t[1]-s-i:s-t[1])-((e=e.x)[0]<0?e[1]-s-i:s-e[1])}const _e=ye((function(){return!0}),(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(l,c){var u=l>0?o:-o,h=f(l-r);f(h-o)0?s:-s),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(u,n),t.point(l,n),e=0):a!==u&&h>=o&&(f(r-a)i?p((b(e)*(o=m(n))*b(r)-b(n)*(a=m(e))*b(t))/(a*o*s)):(e+n)/2}(r,n,l,c),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(u,n),e=0),t.point(r=l,n=c),a=u},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*s,n.point(-o,a),n.point(0,a),n.point(o,a),n.point(o,0),n.point(o,-a),n.point(0,-a),n.point(-o,-a),n.point(-o,0),n.point(-o,a);else if(f(t[0]-e[0])>i){var l=t[0]0,a=f(e)>i;function s(t,r){return m(t)*m(r)>e}function l(t,r,n){var a=[1,0,0],s=lt(ot(t),ot(r)),l=st(s,s),c=s[0],u=l-c*c;if(!u)return!n&&t;var h=e*l/u,p=-e*c/u,d=lt(a,s),m=ut(a,h);ct(m,ut(s,p));var g=d,y=st(m,g),v=st(g,g),x=y*y-v*(st(m,m)-1);if(!(x<0)){var _=T(x),b=ut(g,(-y-_)/v);if(ct(b,m),b=at(b),!n)return b;var w,k=t[0],A=r[0],M=t[1],S=r[1];A0^b[1]<(f(b[0]-k)o^(k<=b[0]&&b[0]<=A)){var I=ut(g,(-y+_)/v);return ct(I,m),[b,at(I)]}}}function c(e,r){var i=n?t:o-t,a=0;return e<-i?a|=1:e>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return ye(s,(function(t){var e,r,i,u,h;return{lineStart:function(){u=i=!1,h=1},point:function(f,p){var d,m=[f,p],g=s(f,p),y=n?g?0:c(f,p):g?c(f+(f<0?o:-o),p):0;if(!e&&(u=i=g)&&t.lineStart(),g!==i&&(!(d=l(e,m))||ue(e,d)||ue(m,d))&&(m[2]=1),g!==i)h=0,g?(t.lineStart(),d=l(m,e),t.point(d[0],d[1])):(d=l(e,m),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(a&&e&&n^g){var v;y&r||!(v=l(m,e,!0))||(h=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&ue(e,m)||t.point(m[0],m[1]),e=m,i=g,r=y},lineEnd:function(){i&&t.lineEnd(),e=null},clean:function(){return h|(u&&i)<<1}}}),(function(e,n,i,a){oe(a,t,r,i,e,n)}),n?[0,-t]:[-o,t-o])}var we,Te,ke,Ae,Me=1e9,Se=-Me;function Ee(t,e,r,n){function a(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function o(i,a,o,l){var u=0,h=0;if(null==i||(u=s(i,o))!==(h=s(a,o))||c(i,a)<0^o>0)do{l.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+o+4)%4)!==h);else l.point(a[0],a[1])}function s(n,a){return f(n[0]-t)0?0:3:f(n[0]-r)0?2:1:f(n[1]-e)0?1:0:a>0?3:2}function l(t,e){return c(t.x,e.x)}function c(t,e){var r=s(t,1),n=s(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(i){var s,c,u,h,f,p,d,m,g,y,v,x=i,_=ce(),b={point:w,lineStart:function(){b.point=T,c&&c.push(u=[]);y=!0,g=!1,d=m=NaN},lineEnd:function(){s&&(T(h,f),p&&g&&_.rejoin(),s.push(_.result()));b.point=w,g&&x.lineEnd()},polygonStart:function(){x=_,s=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,i=c.length;rn&&(f-a)*(n-o)>(p-o)*(t-a)&&++e:p<=n&&(f-a)*(n-o)<(p-o)*(t-a)&&--e;return e}(),r=v&&e,a=(s=(0,ge.A)(s)).length;(r||a)&&(i.polygonStart(),r&&(i.lineStart(),o(null,null,1,i),i.lineEnd()),a&&fe(s,l,e,o,i),i.polygonEnd());x=i,s=c=u=null}};function w(t,e){a(t,e)&&x.point(t,e)}function T(i,o){var s=a(i,o);if(c&&u.push([i,o]),y)h=i,f=o,p=s,y=!1,s&&(x.lineStart(),x.point(i,o));else if(s&&g)x.point(i,o);else{var l=[d=Math.max(Se,Math.min(Me,d)),m=Math.max(Se,Math.min(Me,m))],_=[i=Math.max(Se,Math.min(Me,i)),o=Math.max(Se,Math.min(Me,o))];!function(t,e,r,n,i,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,_,t,e,r,n)?s&&(x.lineStart(),x.point(i,o),v=!1):(g||(x.lineStart(),x.point(l[0],l[1])),x.point(_[0],_[1]),s||x.lineEnd(),v=!1)}d=i,m=o,g=s}return b}}function Ce(){var t,e,r,n=0,i=0,a=960,o=500;return r={stream:function(r){return t&&e===r?t:t=Ee(n,i,a,o)(e=r)},extent:function(s){return arguments.length?(n=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,r):[[n,i],[a,o]]}}}var Ie={sphere:E,point:E,lineStart:function(){Ie.point=Pe,Ie.lineEnd=Le},lineEnd:E,polygonStart:E,polygonEnd:E};function Le(){Ie.point=Ie.lineEnd=E}function Pe(t,e){Te=t*=h,ke=b(e*=h),Ae=m(e),Ie.point=ze}function ze(t,e){t*=h;var r=b(e*=h),n=m(e),i=f(t-Te),a=m(i),o=n*b(i),s=Ae*r-ke*n*a,l=ke*r+Ae*n*a;we.add(d(T(o*o+s*s),l)),Te=t,ke=r,Ae=n}function De(t){return we=new n.ph,D(t,Ie),+we}var Oe=[null,null],Re={type:"LineString",coordinates:Oe};function Fe(t,e){return Oe[0]=t,Oe[1]=e,De(Re)}var je={Feature:function(t,e){return Ne(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n0&&(i=Fe(t[o],t[o-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))i})).map(c)).concat((0,We.A)(g(o/m)*m,a,m).filter((function(t){return f(t%v)>i})).map(u))}return _.lines=function(){return b().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[h(n).concat(p(s).slice(1),h(r).reverse().slice(1),p(l).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(n=+t[0][0],r=+t[1][0],l=+t[0][1],s=+t[1][1],n>r&&(t=n,n=r,r=t),l>s&&(t=l,l=s,s=t),_.precision(x)):[[n,l],[r,s]]},_.extentMinor=function(r){return arguments.length?(e=+r[0][0],t=+r[1][0],o=+r[0][1],a=+r[1][1],e>t&&(r=e,e=t,t=r),o>a&&(r=o,o=a,a=r),_.precision(x)):[[e,o],[t,a]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(y=+t[0],v=+t[1],_):[y,v]},_.stepMinor=function(t){return arguments.length?(d=+t[0],m=+t[1],_):[d,m]},_.precision=function(i){return arguments.length?(x=+i,c=Ye(o,a,90),u=Xe(e,t,x),h=Ye(l,s,90),p=Xe(n,r,x),_):x},_.extentMajor([[-180,-90+i],[180,90-i]]).extentMinor([[-180,-80-i],[180,80+i]])}function Ke(){return $e()()}function Je(t,e){var r=t[0]*h,n=t[1]*h,i=e[0]*h,a=e[1]*h,o=m(n),s=b(n),l=m(a),c=b(a),f=o*m(r),p=o*b(r),g=l*m(i),y=l*b(i),v=2*M(T(S(a-n)+o*l*S(i-r))),x=b(v),_=v?function(t){var e=b(t*=v)/x,r=b(v-t)/x,n=r*f+e*g,i=r*p+e*y,a=r*s+e*c;return[d(i,n)*u,d(a,T(n*n+i*i))*u]}:function(){return[r*u,n*u]};return _.distance=v,_}const Qe=t=>t;var tr,er,rr,nr,ir=new n.ph,ar=new n.ph,or={point:E,lineStart:E,lineEnd:E,polygonStart:function(){or.lineStart=sr,or.lineEnd=ur},polygonEnd:function(){or.lineStart=or.lineEnd=or.point=E,ir.add(f(ar)),ar=new n.ph},result:function(){var t=ir/2;return ir=new n.ph,t}};function sr(){or.point=lr}function lr(t,e){or.point=cr,tr=rr=t,er=nr=e}function cr(t,e){ar.add(nr*t-rr*e),rr=t,nr=e}function ur(){cr(tr,er)}const hr=or;var fr=1/0,pr=fr,dr=-fr,mr=dr,gr={point:function(t,e){tdr&&(dr=t);emr&&(mr=e)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E,result:function(){var t=[[fr,pr],[dr,mr]];return dr=mr=-(pr=fr=1/0),t}};const yr=gr;var vr,xr,_r,br,wr=0,Tr=0,kr=0,Ar=0,Mr=0,Sr=0,Er=0,Cr=0,Ir=0,Lr={point:Pr,lineStart:zr,lineEnd:Rr,polygonStart:function(){Lr.lineStart=Fr,Lr.lineEnd=jr},polygonEnd:function(){Lr.point=Pr,Lr.lineStart=zr,Lr.lineEnd=Rr},result:function(){var t=Ir?[Er/Ir,Cr/Ir]:Sr?[Ar/Sr,Mr/Sr]:kr?[wr/kr,Tr/kr]:[NaN,NaN];return wr=Tr=kr=Ar=Mr=Sr=Er=Cr=Ir=0,t}};function Pr(t,e){wr+=t,Tr+=e,++kr}function zr(){Lr.point=Dr}function Dr(t,e){Lr.point=Or,Pr(_r=t,br=e)}function Or(t,e){var r=t-_r,n=e-br,i=T(r*r+n*n);Ar+=i*(_r+t)/2,Mr+=i*(br+e)/2,Sr+=i,Pr(_r=t,br=e)}function Rr(){Lr.point=Pr}function Fr(){Lr.point=Br}function jr(){Nr(vr,xr)}function Br(t,e){Lr.point=Nr,Pr(vr=_r=t,xr=br=e)}function Nr(t,e){var r=t-_r,n=e-br,i=T(r*r+n*n);Ar+=i*(_r+t)/2,Mr+=i*(br+e)/2,Sr+=i,Er+=(i=br*t-_r*e)*(_r+t),Cr+=i*(br+e),Ir+=3*i,Pr(_r=t,br=e)}const Ur=Lr;function Vr(t){this._context=t}Vr.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,c)}},result:E};var qr,Hr,Gr,Zr,Wr,Yr=new n.ph,Xr={point:E,lineStart:function(){Xr.point=$r},lineEnd:function(){qr&&Kr(Hr,Gr),Xr.point=E},polygonStart:function(){qr=!0},polygonEnd:function(){qr=null},result:function(){var t=+Yr;return Yr=new n.ph,t}};function $r(t,e){Xr.point=Kr,Hr=Zr=t,Gr=Wr=e}function Kr(t,e){Zr-=t,Wr-=e,Yr.add(T(Zr*Zr+Wr*Wr)),Zr=t,Wr=e}const Jr=Xr;let Qr,tn,en,rn;class nn{constructor(t){this._append=null==t?an:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return an;if(e!==Qr){const t=10**e;Qr=e,tn=function(e){let r=1;this._+=e[0];for(const n=e.length;r=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(n=new nn(i)),o},o.projection(t).digits(i).context(e)}function sn(t){return{stream:ln(t)}}function ln(t){return function(e){var r=new cn;for(var n in t)r[n]=t[n];return r.stream=e,r}}function cn(){}function un(t,e,r){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),D(r,t.stream(yr)),e(yr.result()),null!=n&&t.clipExtent(n),t}function hn(t,e,r){return un(t,(function(r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+e[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+e[0][1]+(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])}),r)}function fn(t,e,r){return hn(t,[[0,0],e],r)}function pn(t,e,r){return un(t,(function(r){var n=+e,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];t.scale(150*i).translate([a,o])}),r)}function dn(t,e,r){return un(t,(function(r){var n=+e,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;t.scale(150*i).translate([a,o])}),r)}cn.prototype={constructor:cn,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var mn=16,gn=m(30*h);function yn(t,e){return+e?function(t,e){function r(n,a,o,s,l,c,u,h,p,m,g,y,v,x){var _=u-n,b=h-a,w=_*_+b*b;if(w>4*e&&v--){var k=s+m,A=l+g,S=c+y,E=T(k*k+A*A+S*S),C=M(S/=E),I=f(f(S)-1)e||f((_*D+b*O)/w-.5)>.3||s*m+l*g+c*y2?t[2]%360*h:0,P()):[v*u,x*u,_*u]},I.angle=function(t){return arguments.length?(b=t%360*h,P()):b*u},I.reflectX=function(t){return arguments.length?(w=t?-1:1,P()):w<0},I.reflectY=function(t){return arguments.length?(k=t?-1:1,P()):k<0},I.precision=function(t){return arguments.length?(o=yn(s,C=t*t),z()):T(C)},I.fitExtent=function(t,e){return hn(I,t,e)},I.fitSize=function(t,e){return fn(I,t,e)},I.fitWidth=function(t,e){return pn(I,t,e)},I.fitHeight=function(t,e){return dn(I,t,e)},function(){return e=t.apply(this,arguments),I.invert=e.invert&&L,P()}}function wn(t){var e=0,r=o/3,n=bn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*h,r=t[1]*h):[e*u,r*u]},i}function Tn(t,e){var r=b(t),n=(r+b(e))/2;if(f(n)=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(t)},h.stream=function(r){return t&&e===r?t:(n=[s.stream(e=r),l.stream(r),c.stream(r)],i=n.length,t={point:function(t,e){for(var r=-1;++r0?e<-s+i&&(e=-s+i):e>s-i&&(e=s-i);var r=a/_(Rn(e),n);return[r*b(n*t),a-r*m(n*t)]}return l.invert=function(t,e){var r=a-e,i=w(n)*T(t*t+r*r),l=d(t,f(r))*w(r);return r*n<0&&(l-=o*w(t)*w(r)),[l/n,2*p(_(a/i,1/n))-s]},l}function jn(){return wn(Fn).scale(109.5).parallels([30,30])}function Bn(t,e){return[t,e]}function Nn(){return _n(Bn).scale(152.63)}function Un(t,e){var r=m(t),n=t===e?b(t):(r-m(e))/(e-t),a=r/n+t;if(f(n)2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)}Yn.invert=function(t,e){for(var r,n=e,i=n*n,o=i*i*i,s=0;s<12&&(o=(i=(n-=r=(n*(qn+Hn*i+o*(Gn+Zn*i))-e)/(qn+3*Hn*i+o*(7*Gn+9*Zn*i)))*n)*i*i,!(f(r)i&&--a>0);return[t/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]},ei.invert=En(M),ni.invert=En((function(t){return 2*p(t)})),ai.invert=function(t,e){return[-e,2*p(y(t))-s]}},66:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Path:()=>n.wA,path:()=>n.Ae,pathRound:()=>n.uj});var n=r(83)},83:(t,e,r)=>{"use strict";r.d(e,{Ae:()=>c,uj:()=>u,wA:()=>l});const n=Math.PI,i=2*n,a=1e-6,o=i-a;function s(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return s;const r=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;ea)if(Math.abs(f*c-u*h)>a&&o){let d=r-s,m=i-l,g=c*c+u*u,y=d*d+m*m,v=Math.sqrt(g),x=Math.sqrt(p),_=o*Math.tan((n-Math.acos((g+p-y)/(2*v*x)))/2),b=_/x,w=_/v;Math.abs(b-1)>a&&this._append`L${t+b*h},${e+b*f}`,this._append`A${o},${o},0,0,${+(f*d>h*m)},${this._x1=t+w*c},${this._y1=e+w*u}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,r,s,l,c){if(t=+t,e=+e,c=!!c,(r=+r)<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(s),h=r*Math.sin(s),f=t+u,p=e+h,d=1^c,m=c?s-l:l-s;null===this._x1?this._append`M${f},${p}`:(Math.abs(this._x1-f)>a||Math.abs(this._y1-p)>a)&&this._append`L${f},${p}`,r&&(m<0&&(m=m%i+i),m>o?this._append`A${r},${r},0,1,${d},${t-u},${e-h}A${r},${r},0,1,${d},${this._x1=f},${this._y1=p}`:m>a&&this._append`A${r},${r},0,${+(m>=n)},${d},${this._x1=t+r*Math.cos(l)},${this._y1=e+r*Math.sin(l)}`)}rect(t,e,r,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}}function c(){return new l}function u(t=3){return new l(+t)}c.prototype=l.prototype},395:(t,e,r)=>{"use strict";function n(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,c,u,h,f,p=t._root,d={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=p,!(p=p[h=u<<1|c]))return i[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&r===l)return d.next=p,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=p,i[h]=d,t}function i(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function a(t){return t[0]}function o(t){return t[1]}function s(t,e,r){var n=new l(null==e?a:e,null==r?o:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function l(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function c(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}r.r(e),r.d(e,{quadtree:()=>s});var u=s.prototype=l.prototype;u.copy=function(){var t,e,r=new l(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=c(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=c(e));return r},u.add=function(t){const e=+this._x.call(null,t),r=+this._y.call(null,t);return n(this.cover(e,r),e,r,t)},u.addAll=function(t){var e,r,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(r=0;rh&&(h=i),af&&(f=a));if(c>h||u>f)return this;for(this.cover(c,u).cover(h,f),r=0;rt||t>=i||n>e||e>=a;)switch(s=(ep||(o=c.y0)>d||(s=c.x1)=v)<<1|t>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=x*x+_*_;if(b=(s=(d+g)/2))?d=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[f]=p:this._root=p),this):(this._root=i,this)},u.removeAll=function(t){for(var e=0,r=t.length;e{"use strict";function n(t){return function(){return t}}r.r(e),r.d(e,{arc:()=>k,area:()=>P,areaRadial:()=>U,curveBasis:()=>Lt,curveBasisClosed:()=>zt,curveBasisOpen:()=>Ot,curveBumpX:()=>G,curveBumpY:()=>Z,curveBundle:()=>Ft,curveCardinal:()=>Nt,curveCardinalClosed:()=>Vt,curveCardinalOpen:()=>Ht,curveCatmullRom:()=>Wt,curveCatmullRomClosed:()=>Xt,curveCatmullRomOpen:()=>Kt,curveLinear:()=>E,curveLinearClosed:()=>Qt,curveMonotoneX:()=>se,curveMonotoneY:()=>le,curveNatural:()=>he,curveStep:()=>pe,curveStepAfter:()=>me,curveStepBefore:()=>de,line:()=>L,lineRadial:()=>N,link:()=>$,linkHorizontal:()=>K,linkRadial:()=>Q,linkVertical:()=>J,pie:()=>O,pointRadial:()=>V,radialArea:()=>U,radialLine:()=>N,stack:()=>_e,stackOffsetDiverging:()=>we,stackOffsetExpand:()=>be,stackOffsetNone:()=>ge,stackOffsetSilhouette:()=>Te,stackOffsetWiggle:()=>ke,stackOrderAppearance:()=>Ae,stackOrderAscending:()=>Se,stackOrderDescending:()=>Ce,stackOrderInsideOut:()=>Ie,stackOrderNone:()=>ye,stackOrderReverse:()=>Le,symbol:()=>St,symbolAsterisk:()=>et,symbolCircle:()=>rt,symbolCross:()=>nt,symbolDiamond:()=>ot,symbolDiamond2:()=>st,symbolPlus:()=>lt,symbolSquare:()=>ct,symbolSquare2:()=>ut,symbolStar:()=>dt,symbolTimes:()=>kt,symbolTriangle:()=>gt,symbolTriangle2:()=>vt,symbolWye:()=>Tt,symbolX:()=>kt,symbols:()=>At,symbolsFill:()=>At,symbolsStroke:()=>Mt});const i=Math.abs,a=Math.atan2,o=Math.cos,s=Math.max,l=Math.min,c=Math.sin,u=Math.sqrt,h=1e-12,f=Math.PI,p=f/2,d=2*f;function m(t){return t>=1?p:t<=-1?-p:Math.asin(t)}var g=r(83);function y(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{const t=Math.floor(r);if(!(t>=0))throw new RangeError(`invalid digits: ${r}`);e=t}return t},()=>new g.wA(e)}function v(t){return t.innerRadius}function x(t){return t.outerRadius}function _(t){return t.startAngle}function b(t){return t.endAngle}function w(t){return t&&t.padAngle}function T(t,e,r,n,i,a,o){var l=t-r,c=e-n,h=(o?a:-a)/u(l*l+c*c),f=h*c,p=-h*l,d=t+f,m=e+p,g=r+f,y=n+p,v=(d+g)/2,x=(m+y)/2,_=g-d,b=y-m,w=_*_+b*b,T=i-a,k=d*y-g*m,A=(b<0?-1:1)*u(s(0,T*T*w-k*k)),M=(k*b-_*A)/w,S=(-k*_-b*A)/w,E=(k*b+_*A)/w,C=(-k*_+b*A)/w,I=M-v,L=S-x,P=E-v,z=C-x;return I*I+L*L>P*P+z*z&&(M=E,S=C),{cx:M,cy:S,x01:-f,y01:-p,x11:M*(i/T-1),y11:S*(i/T-1)}}function k(){var t=v,e=x,r=n(0),s=null,g=_,k=b,A=w,M=null,S=y(E);function E(){var n,y,v,x=+t.apply(this,arguments),_=+e.apply(this,arguments),b=g.apply(this,arguments)-p,w=k.apply(this,arguments)-p,E=i(w-b),C=w>b;if(M||(M=n=S()),_h)if(E>d-h)M.moveTo(_*o(b),_*c(b)),M.arc(0,0,_,b,w,!C),x>h&&(M.moveTo(x*o(w),x*c(w)),M.arc(0,0,x,w,b,C));else{var I,L,P=b,z=w,D=b,O=w,R=E,F=E,j=A.apply(this,arguments)/2,B=j>h&&(s?+s.apply(this,arguments):u(x*x+_*_)),N=l(i(_-x)/2,+r.apply(this,arguments)),U=N,V=N;if(B>h){var q=m(B/x*c(j)),H=m(B/_*c(j));(R-=2*q)>h?(D+=q*=C?1:-1,O-=q):(R=0,D=O=(b+w)/2),(F-=2*H)>h?(P+=H*=C?1:-1,z-=H):(F=0,P=z=(b+w)/2)}var G=_*o(P),Z=_*c(P),W=x*o(O),Y=x*c(O);if(N>h){var X,$=_*o(z),K=_*c(z),J=x*o(D),Q=x*c(D);if(E1?0:v<-1?f:Math.acos(v))/2),at=u(X[0]*X[0]+X[1]*X[1]);U=l(N,(x-at)/(it-1)),V=l(N,(_-at)/(it+1))}else U=V=0}F>h?V>h?(I=T(J,Q,G,Z,_,V,C),L=T($,K,W,Y,_,V,C),M.moveTo(I.cx+I.x01,I.cy+I.y01),Vh&&R>h?U>h?(I=T(W,Y,$,K,x,-U,C),L=T(G,Z,J,Q,x,-U,C),M.lineTo(I.cx+I.x01,I.cy+I.y01),U=h;--f)l.point(y[f],v[f]);l.lineEnd(),l.areaEnd()}g&&(y[u]=+t(p,u,n),v[u]=+e(p,u,n),l.point(i?+i(p,u,n):y[u],r?+r(p,u,n):v[u]))}if(d)return l=null,d+""||null}function h(){return L().defined(a).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?C:n(+t),e="function"==typeof e?e:n(void 0===e?0:+e),r="function"==typeof r?r:void 0===r?I:n(+r),u.x=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),i=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),u):t},u.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:n(+t),u):i},u.y=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),r=null,u):e},u.y0=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),u):e},u.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:n(+t),u):r},u.lineX0=u.lineY0=function(){return h().x(t).y(e)},u.lineY1=function(){return h().x(t).y(r)},u.lineX1=function(){return h().x(i).y(e)},u.defined=function(t){return arguments.length?(a="function"==typeof t?t:n(!!t),u):a},u.curve=function(t){return arguments.length?(s=t,null!=o&&(l=s(o)),u):s},u.context=function(t){return arguments.length?(null==t?o=l=null:l=s(o=t),u):o},u}function z(t,e){return et?1:e>=t?0:NaN}function D(t){return t}function O(){var t=D,e=z,r=null,i=n(0),a=n(d),o=n(0);function s(n){var s,l,c,u,h,f=(n=M(n)).length,p=0,m=new Array(f),g=new Array(f),y=+i.apply(this,arguments),v=Math.min(d,Math.max(-d,a.apply(this,arguments)-y)),x=Math.min(Math.abs(v)/f,o.apply(this,arguments)),_=x*(v<0?-1:1);for(s=0;s0&&(p+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=r&&m.sort((function(t,e){return r(n[t],n[e])})),s=0,c=p?(v-f*_)/p:0;s0?h*c:0)+_,g[l]={data:n[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:n(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,r=null,s):e},s.sort=function(t){return arguments.length?(r=t,e=null,s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:n(+t),s):a},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),s):o},s}S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var R=j(E);function F(t){this._curve=t}function j(t){function e(e){return new F(t(e))}return e._curve=t,e}function B(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(j(t)):e()._curve},t}function N(){return B(L().curve(R))}function U(){var t=P().curve(R),e=t.curve,r=t.lineX0,n=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return B(r())},delete t.lineX0,t.lineEndAngle=function(){return B(n())},delete t.lineX1,t.lineInnerRadius=function(){return B(i())},delete t.lineY0,t.lineOuterRadius=function(){return B(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(j(t)):e()._curve},t}function V(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}F.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};class q{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}class H{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,e){if(t=+t,e=+e,0===this._point)this._point=1;else{const r=V(this._x0,this._y0),n=V(this._x0,this._y0=(this._y0+e)/2),i=V(t,this._y0),a=V(t,e);this._context.moveTo(...r),this._context.bezierCurveTo(...n,...i,...a)}this._x0=t,this._y0=e}}function G(t){return new q(t,!0)}function Z(t){return new q(t,!1)}function W(t){return new H(t)}function Y(t){return t.source}function X(t){return t.target}function $(t){let e=Y,r=X,i=C,a=I,o=null,s=null,l=y(c);function c(){let n;const c=A.call(arguments),u=e.apply(this,c),h=r.apply(this,c);if(null==o&&(s=t(n=l())),s.lineStart(),c[0]=u,s.point(+i.apply(this,c),+a.apply(this,c)),c[0]=h,s.point(+i.apply(this,c),+a.apply(this,c)),s.lineEnd(),n)return s=null,n+""||null}return c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(r=t,c):r},c.x=function(t){return arguments.length?(i="function"==typeof t?t:n(+t),c):i},c.y=function(t){return arguments.length?(a="function"==typeof t?t:n(+t),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=t(o=e),c):o},c}function K(){return $(G)}function J(){return $(Z)}function Q(){const t=$(W);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const tt=u(3),et={draw(t,e){const r=.59436*u(e+l(e/28,.75)),n=r/2,i=n*tt;t.moveTo(0,r),t.lineTo(0,-r),t.moveTo(-i,-n),t.lineTo(i,n),t.moveTo(-i,n),t.lineTo(i,-n)}},rt={draw(t,e){const r=u(e/f);t.moveTo(r,0),t.arc(0,0,r,0,d)}},nt={draw(t,e){const r=u(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},it=u(1/3),at=2*it,ot={draw(t,e){const r=u(e/at),n=r*it;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},st={draw(t,e){const r=.62625*u(e);t.moveTo(0,-r),t.lineTo(r,0),t.lineTo(0,r),t.lineTo(-r,0),t.closePath()}},lt={draw(t,e){const r=.87559*u(e-l(e/7,2));t.moveTo(-r,0),t.lineTo(r,0),t.moveTo(0,r),t.lineTo(0,-r)}},ct={draw(t,e){const r=u(e),n=-r/2;t.rect(n,n,r,r)}},ut={draw(t,e){const r=.4431*u(e);t.moveTo(r,r),t.lineTo(r,-r),t.lineTo(-r,-r),t.lineTo(-r,r),t.closePath()}},ht=c(f/10)/c(7*f/10),ft=c(d/10)*ht,pt=-o(d/10)*ht,dt={draw(t,e){const r=u(.8908130915292852*e),n=ft*r,i=pt*r;t.moveTo(0,-r),t.lineTo(n,i);for(let e=1;e<5;++e){const a=d*e/5,s=o(a),l=c(a);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},mt=u(3),gt={draw(t,e){const r=-u(e/(3*mt));t.moveTo(0,2*r),t.lineTo(-mt*r,-r),t.lineTo(mt*r,-r),t.closePath()}},yt=u(3),vt={draw(t,e){const r=.6824*u(e),n=r/2,i=r*yt/2;t.moveTo(0,-r),t.lineTo(i,n),t.lineTo(-i,n),t.closePath()}},xt=-.5,_t=u(3)/2,bt=1/u(12),wt=3*(bt/2+1),Tt={draw(t,e){const r=u(e/wt),n=r/2,i=r*bt,a=n,o=r*bt+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(xt*n-_t*i,_t*n+xt*i),t.lineTo(xt*a-_t*o,_t*a+xt*o),t.lineTo(xt*s-_t*l,_t*s+xt*l),t.lineTo(xt*n+_t*i,xt*i-_t*n),t.lineTo(xt*a+_t*o,xt*o-_t*a),t.lineTo(xt*s+_t*l,xt*l-_t*s),t.closePath()}},kt={draw(t,e){const r=.6189*u(e-l(e/6,1.7));t.moveTo(-r,-r),t.lineTo(r,r),t.moveTo(-r,r),t.lineTo(r,-r)}},At=[rt,nt,ot,ct,dt,gt,Tt],Mt=[rt,lt,kt,vt,et,ut,st];function St(t,e){let r=null,i=y(a);function a(){let n;if(r||(r=n=i()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),n)return r=null,n+""||null}return t="function"==typeof t?t:n(t||rt),e="function"==typeof e?e:n(void 0===e?64:+e),a.type=function(e){return arguments.length?(t="function"==typeof e?e:n(e),a):t},a.size=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),a):e},a.context=function(t){return arguments.length?(r=null==t?null:t,a):r},a}function Et(){}function Ct(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function It(t){this._context=t}function Lt(t){return new It(t)}function Pt(t){this._context=t}function zt(t){return new Pt(t)}function Dt(t){this._context=t}function Ot(t){return new Dt(t)}function Rt(t,e){this._basis=new It(t),this._beta=e}It.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Pt.prototype={areaStart:Et,areaEnd:Et,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Dt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ct(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Rt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],o=t[r]-i,s=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*o),this._beta*e[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Ft=function t(e){function r(t){return 1===e?new It(t):new Rt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function jt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Bt(t,e){this._context=t,this._k=(1-e)/6}Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:jt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Nt=function t(e){function r(t){return new Bt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Ut(t,e){this._context=t,this._k=(1-e)/6}Ut.prototype={areaStart:Et,areaEnd:Et,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:jt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Vt=function t(e){function r(t){return new Ut(t,e)}return r.tension=function(e){return t(+e)},r}(0);function qt(t,e){this._context=t,this._k=(1-e)/6}qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ht=function t(e){function r(t){return new qt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Gt(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>h){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>h){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function Zt(t,e){this._context=t,this._alpha=e}Zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Gt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Wt=function t(e){function r(t){return e?new Zt(t,e):new Bt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Yt(t,e){this._context=t,this._alpha=e}Yt.prototype={areaStart:Et,areaEnd:Et,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Gt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xt=function t(e){function r(t){return e?new Yt(t,e):new Ut(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function $t(t,e){this._context=t,this._alpha=e}$t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Gt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Kt=function t(e){function r(t){return e?new $t(t,e):new qt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Jt(t){this._context=t}function Qt(t){return new Jt(t)}function te(t){return t<0?-1:1}function ee(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(te(a)+te(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function re(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function ne(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function ie(t){this._context=t}function ae(t){this._context=new oe(t)}function oe(t){this._context=t}function se(t){return new ie(t)}function le(t){return new ae(t)}function ce(t){this._context=t}function ue(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e1)for(var r,n,i,a=1,o=t[e[0]],s=o.length;a=0;)r[e]=e;return r}function ve(t,e){return t[e]}function xe(t){const e=[];return e.key=t,e}function _e(){var t=n([]),e=ye,r=ge,i=ve;function a(n){var a,o,s=Array.from(t.apply(this,arguments),xe),l=s.length,c=-1;for(const t of n)for(a=0,++c;a0){for(var r,n,i,a=0,o=t[0].length;a0)for(var r,n,i,a,o,s,l=0,c=t[e[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)}function Te(t,e){if((r=t.length)>0){for(var r,n=0,i=t[e[0]],a=i.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,i,a=0,o=1;oa&&(a=e,n=r);return n}function Se(t){var e=t.map(Ee);return ye(t).sort((function(t,r){return e[t]-e[r]}))}function Ee(t){for(var e,r=0,n=-1,i=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}}},552:(t,e,r)=>{"use strict";r.r(e),r.d(e,{timeDay:()=>A,timeDays:()=>M,timeFriday:()=>F,timeFridays:()=>H,timeHour:()=>b,timeHours:()=>w,timeInterval:()=>a,timeMillisecond:()=>o,timeMilliseconds:()=>s,timeMinute:()=>y,timeMinutes:()=>v,timeMonday:()=>z,timeMondays:()=>N,timeMonth:()=>st,timeMonths:()=>lt,timeSaturday:()=>j,timeSaturdays:()=>G,timeSecond:()=>m,timeSeconds:()=>g,timeSunday:()=>P,timeSundays:()=>B,timeThursday:()=>R,timeThursdays:()=>q,timeTickInterval:()=>bt,timeTicks:()=>_t,timeTuesday:()=>D,timeTuesdays:()=>U,timeWednesday:()=>O,timeWednesdays:()=>V,timeWeek:()=>P,timeWeeks:()=>B,timeYear:()=>ht,timeYears:()=>ft,unixDay:()=>C,unixDays:()=>I,utcDay:()=>S,utcDays:()=>E,utcFriday:()=>J,utcFridays:()=>at,utcHour:()=>T,utcHours:()=>k,utcMillisecond:()=>o,utcMilliseconds:()=>s,utcMinute:()=>x,utcMinutes:()=>_,utcMonday:()=>Y,utcMondays:()=>et,utcMonth:()=>ct,utcMonths:()=>ut,utcSaturday:()=>Q,utcSaturdays:()=>ot,utcSecond:()=>m,utcSeconds:()=>g,utcSunday:()=>W,utcSundays:()=>tt,utcThursday:()=>K,utcThursdays:()=>it,utcTickInterval:()=>xt,utcTicks:()=>vt,utcTuesday:()=>X,utcTuesdays:()=>rt,utcWednesday:()=>$,utcWednesdays:()=>nt,utcWeek:()=>W,utcWeeks:()=>tt,utcYear:()=>pt,utcYears:()=>dt});const n=new Date,i=new Date;function a(t,e,r,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=e=>(t(e=new Date(+e)),e),s.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),s.round=t=>{const e=s(t),r=s.ceil(t);return t-e(e(t=new Date(+t),null==r?1:Math.floor(r)),t),s.range=(r,n,i)=>{const a=[];if(r=s.ceil(r),i=null==i?1:Math.floor(i),!(r0))return a;let o;do{a.push(o=new Date(+r)),e(r,i),t(r)}while(oa((e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),((t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););})),r&&(s.count=(e,a)=>(n.setTime(+e),i.setTime(+a),t(n),t(i),Math.floor(r(n,i))),s.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?e=>o(e)%t==0:e=>s.count(0,e)%t==0):s:null)),s}const o=a((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));o.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?a((e=>{e.setTime(Math.floor(e/t)*t)}),((e,r)=>{e.setTime(+e+r*t)}),((e,r)=>(r-e)/t)):o:null);const s=o.range,l=1e3,c=6e4,u=36e5,h=864e5,f=6048e5,p=2592e6,d=31536e6,m=a((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*l)}),((t,e)=>(e-t)/l),(t=>t.getUTCSeconds())),g=m.range,y=a((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*l)}),((t,e)=>{t.setTime(+t+e*c)}),((t,e)=>(e-t)/c),(t=>t.getMinutes())),v=y.range,x=a((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*c)}),((t,e)=>(e-t)/c),(t=>t.getUTCMinutes())),_=x.range,b=a((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*l-t.getMinutes()*c)}),((t,e)=>{t.setTime(+t+e*u)}),((t,e)=>(e-t)/u),(t=>t.getHours())),w=b.range,T=a((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*u)}),((t,e)=>(e-t)/u),(t=>t.getUTCHours())),k=T.range,A=a((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*c)/h),(t=>t.getDate()-1)),M=A.range,S=a((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/h),(t=>t.getUTCDate()-1)),E=S.range,C=a((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/h),(t=>Math.floor(t/h))),I=C.range;function L(t){return a((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*c)/f))}const P=L(0),z=L(1),D=L(2),O=L(3),R=L(4),F=L(5),j=L(6),B=P.range,N=z.range,U=D.range,V=O.range,q=R.range,H=F.range,G=j.range;function Z(t){return a((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/f))}const W=Z(0),Y=Z(1),X=Z(2),$=Z(3),K=Z(4),J=Z(5),Q=Z(6),tt=W.range,et=Y.range,rt=X.range,nt=$.range,it=K.range,at=J.range,ot=Q.range,st=a((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),lt=st.range,ct=a((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth())),ut=ct.range,ht=a((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));ht.every=t=>isFinite(t=Math.floor(t))&&t>0?a((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,r)=>{e.setFullYear(e.getFullYear()+r*t)})):null;const ft=ht.range,pt=a((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));pt.every=t=>isFinite(t=Math.floor(t))&&t>0?a((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null;const dt=pt.range;var mt=r(37),gt=r(946);function yt(t,e,r,n,i,a){const s=[[m,1,l],[m,5,5e3],[m,15,15e3],[m,30,3e4],[a,1,c],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,u],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,h],[n,2,1728e5],[r,1,f],[e,1,p],[e,3,7776e6],[t,1,d]];function g(e,r,n){const i=Math.abs(r-e)/n,a=(0,mt.A)((([,,t])=>t)).right(s,i);if(a===s.length)return t.every((0,gt.sG)(e/d,r/d,n));if(0===a)return o.every(Math.max((0,gt.sG)(e,r,n),1));const[l,c]=s[i/s[a-1][2]{"use strict";r.r(e),r.d(e,{interval:()=>w,now:()=>p,timeout:()=>b,timer:()=>g,timerFlush:()=>y});var n,i,a=0,o=0,s=0,l=0,c=0,u=0,h="object"==typeof performance&&performance.now?performance:Date,f="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function p(){return c||(f(d),c=h.now()+u)}function d(){c=0}function m(){this._call=this._time=this._next=null}function g(t,e,r){var n=new m;return n.restart(t,e,r),n}function y(){p(),++a;for(var t,e=n;e;)(t=c-e._time)>=0&&e._call.call(void 0,t),e=e._next;--a}function v(){c=(l=h.now())+u,a=o=0;try{y()}finally{a=0,function(){var t,e,r=n,a=1/0;for(;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:n=e);i=t,_(a)}(),c=0}}function x(){var t=h.now(),e=t-l;e>1e3&&(u-=e,l=t)}function _(t){a||(o&&(o=clearTimeout(o)),t-c>24?(t<1/0&&(o=setTimeout(v,t-h.now()-u)),s&&(s=clearInterval(s))):(s||(l=h.now(),s=setInterval(x,1e3)),a=1,f(v)))}function b(t,e,r){var n=new m;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}function w(t,e,r){var n=new m,i=e;return null==e?(n.restart(t,e,r),n):(n._restart=n.restart,n.restart=function(t,e,r){e=+e,r=null==r?p():+r,n._restart((function a(o){o+=i,n._restart(a,i+=e,r),t(o)}),e,r)},n.restart(t,e,r),n)}m.prototype=g.prototype={constructor:m,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?p():+r)+(null==e?0:+e),this._next||i===this||(i?i._next=this:n=this,i=this),this._call=t,this._time=r,_()},stop:function(){this._call&&(this._call=null,this._time=1/0,_())}}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t=r(647),e=r.n(t),n=r(453),i=r.n(n),a=r(653),o=r.n(a);function s(t,e){let r;return function(...n){const i=this;clearTimeout(r),r=setTimeout((()=>t.apply(i,n)),e)}}function l(t){return Math.round(t.getTime()/1e3)}function c(t){return new Date(1e3*t)}function u(t,e){const r=document.getElementById("notifications"),n=document.getElementById("notification-template").content.cloneNode(!0).firstElementChild,i=n.querySelector(".btn-close");let a="";"info"===t?(n.classList.add("bg-primary","text-white"),i.classList.add("btn-close-white"),a="fa-circle-info"):"success"===t?(n.classList.add("bg-success","text-white"),i.classList.add("btn-close-white"),a="fa-circle-check"):"warning"===t?(n.classList.add("bg-warning","text-body"),a="fa-circle-exclamation"):"error"===t?(n.classList.add("bg-danger","text-white"),i.classList.add("btn-close-white"),a="fa-circle-exclamation"):(n.classList.add("bg-secondary","text-white"),i.classList.add("btn-close-white"),a="fa-comment"),n.querySelector(".toast-body").innerHTML=` `+e,r.appendChild(n);new(o())(n,{autohide:!0,delay:1e4}).show(),n.addEventListener("hidden.bs.toast",(()=>{n.remove()}))}const h="varnishmon.",f=`${h}time-range-from`,p=`${h}time-range-to`,d=["now-1h","now"];function m(t=!1){if(!t){const t=g(f),e=g(p);if(null!=t&&null!=e)return[t,e]}return varnishmon.config.scraper.enabled?d:[c(varnishmon.storage.earliest),c(varnishmon.storage.latest)]}function g(t){try{let e=localStorage.getItem(t);if(null!=e)return e}catch(e){console.error(`Failed to read '${t}' from local storage!`,e)}return null}function y(t,e){e instanceof Date&&(e=e.toISOString());try{localStorage.setItem(t,e)}catch(e){console.error(`Failed to write '${t}' to local storage!`,e)}}const v=`${h}refresh-interval`,x=[[-1,"auto"],[0,"disabled"],[1,"1s"],[2,"2s"],[3,"3s"],[4,"4s"],[5,"5s"],[10,"10s"],[15,"15s"],[30,"30s"],[60,"1m"]];function _(t){return Number.isInteger(t)&&x.map((t=>t[0])).includes(t)}const b=`${h}filter`,w=`${h}filter-history`;function T(){try{let t=localStorage.getItem(w);if(null!=t)return JSON.parse(t)}catch(t){console.error(`Failed to read '${w}' from local storage!`,t)}return[]}const k=`${h}verbosity`,A=["normal","debug"];function M(t){return A.includes(t)}const S=`${h}columns`,E=[1,2,3,4,6,12];function C(t){return Number.isInteger(t)&&E.includes(t)}const I=`${h}aggregator`,L=["avg","min","max","first","last","count"];function P(t){return L.includes(t)}const z=`${h}step`;function D(){return varnishmon.config.scraper.enabled?varnishmon.config.scraper.period:1}function O(t){return Number.isInteger(t)&&t>=D()}const R=[/^MGT[.](?!(?:uptime)$)/,new RegExp("MAIN[.](?!(?:"+["backend_busy","backend_conn","backend_fail","backend_recycle","backend_req","backend_retry","backend_reuse","backend_unhealthy","backend_wait_fail","backend_wait","bans_lurker_obj_killed_cutoff","bans_lurker_obj_killed","bans_obj_killed","bans","bgfetch_no_thread","busy_killed","busy_sleep","busy_wakeup","c_ykey_purges","cache_hit_grace","cache_hit","cache_hitmiss","cache_hitpass","cache_miss","client_req_400","client_req_417","client_req","client_resp_500","esi_errors","esi_maxdepth","esi_req","esi_warnings","fetch_1xx","fetch_204","fetch_304","fetch_bad","fetch_chunked","fetch_eof","fetch_failed","fetch_fast304","fetch_head","fetch_length","fetch_none","fetch_stale_deliver","fetch_stale_rearm","g_mem_file","g_mem_private","g_mem_rss","g_mem_swap","goto_dns_cache_hits","goto_dns_lookup_fails","goto_dns_lookups","losthdr","n_backend","n_expired","n_gunzip","n_gzip","n_lru_limited","n_lru_moved","n_lru_nuked","n_obj_purged","n_object_hitmiss","n_object_hitpass","n_object","n_objectcore","n_objecthead","n_purges","n_test_gunzip","n_vcl","req_dropped","req_reset","s_fetch","s_pass","s_pipe_hdrbytes","s_pipe_in","s_pipe_out","s_pipe","s_req_bodybytes","s_req_hdrbytes","s_resp_bodybytes","s_resp_hdrbytes","s_sess","s_synth","sc_bankrupt","sc_rapid_reset","sc_sock_closed","sc_vcl_failure","sess_closed_err","sess_closed","sess_conn","sess_drop","sess_dropped","sess_fail_ebadf","sess_fail_econnaborted","sess_fail_eintr","sess_fail_emfile","sess_fail_enomem","sess_fail_other","sess_fail","sess_herd","sess_queued","sess_readahead","shm_cont","shm_cycles","shm_flushes","shm_records","thread_queue_len","threads_created","threads_destroyed","threads_failed","threads_limited","threads","uptime","vcl_fail","vmods","ws_backend_overflow","ws_client_overflow","ws_session_overflow","ws_thread_overflow"].join("|")+")$)"),new RegExp("MSE[.](?!.*[.](?:"+["c_fail","c_memcache_hit","c_memcache_miss","c_ykey_purged","g_bytes","g_space","g_sparenode","g_ykey_keys","n_lru_moved","n_lru_nuked","n_vary"].join("|")+")$)"),new RegExp("MSE_BOOK[.](?!.*[.](?:"+["c_insert_timeout","c_waterlevel_purge","c_waterlevel_queue","c_waterlevel_runs","g_banlist_bytes","g_banlist_space","g_bytes","g_space","n_vary"].join("|")+")$)"),new RegExp("MSE_STORE[.](?!.*[.](?:"+["c_aio_finished_bytes_read","c_aio_finished_bytes_write","c_aio_finished_read","c_aio_finished_write","c_waterlevel_purge","c_waterlevel_queue","g_alloc_bytes","g_free_bytes","g_objects","g_ykey_keys"].join("|")+")$)"),new RegExp("MSE4[.](?!(?:"+["g_varyspec","g_ykey_keys","c_ykey_purged"].join("|")+")$)"),new RegExp("MSE4_MEM[.](?!(?:"+["c_allocation","c_allocation_buffer","c_allocation_ephemeral","c_allocation_failure","c_allocation_pass","c_allocation_persisted","c_allocation_reqbody","c_allocation_synthetic","c_eviction","c_eviction_failure","c_eviction_reorder","c_free","c_free_buffer","c_free_ephemeral","c_free_pass","c_free_persisted","c_free_reqbody","c_free_synthetic","c_memcache_hit","c_memcache_miss","g_allocations","g_bytes","g_bytes_buffer","g_bytes_ephemeral","g_bytes_pass","g_bytes_persisted","g_bytes_reqbody","g_bytes_synthetic","g_objects","g_objects_ephemeral","g_objects_pass","g_objects_persisted","g_objects_reqbody","g_objects_synthetic","g_space"].join("|")+")$)"),new RegExp("MSE4_BOOK[.](?!.*[.](?:"+["c_freeslot_queued","c_submitslot_queued","c_ykey_purged","g_freeslot_queue","g_objects","g_slots_unused","g_slots_used","g_submitslot_queue","g_unreachable_objects","g_varyspec","g_ykey_keys","online"].join("|")+")$)"),new RegExp("MSE4_STORE[.](?!.*[.](?:"+["online","g_bytes_used","g_bytes_unused","g_objects","g_allocation_queue","c_allocation_queued","g_io_queued","g_io_queued_read","g_io_queued_write","c_io_finished_read","c_io_finished_write","c_io_finished_bytes_read","c_io_finished_bytes_write","g_io_blocked_read","g_io_blocked_write","c_io_limited"].join("|")+")$)"),new RegExp("MSE4_BANJRN[.](?!.*[.](?:"+["g_ban_bytes","g_bans","g_bytes","g_overflow_ban_bytes","g_overflow_bans","g_space"].join("|")+")$)"),new RegExp("MSE4_CAT[.](?!.*[.](?:"+["c_allocation","c_allocation_ephemeral","c_allocation_pass","c_allocation_persisted","c_eviction","c_eviction_failure","c_eviction_reorder","c_free","c_free_ephemeral","c_free_pass","c_free_persisted","c_memcache_hit","c_memcache_miss","g_allocations","g_bytes","g_bytes_ephemeral","g_bytes_pass","g_bytes_persisted","g_objects","g_objects_ephemeral","g_objects_pass","g_objects_persisted"].join("|")+")$)"),new RegExp("SMA[.](?!.*[.](?:"+["c_bytes","c_fail","c_freed","c_req","g_alloc","g_bytes","g_space"].join("|")+")$)"),new RegExp("SMF[.](?!.*[.](?:"+["c_bytes","c_fail","c_freed","c_req","g_alloc","g_bytes","g_smf_frag","g_smf_large","g_smf","g_space"].join("|")+")$)"),new RegExp("SMU[.](?!.*[.](?:"+["c_bytes","c_fail","c_freed","c_req","g_alloc","g_bytes","g_space"].join("|")+")$)"),/^BROTLI[.]/,/^SLICER[.]/,new RegExp("VMOD_HTTP[.](?!(?:"+["handle_abandon","handle_completed","handle_internal_error","handle_limited","handle_requests"].join("|")+")$)"),new RegExp("KVSTORE[.](?!.*[.](?:"+[].join("|")+")$)"),new RegExp("ACCG[.](?!.*[.](?:"+["backend_200_count","backend_2xx_count","backend_304_count","backend_3xx_count","backend_404_count","backend_4xx_count","backend_503_count","backend_5xx_count","backend_req_bodybytes","backend_req_count","backend_req_hdrbytes","backend_resp_bodybytes","backend_resp_hdrbytes","client_200_count","client_2xx_count","client_304_count","client_3xx_count","client_404_count","client_4xx_count","client_503_count","client_5xx_count","client_grace_hit_count","client_hit_count","client_hit_req_bodybytes","client_hit_req_hdrbytes","client_hit_resp_bodybytes","client_hit_resp_hdrbytes","client_miss_count","client_miss_req_bodybytes","client_miss_req_hdrbytes","client_miss_resp_bodybytes","client_miss_resp_hdrbytes","client_pass_count","client_pass_req_bodybytes","client_pass_req_hdrbytes","client_pass_resp_bodybytes","client_pass_resp_hdrbytes","client_pipe_count","client_pipe_req_bodybytes","client_pipe_req_hdrbytes","client_pipe_resp_bodybytes","client_pipe_resp_hdrbytes","client_req_bodybytes","client_req_count","client_req_hdrbytes","client_resp_bodybytes","client_resp_hdrbytes","client_synth_count","client_synth_req_bodybytes","client_synth_req_hdrbytes","client_synth_resp_bodybytes","client_synth_resp_hdrbytes"].join("|")+")$)"),new RegExp("ACCG_DIAG[.](?!.*[.](?:"+["bereq_dropped","create_namespace_failure","key_without_namespace","namespace_already_set","namespace_undefined","out_of_key_slots","req_dropped","set_key_failure"].join("|")+")$)"),new RegExp("VBE[.](?!.*[.](?:"+["bereq_bodybytes","bereq_hdrbytes","beresp_bodybytes","beresp_hdrbytes","busy","conn","fail","happy","is_healthy","pipe_hdrbytes","pipe_in","pipe_out","req","unhealthy"].join("|")+")$)"),/^WAITER[.]/,/^MEMPOOL[.]/,/^LCK[.]/],F=[/^(MAIN[.]backend)/,/^(MAIN[.]bans)_?/,/^(MAIN[.]cache)/,/^(MAIN[.]client)/,/^(MAIN[.]esi_)/,/^(MAIN[.]fetch)/,/^(MAIN[.]g_mem)/,/^(MAIN[.]s_)/,/^(MAIN[.]sc_)/,/^(MAIN[.]sess_)/,/^(MAIN[.]shm_)/,/^(MAIN[.]thread)s?_?/,/^(MAIN[.]vgs_)/,/^(MAIN[.]ws_)/,/^(WAITER[.])/,/^(MEMPOOL[.])/,/^(LCK[.])/],j=[/^MGT[.]/,/^MAIN[.][*]$/,/^MAIN[.]/,/^MSE[.]/,/^MSE_/,/^MSE4[.]/,/^MSE4_/,/^SMA[.]/,/^SMF[.]/,/^SMU[.]/,/^BROTLI[.]/,/^SLICER[.]/,/^VMOD_/,/^KVSTORE[.]/,/^ACCG[.]/,/^ACCG_DIAG[.]/,/^VBE[.]/,/^WAITER[.]/,/^MEMPOOL[.]/,/^LCK[.]/];function B(t){t.sort(((t,e)=>t.name.localeCompare(e.name))),function(t){t.forEach((t=>{t.debug=-1!==R.findIndex((e=>e.test(t.name)))}))}(t);const e=function(t){const e={};return t.forEach((t=>{let r="";for(let e of F){const n=t.name.match(e);if(n&&n[1]){r=n[1]+"*";break}}if(""===r){const e=t.name.split(".");e.length>1&&(r=e.slice(0,-1).join(".")+".*")}e[r]||(e[r]=[]),e[r].push(t)})),Object.keys(e).map((t=>({name:t,metrics:e[t]})))}(t);return e.sort(((t,e)=>{const r=j.findIndex((e=>e.test(t.name))),n=j.findIndex((t=>t.test(e.name)));return-1!==r&&-1!==n?r-n:-1!==r?-1:-1!==n?1:t.name.localeCompare(e.name)})),e}function N(t,e){const r=t.sort(((t,e)=>t[0]-e[0])),n=[];for(let t=0;t{t.forEach((t=>{t.target.chart.handleVisibilityChange(t.isIntersecting)}))}),{threshold:.1}),Z=new ResizeObserver((t=>{t.forEach((t=>{t.target.chart.handleSizeChange()}))})),W={fixedrange:!1,griddash:"dash",autorange:!1,showspikes:!0,spikemode:"across",spikesnap:"cursor",spikedash:"dot",spikethickness:1};const Y=class{constructor(t,e,r,n,i,a){this.container=t,this.metric=e,this.rangeFactory=r,this.refreshInterval=n,this.aggregator=i,this.step=a,this.listeners={},this.initializing=!1,this.refreshing=!1,this.debouncedHandleRefresh=s(this.handleRefresh.bind(this),500),this.visible=!1,this.interval=null,this.lastRefresh=0,this.pendingRefresh=!1,this.error=null,this.graph={element:null,x:null,y:null,step:null,range:null,zoomRange:null},G.observe(this.container),Z.observe(this.container)}async init(){if(!this.initializing){this.initializing=!0;try{this.processMetric(await this.getMetric()),this.graph.element=this.renderGraph(),this.setupInterval(),this.lastRefresh=l(new Date),this.pendingRefresh=!1}catch(t){this.setError(`Failed to fetch samples of a metric: ${t}`)}finally{this.initializing=!1}}}async handleRefresh(){if(!this.refreshing){this.refreshing=!0;try{if(null!=this.graph.element&&(this.pendingRefresh=!0,this.visible))try{this.processMetric(await this.getMetric()),this.updateGraph(!1),this.clearError(),this.lastRefresh=l(new Date),this.pendingRefresh=!1}catch(t){this.setError(`Failed to fetch samples of a metric: ${t}`)}}finally{this.refreshing=!1}}}handleVisibilityChange(t){this.visible=t,this.visible?null==this.graph.element?this.init():(null==this.interval&&this.setupInterval(),(this.pendingRefresh||this.refreshInterval>0&&l(new Date)-this.lastRefresh>this.refreshInterval)&&this.debouncedHandleRefresh()):this.stopInterval()}handleSizeChange(){null!=this.graph.element&&this.debouncedHandleRefresh()}handleGraphRelayout(t){if(t["xaxis.range[0]"]&&t["xaxis.range[1]"]?this.graph.zoomRange=[new Date(t["xaxis.range[0]"]),new Date(t["xaxis.range[1]"])]:(t["xaxis.range"]&&Array.isArray(t["xaxis.range"])&&t["xaxis.range"].length,this.graph.zoomRange=null),null!=this.graph.zoomRange&&(l(this.graph.zoomRange[0])l(this.graph.range[1])&&(this.graph.zoomRange[1]=this.graph.range[1])),null!=this.graph.zoomRange){const t=l(this.graph.zoomRange[1])-l(this.graph.zoomRange[0]);if(tt!==e)))}notifyEventListeners(t,e){this.listeners[t]&&this.listeners[t].forEach((t=>t(e)))}redraw(t,e,r){let n="normal"===e&&this.metric.debug;if(!n){const e=t.split(/\s+/).filter((t=>t.length>0));e.length>0&&(n=!e.some((t=>this.metric.name.includes(t))))}this.container.classList.toggle("d-none",n),this.container.classList.forEach((t=>{t.startsWith("col-")&&this.container.classList.remove(t)})),this.container.classList.add("col-"+12/r)}setRefreshInterval(t){this.refreshInterval=t,this.visible&&null!=this.graph.element&&this.setupInterval()}refresh(){null!=this.graph.element&&(this.visible&&this.setupInterval(),this.handleRefresh())}setAggregator(t){this.aggregator=t,null!=this.graph.element&&(this.visible&&this.setupInterval(),this.handleRefresh())}setStep(t){this.step=t,null!=this.graph.element&&(this.visible&&this.setupInterval(),this.handleRefresh())}setZoomRange(t){this.graph.zoomRange=t,null!=this.graph.element&&this.updateGraph(!0)}destroy(){G.unobserve(this.container),Z.unobserve(this.container),this.stopInterval(),this.clearError(),null!=this.graph.element&&V().purge(this.graph.element)}setupInterval(){this.stopInterval(),this.refreshInterval>0&&(this.interval=setInterval(this.handleRefresh.bind(this),1e3*this.refreshInterval))}stopInterval(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}setError(t){const e=this.container.querySelector(".card"),r=e.querySelector(".error-icon");null==this.error&&(e.classList.add("border-danger"),r.classList.remove("d-none"));const n=`${(new Date).toISOString()}: ${t}`;let i=H().getInstance(r);null==i?i=new(H())(r,{title:n}):i.setContent({".tooltip-inner":n}),this.error=t}clearError(){if(null!=this.error){const t=this.container.querySelector(".card");t.classList.remove("border-danger");const e=t.querySelector(".error-icon");e.classList.add("d-none");H().getInstance(e).dispose(),this.error=null}}async getMetric(){const t=this.container.querySelector(".card .loading-icon");t.classList.remove("d-none");try{const[t,e]=this.rangeFactory(),r=this.estimateOptimalStep(t,e),n="b"===this.metric.flag?"bit_and":this.aggregator;return await async function(t,e,r,n,i){const a=new URLSearchParams({from:l(e),to:l(r),step:n,aggregator:i}),o=await fetch(`/storage/metrics/${t}?${a.toString()}`);if(!o.ok)throw new Error(`Unexpected API response (${o.status}): ${o.statusText}`);const s=await o.json();return{from:c(s.from),to:c(s.to),step:s.step,samples:N(s.samples,s.step)}}(this.metric.id,t,e,r,n)}finally{t.classList.add("d-none")}}estimateOptimalStep(t,e){const r=(l(e)-l(t))/this.step,n=this.container.clientWidth,i=Math.floor(.9*n);if(i<=0)throw new Error("Failed to estimate the optimal step");return r<=i?this.step:Math.ceil(r/i)*this.step}processMetric(t){this.graph.x=[],this.graph.y=[],t.samples.forEach((t=>{this.graph.x.push(t[0]),this.graph.y.push("b"===this.metric.flag?BigInt(`0x${t[1]}`).toString(2).split("").filter((t=>"1"===t)).length:t[1])})),this.graph.step=t.step,this.graph.range=[t.from,new Date(t.to.getTime()-1e3*t.step)];const e=this.container.querySelector(".card .step-factor");if(this.graph.step!==this.step){const t=Math.round(this.graph.step/this.step);e.innerHTML=` ${t}x`}else e.innerHTML=""}renderGraph(){const t=null!=this.graph.zoomRange?this.graph.zoomRange:this.graph.range,e=[{x:this.graph.x,y:this.graph.y,type:"scatter",mode:this.estimatePlotlyDataMode(...t,this.graph.step),marker:{size:4},hovertemplate:"X: %{x|%Y-%m-%d %H:%M:%S}
Y: %{y:,.1f}",connectgaps:!1,line:{shape:"linear",width:2}}],r={autosize:!0,title:{text:this.metric.name,font:{size:14},subtitle:{text:this.metric.description}},margin:{l:60,r:10,b:40,t:40,pad:5},hovermode:"closest",xaxis:{...W,range:Array.from(t)},yaxis:{fixedrange:!0,griddash:"dash",rangemode:"normal",title:(()=>{if("c"===this.metric.flag)return"d"===this.metric.format?"seconds":"B"===this.metric.format?"Bps":"eps";if("g"===this.metric.flag){if("d"===this.metric.format)return"seconds";if("B"===this.metric.format)return"bytes"}return""})()}},n={responsive:!0,displaylogo:!1,modeBarButtons:[["zoomIn2d","zoomOut2d","resetScale2d"],[{name:"download",title:"Download plot",icon:V().Icons.disk,click:t=>{V().downloadImage(t,{filename:`${varnishmon.storage.hostname} - ${this.metric.name}`,format:"png",width:null,height:null,scale:1}).then((()=>{u("info","Plot ready for download")})).catch((t=>{u("error",`Failed to download plot: ${t}`)}))}},{name:"copy-to-clipboard",title:"Copy plot to clipboard",icon:V().Icons.camera,click:t=>{V().toImage(t,{format:"png",width:null,height:null,scale:1}).then((t=>{fetch(t).then((t=>{t.blob().then((t=>{navigator.clipboard.write([new ClipboardItem({"image/png":t})]).then((()=>{u("info","Plot copied to clipboard")})).catch((t=>{u("error",`Failed to copy plot to clipboard: ${t}`)}))}))}))}))}}]],scrollZoom:!1},i=this.container.querySelector(".graph");return V().newPlot(i,e,r,n),i.on("plotly_relayout",this.handleGraphRelayout.bind(this)),i}updateGraph(t){const e=null!=this.graph.zoomRange?this.graph.zoomRange:this.graph.range,r={mode:this.estimatePlotlyDataMode(...e,this.graph.step)};t||(r.x=[this.graph.x],r.y=[this.graph.y]);const n={xaxis:{...W,range:Array.from(e)}};V().update(this.graph.element,r,n)}estimatePlotlyDataMode(t,e,r){const n=(l(e)-l(t))/r,i=this.container.clientWidth;return n>Math.floor(.9*i/6)?"lines":"lines+markers"}};var X=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var r=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},K={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const J=K;var Q=function(t,e){return void 0===e&&(e=2),("000"+t).slice(-1*e)},tt=function(t){return!0===t?1:0};function et(t,e){var r;return function(){var n=this,i=arguments;clearTimeout(r),r=setTimeout((function(){return t.apply(n,i)}),e)}}var rt=function(t){return t instanceof Array?t:[t]};function nt(t,e,r){if(!0===r)return t.classList.add(e);t.classList.remove(e)}function it(t,e,r){var n=window.document.createElement(t);return e=e||"",r=r||"",n.className=e,void 0!==r&&(n.textContent=r),n}function at(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ot(t,e){return e(t)?t:t.parentNode?ot(t.parentNode,e):void 0}function st(t,e){var r=it("div","numInputWrapper"),n=it("input","numInput "+t),i=it("span","arrowUp"),a=it("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==e)for(var o in e)n.setAttribute(o,e[o]);return r.appendChild(n),r.appendChild(i),r.appendChild(a),r}function lt(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}var ct=function(){},ut=function(t,e,r){return r.months[e?"shorthand":"longhand"][t]},ht={D:ct,F:function(t,e,r){t.setMonth(r.months.longhand.indexOf(e))},G:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},H:function(t,e){t.setHours(parseFloat(e))},J:function(t,e){t.setDate(parseFloat(e))},K:function(t,e,r){t.setHours(t.getHours()%12+12*tt(new RegExp(r.amPM[1],"i").test(e)))},M:function(t,e,r){t.setMonth(r.months.shorthand.indexOf(e))},S:function(t,e){t.setSeconds(parseFloat(e))},U:function(t,e){return new Date(1e3*parseFloat(e))},W:function(t,e,r){var n=parseInt(e),i=new Date(t.getFullYear(),0,2+7*(n-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+r.firstDayOfWeek),i},Y:function(t,e){t.setFullYear(parseFloat(e))},Z:function(t,e){return new Date(e)},d:function(t,e){t.setDate(parseFloat(e))},h:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},i:function(t,e){t.setMinutes(parseFloat(e))},j:function(t,e){t.setDate(parseFloat(e))},l:ct,m:function(t,e){t.setMonth(parseFloat(e)-1)},n:function(t,e){t.setMonth(parseFloat(e)-1)},s:function(t,e){t.setSeconds(parseFloat(e))},u:function(t,e){return new Date(parseFloat(e))},w:ct,y:function(t,e){t.setFullYear(2e3+parseFloat(e))}},ft={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},pt={Z:function(t){return t.toISOString()},D:function(t,e,r){return e.weekdays.shorthand[pt.w(t,e,r)]},F:function(t,e,r){return ut(pt.n(t,e,r)-1,!1,e)},G:function(t,e,r){return Q(pt.h(t,e,r))},H:function(t){return Q(t.getHours())},J:function(t,e){return void 0!==e.ordinal?t.getDate()+e.ordinal(t.getDate()):t.getDate()},K:function(t,e){return e.amPM[tt(t.getHours()>11)]},M:function(t,e){return ut(t.getMonth(),!0,e)},S:function(t){return Q(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,e,r){return r.getWeek(t)},Y:function(t){return Q(t.getFullYear(),4)},d:function(t){return Q(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Q(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,e){return e.weekdays.longhand[t.getDay()]},m:function(t){return Q(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},dt=function(t){var e=t.config,r=void 0===e?$:e,n=t.l10n,i=void 0===n?K:n,a=t.isMobile,o=void 0!==a&&a;return function(t,e,n){var a=n||i;return void 0===r.formatDate||o?e.split("").map((function(e,n,i){return pt[e]&&"\\"!==i[n-1]?pt[e](t,a,r):"\\"!==e?e:""})).join(""):r.formatDate(t,e,a)}},mt=function(t){var e=t.config,r=void 0===e?$:e,n=t.l10n,i=void 0===n?K:n;return function(t,e,n,a){if(0===t||t){var o,s=a||i,l=t;if(t instanceof Date)o=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)o=new Date(t);else if("string"==typeof t){var c=e||(r||$).dateFormat,u=String(t).trim();if("today"===u)o=new Date,n=!0;else if(r&&r.parseDate)o=r.parseDate(t,c);else if(/Z$/.test(u)||/GMT$/.test(u))o=new Date(t);else{for(var h=void 0,f=[],p=0,d=0,m="";p=0?new Date:new Date(r.config.minDate.getTime()),n=xt(r.config);e.setHours(n.hours,n.minutes,n.seconds,e.getMilliseconds()),r.selectedDates=[e],r.latestSelectedDateObj=e}void 0!==t&&"blur"!==t.type&&function(t){t.preventDefault();var e="keydown"===t.type,n=lt(t),i=n;void 0!==r.amPM&&n===r.amPM&&(r.amPM.textContent=r.l10n.amPM[tt(r.amPM.textContent===r.l10n.amPM[0])]);var a=parseFloat(i.getAttribute("min")),o=parseFloat(i.getAttribute("max")),s=parseFloat(i.getAttribute("step")),l=parseInt(i.value,10),c=t.delta||(e?38===t.which?1:-1:0),u=l+s*c;if(void 0!==i.value&&2===i.value.length){var h=i===r.hourElement,f=i===r.minuteElement;uo&&(u=i===r.hourElement?u-o-tt(!r.amPM):a,f&&m(void 0,1,r.hourElement)),r.amPM&&h&&(1===s?u+l===23:Math.abs(u-l)>s)&&(r.amPM.textContent=r.l10n.amPM[tt(r.amPM.textContent===r.l10n.amPM[0])]),i.value=Q(u)}}(t);var i=r._input.value;s(),wt(),r._input.value!==i&&r._debouncedChange()}function s(){if(void 0!==r.hourElement&&void 0!==r.minuteElement){var t,e,n=(parseInt(r.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(r.minuteElement.value,10)||0)%60,a=void 0!==r.secondElement?(parseInt(r.secondElement.value,10)||0)%60:0;void 0!==r.amPM&&(t=n,e=r.amPM.textContent,n=t%12+12*tt(e===r.l10n.amPM[1]));var o=void 0!==r.config.minTime||r.config.minDate&&r.minDateHasTime&&r.latestSelectedDateObj&&0===gt(r.latestSelectedDateObj,r.config.minDate,!0),s=void 0!==r.config.maxTime||r.config.maxDate&&r.maxDateHasTime&&r.latestSelectedDateObj&&0===gt(r.latestSelectedDateObj,r.config.maxDate,!0);if(void 0!==r.config.maxTime&&void 0!==r.config.minTime&&r.config.minTime>r.config.maxTime){var l=yt(r.config.minTime.getHours(),r.config.minTime.getMinutes(),r.config.minTime.getSeconds()),u=yt(r.config.maxTime.getHours(),r.config.maxTime.getMinutes(),r.config.maxTime.getSeconds()),h=yt(n,i,a);if(h>u&&h=12)]),void 0!==r.secondElement&&(r.secondElement.value=Q(n)))}function u(t){var e=lt(t),r=parseInt(e.value)+(t.delta||0);(r/1e3>1||"Enter"===t.key&&!/[^\d]/.test(r.toString()))&&I(r)}function h(t,e,n,i){return e instanceof Array?e.forEach((function(e){return h(t,e,n,i)})):t instanceof Array?t.forEach((function(t){return h(t,e,n,i)})):(t.addEventListener(e,n,i),void r._handlers.push({remove:function(){return t.removeEventListener(e,n,i)}}))}function f(){Y("onChange")}function p(t,e){var n=void 0!==t?r.parseDate(t):r.latestSelectedDateObj||(r.config.minDate&&r.config.minDate>r.now?r.config.minDate:r.config.maxDate&&r.config.maxDate=0&>(t,r.selectedDates[1])<=0)}(e)&&!ct(e)&&o.classList.add("inRange"),r.weekNumbers&&1===r.config.showMonths&&"prevMonthDay"!==t&&i%7==6&&r.weekNumbers.insertAdjacentHTML("beforeend",""+r.config.getWeek(e)+""),Y("onDayCreate",o),o}function y(t){t.focus(),"range"===r.config.mode&&O(t)}function v(t){for(var e=t>0?0:r.config.showMonths-1,n=t>0?r.config.showMonths:-1,i=e;i!=n;i+=t)for(var a=r.daysContainer.children[i],o=t>0?0:a.children.length-1,s=t>0?a.children.length:-1,l=o;l!=s;l+=t){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&L(c.dateObj))return c}}function x(t,e){var i=n(),a=P(i||document.body),o=void 0!==t?t:a?i:void 0!==r.selectedDateElem&&P(r.selectedDateElem)?r.selectedDateElem:void 0!==r.todayDateElem&&P(r.todayDateElem)?r.todayDateElem:v(e>0?1:-1);void 0===o?r._input.focus():a?function(t,e){for(var n=-1===t.className.indexOf("Month")?t.dateObj.getMonth():r.currentMonth,i=e>0?r.config.showMonths:-1,a=e>0?1:-1,o=n-r.currentMonth;o!=i;o+=a)for(var s=r.daysContainer.children[o],l=n-r.currentMonth===o?t.$i+e:e<0?s.children.length-1:0,c=s.children.length,u=l;u>=0&&u0?c:-1);u+=a){var h=s.children[u];if(-1===h.className.indexOf("hidden")&&L(h.dateObj)&&Math.abs(t.$i-u)>=Math.abs(e))return y(h)}r.changeMonth(a),x(v(a),0)}(o,e):y(o)}function _(t,e){for(var n=(new Date(t,e,1).getDay()-r.l10n.firstDayOfWeek+7)%7,i=r.utils.getDaysInMonth((e-1+12)%12,t),a=r.utils.getDaysInMonth(e,t),o=window.document.createDocumentFragment(),s=r.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-n,h=0;u<=i;u++,h++)o.appendChild(g("flatpickr-day "+l,new Date(t,e-1,u),0,h));for(u=1;u<=a;u++,h++)o.appendChild(g("flatpickr-day",new Date(t,e,u),0,h));for(var f=a+1;f<=42-n&&(1===r.config.showMonths||h%7!=0);f++,h++)o.appendChild(g("flatpickr-day "+c,new Date(t,e+1,f%a),0,h));var p=it("div","dayContainer");return p.appendChild(o),p}function b(){if(void 0!==r.daysContainer){at(r.daysContainer),r.weekNumbers&&at(r.weekNumbers);for(var t=document.createDocumentFragment(),e=0;e1||"dropdown"!==r.config.monthSelectorType)){var t=function(t){return!(void 0!==r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&tr.config.maxDate.getMonth())};r.monthsDropdownContainer.tabIndex=-1,r.monthsDropdownContainer.innerHTML="";for(var e=0;e<12;e++)if(t(e)){var n=it("option","flatpickr-monthDropdown-month");n.value=new Date(r.currentYear,e).getMonth().toString(),n.textContent=ut(e,r.config.shorthandCurrentMonth,r.l10n),n.tabIndex=-1,r.currentMonth===e&&(n.selected=!0),r.monthsDropdownContainer.appendChild(n)}}}function T(){var t,e=it("div","flatpickr-month"),n=window.document.createDocumentFragment();r.config.showMonths>1||"static"===r.config.monthSelectorType?t=it("span","cur-month"):(r.monthsDropdownContainer=it("select","flatpickr-monthDropdown-months"),r.monthsDropdownContainer.setAttribute("aria-label",r.l10n.monthAriaLabel),h(r.monthsDropdownContainer,"change",(function(t){var e=lt(t),n=parseInt(e.value,10);r.changeMonth(n-r.currentMonth),Y("onMonthChange")})),w(),t=r.monthsDropdownContainer);var i=st("cur-year",{tabindex:"-1"}),a=i.getElementsByTagName("input")[0];a.setAttribute("aria-label",r.l10n.yearAriaLabel),r.config.minDate&&a.setAttribute("min",r.config.minDate.getFullYear().toString()),r.config.maxDate&&(a.setAttribute("max",r.config.maxDate.getFullYear().toString()),a.disabled=!!r.config.minDate&&r.config.minDate.getFullYear()===r.config.maxDate.getFullYear());var o=it("div","flatpickr-current-month");return o.appendChild(t),o.appendChild(i),n.appendChild(o),e.appendChild(n),{container:e,yearElement:a,monthElement:t}}function k(){at(r.monthNav),r.monthNav.appendChild(r.prevMonthNav),r.config.showMonths&&(r.yearElements=[],r.monthElements=[]);for(var t=r.config.showMonths;t--;){var e=T();r.yearElements.push(e.yearElement),r.monthElements.push(e.monthElement),r.monthNav.appendChild(e.container)}r.monthNav.appendChild(r.nextMonthNav)}function A(){r.weekdayContainer?at(r.weekdayContainer):r.weekdayContainer=it("div","flatpickr-weekdays");for(var t=r.config.showMonths;t--;){var e=it("div","flatpickr-weekdaycontainer");r.weekdayContainer.appendChild(e)}return M(),r.weekdayContainer}function M(){if(r.weekdayContainer){var t=r.l10n.firstDayOfWeek,e=bt(r.l10n.weekdays.shorthand);t>0&&t\n "+e.join("")+"\n \n "}}function S(t,e){void 0===e&&(e=!0);var n=e?t:t-r.currentMonth;n<0&&!0===r._hidePrevMonthArrow||n>0&&!0===r._hideNextMonthArrow||(r.currentMonth+=n,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,Y("onYearChange"),w()),b(),Y("onMonthChange"),ht())}function E(t){return r.calendarContainer.contains(t)}function C(t){if(r.isOpen&&!r.config.inline){var e=lt(t),n=E(e),i=!(e===r.input||e===r.altInput||r.element.contains(e)||t.path&&t.path.indexOf&&(~t.path.indexOf(r.input)||~t.path.indexOf(r.altInput)))&&!n&&!E(t.relatedTarget),a=!r.config.ignoredFocusElements.some((function(t){return t.contains(e)}));i&&a&&(r.config.allowInput&&r.setDate(r._input.value,!1,r.config.altInput?r.config.altFormat:r.config.dateFormat),void 0!==r.timeContainer&&void 0!==r.minuteElement&&void 0!==r.hourElement&&""!==r.input.value&&void 0!==r.input.value&&o(),r.close(),r.config&&"range"===r.config.mode&&1===r.selectedDates.length&&r.clear(!1))}}function I(t){if(!(!t||r.config.minDate&&tr.config.maxDate.getFullYear())){var e=t,n=r.currentYear!==e;r.currentYear=e||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),n&&(r.redraw(),Y("onYearChange"),w())}}function L(t,e){var n;void 0===e&&(e=!0);var i=r.parseDate(t,void 0,e);if(r.config.minDate&&i&>(i,r.config.minDate,void 0!==e?e:!r.minDateHasTime)<0||r.config.maxDate&&i&>(i,r.config.maxDate,void 0!==e?e:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&0===r.config.disable.length)return!0;if(void 0===i)return!1;for(var a=!!r.config.enable,o=null!==(n=r.config.enable)&&void 0!==n?n:r.config.disable,s=0,l=void 0;s=l.from.getTime()&&i.getTime()<=l.to.getTime())return a}return!a}function P(t){return void 0!==r.daysContainer&&(-1===t.className.indexOf("hidden")&&-1===t.className.indexOf("flatpickr-disabled")&&r.daysContainer.contains(t))}function z(t){var e=t.target===r._input,n=r._input.value.trimEnd()!==pt();!e||!n||t.relatedTarget&&E(t.relatedTarget)||r.setDate(r._input.value,!0,t.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function D(e){var i=lt(e),a=r.config.wrap?t.contains(i):i===r._input,l=r.config.allowInput,c=r.isOpen&&(!l||!a),u=r.config.inline&&a&&!l;if(13===e.keyCode&&a){if(l)return r.setDate(r._input.value,!0,i===r.altInput?r.config.altFormat:r.config.dateFormat),r.close(),i.blur();r.open()}else if(E(i)||c||u){var h=!!r.timeContainer&&r.timeContainer.contains(i);switch(e.keyCode){case 13:h?(e.preventDefault(),o(),V()):q(e);break;case 27:e.preventDefault(),V();break;case 8:case 46:a&&!r.config.allowInput&&(e.preventDefault(),r.clear());break;case 37:case 39:if(h||a)r.hourElement&&r.hourElement.focus();else{e.preventDefault();var f=n();if(void 0!==r.daysContainer&&(!1===l||f&&P(f))){var p=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),S(p),x(v(1),0)):x(void 0,p)}}break;case 38:case 40:e.preventDefault();var d=40===e.keyCode?1:-1;r.daysContainer&&void 0!==i.$i||i===r.input||i===r.altInput?e.ctrlKey?(e.stopPropagation(),I(r.currentYear-d),x(v(1),0)):h||x(void 0,7*d):i===r.currentYearElement?I(r.currentYear-d):r.config.enableTime&&(!h&&r.hourElement&&r.hourElement.focus(),o(e),r._debouncedChange());break;case 9:if(h){var m=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter((function(t){return t})),g=m.indexOf(i);if(-1!==g){var y=m[g+(e.shiftKey?-1:1)];e.preventDefault(),(y||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(i)&&e.shiftKey&&(e.preventDefault(),r._input.focus())}}if(void 0!==r.amPM&&i===r.amPM)switch(e.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],s(),wt();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],s(),wt()}(a||E(i))&&Y("onKeyDown",e)}function O(t,e){if(void 0===e&&(e="flatpickr-day"),1===r.selectedDates.length&&(!t||t.classList.contains(e)&&!t.classList.contains("flatpickr-disabled"))){for(var n=t?t.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),i=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),a=Math.min(n,r.selectedDates[0].getTime()),o=Math.max(n,r.selectedDates[0].getTime()),s=!1,l=0,c=0,u=a;ua&&ul)?l=u:u>i&&(!c||u ."+e)).forEach((function(e){var a,o,u,h=e.dateObj.getTime(),f=l>0&&h0&&h>c;if(f)return e.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(t){e.classList.remove(t)}));s&&!f||(["startRange","inRange","endRange","notAllowed"].forEach((function(t){e.classList.remove(t)})),void 0!==t&&(t.classList.add(n<=r.selectedDates[0].getTime()?"startRange":"endRange"),in&&h===i&&e.classList.add("endRange"),h>=l&&(0===c||h<=c)&&(o=i,u=n,(a=h)>Math.min(o,u)&&a0||n.getMinutes()>0||n.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter((function(t){return L(t)})),r.selectedDates.length||"min"!==t||l(n),wt()),r.daysContainer&&(U(),void 0!==n?r.currentYearElement[t]=n.getFullYear().toString():r.currentYearElement.removeAttribute(t),r.currentYearElement.disabled=!!i&&void 0!==n&&i.getFullYear()===n.getFullYear())}}function j(){return r.config.wrap?t.querySelector("[data-input]"):t}function B(){"object"!=typeof r.config.locale&&void 0===kt.l10ns[r.config.locale]&&r.config.errorHandler(new Error("flatpickr: invalid locale "+r.config.locale)),r.l10n=_t(_t({},kt.l10ns.default),"object"==typeof r.config.locale?r.config.locale:"default"!==r.config.locale?kt.l10ns[r.config.locale]:void 0),ft.D="("+r.l10n.weekdays.shorthand.join("|")+")",ft.l="("+r.l10n.weekdays.longhand.join("|")+")",ft.M="("+r.l10n.months.shorthand.join("|")+")",ft.F="("+r.l10n.months.longhand.join("|")+")",ft.K="("+r.l10n.amPM[0]+"|"+r.l10n.amPM[1]+"|"+r.l10n.amPM[0].toLowerCase()+"|"+r.l10n.amPM[1].toLowerCase()+")",void 0===_t(_t({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr&&void 0===kt.defaultConfig.time_24hr&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=dt(r),r.parseDate=mt({config:r.config,l10n:r.l10n})}function N(t){if("function"!=typeof r.config.position){if(void 0!==r.calendarContainer){Y("onPreCalendarPosition");var e=t||r._positionElement,n=Array.prototype.reduce.call(r.calendarContainer.children,(function(t,e){return t+e.offsetHeight}),0),i=r.calendarContainer.offsetWidth,a=r.config.position.split(" "),o=a[0],s=a.length>1?a[1]:null,l=e.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===o||"below"!==o&&cn,h=window.pageYOffset+l.top+(u?-n-2:e.offsetHeight+2);if(nt(r.calendarContainer,"arrowTop",!u),nt(r.calendarContainer,"arrowBottom",u),!r.config.inline){var f=window.pageXOffset+l.left,p=!1,d=!1;"center"===s?(f-=(i-l.width)/2,p=!0):"right"===s&&(f-=i-l.width,d=!0),nt(r.calendarContainer,"arrowLeft",!p&&!d),nt(r.calendarContainer,"arrowCenter",p),nt(r.calendarContainer,"arrowRight",d);var m=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+i>window.document.body.offsetWidth,y=m+i>window.document.body.offsetWidth;if(nt(r.calendarContainer,"rightMost",g),!r.config.static)if(r.calendarContainer.style.top=h+"px",g)if(y){var v=function(){for(var t=null,e=0;er.currentMonth+r.config.showMonths-1)&&"range"!==r.config.mode;if(r.selectedDateElem=n,"single"===r.config.mode)r.selectedDates=[i];else if("multiple"===r.config.mode){var o=ct(i);o?r.selectedDates.splice(parseInt(o),1):r.selectedDates.push(i)}else"range"===r.config.mode&&(2===r.selectedDates.length&&r.clear(!1,!1),r.latestSelectedDateObj=i,r.selectedDates.push(i),0!==gt(i,r.selectedDates[0],!0)&&r.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()})));if(s(),a){var l=r.currentYear!==i.getFullYear();r.currentYear=i.getFullYear(),r.currentMonth=i.getMonth(),l&&(Y("onYearChange"),w()),Y("onMonthChange")}if(ht(),b(),wt(),a||"range"===r.config.mode||1!==r.config.showMonths?void 0!==r.selectedDateElem&&void 0===r.hourElement&&r.selectedDateElem&&r.selectedDateElem.focus():y(n),void 0!==r.hourElement&&void 0!==r.hourElement&&r.hourElement.focus(),r.config.closeOnSelect){var c="single"===r.config.mode&&!r.config.enableTime,u="range"===r.config.mode&&2===r.selectedDates.length&&!r.config.enableTime;(c||u)&&V()}f()}}r.parseDate=mt({config:r.config,l10n:r.l10n}),r._handlers=[],r.pluginElements=[],r.loadedPlugins=[],r._bind=h,r._setHoursFromDate=l,r._positionCalendar=N,r.changeMonth=S,r.changeYear=I,r.clear=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);r.input.value="",void 0!==r.altInput&&(r.altInput.value="");void 0!==r.mobileInput&&(r.mobileInput.value="");r.selectedDates=[],r.latestSelectedDateObj=void 0,!0===e&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth());if(!0===r.config.enableTime){var n=xt(r.config);c(n.hours,n.minutes,n.seconds)}r.redraw(),t&&Y("onChange")},r.close=function(){r.isOpen=!1,r.isMobile||(void 0!==r.calendarContainer&&r.calendarContainer.classList.remove("open"),void 0!==r._input&&r._input.classList.remove("active"));Y("onClose")},r.onMouseOver=O,r._createElement=it,r.createDay=g,r.destroy=function(){void 0!==r.config&&Y("onDestroy");for(var t=r._handlers.length;t--;)r._handlers[t].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var e=r.calendarContainer.parentNode;if(e.lastChild&&e.removeChild(e.lastChild),e.parentNode){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.parentNode.removeChild(e)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput);r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete r[t]}catch(t){}}))},r.isEnabled=L,r.jumpToDate=p,r.updateValue=wt,r.open=function(t,e){void 0===e&&(e=r._positionElement);if(!0===r.isMobile){if(t){t.preventDefault();var n=lt(t);n&&n.blur()}return void 0!==r.mobileInput&&(r.mobileInput.focus(),r.mobileInput.click()),void Y("onOpen")}if(r._input.disabled||r.config.inline)return;var i=r.isOpen;r.isOpen=!0,i||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),Y("onOpen"),N(e));!0===r.config.enableTime&&!0===r.config.noCalendar&&(!1!==r.config.allowInput||void 0!==t&&r.timeContainer.contains(t.relatedTarget)||setTimeout((function(){return r.hourElement.select()}),50))},r.redraw=U,r.set=function(t,e){if(null!==t&&"object"==typeof t)for(var n in Object.assign(r.config,t),t)void 0!==H[n]&&H[n].forEach((function(t){return t()}));else r.config[t]=e,void 0!==H[t]?H[t].forEach((function(t){return t()})):X.indexOf(t)>-1&&(r.config[t]=rt(e));r.redraw(),wt(!0)},r.setDate=function(t,e,n){void 0===e&&(e=!1);void 0===n&&(n=r.config.dateFormat);if(0!==t&&!t||t instanceof Array&&0===t.length)return r.clear(e);G(t,n),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),p(void 0,e),l(),0===r.selectedDates.length&&r.clear(!1);wt(e),e&&Y("onChange")},r.toggle=function(t){if(!0===r.isOpen)return r.close();r.open(t)};var H={locale:[B,M],showMonths:[k,a,A],minDate:[p],maxDate:[p],positionElement:[W],clickOpens:[function(){!0===r.config.clickOpens?(h(r._input,"focus",r.open),h(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function G(t,e){var n=[];if(t instanceof Array)n=t.map((function(t){return r.parseDate(t,e)}));else if(t instanceof Date||"number"==typeof t)n=[r.parseDate(t,e)];else if("string"==typeof t)switch(r.config.mode){case"single":case"time":n=[r.parseDate(t,e)];break;case"multiple":n=t.split(r.config.conjunction).map((function(t){return r.parseDate(t,e)}));break;case"range":n=t.split(r.l10n.rangeSeparator).map((function(t){return r.parseDate(t,e)}))}else r.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));r.selectedDates=r.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&L(t,!1)})),"range"===r.config.mode&&r.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()}))}function Z(t){return t.slice().map((function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?r.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:r.parseDate(t.from,void 0),to:r.parseDate(t.to,void 0)}:t})).filter((function(t){return t}))}function W(){r._positionElement=r.config.positionElement||r._input}function Y(t,e){if(void 0!==r.config){var n=r.config[t];if(void 0!==n&&n.length>0)for(var i=0;n[i]&&i1||"static"===r.config.monthSelectorType?r.monthElements[e].textContent=ut(n.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=n.getMonth().toString(),t.value=n.getFullYear().toString()})),r._hidePrevMonthArrow=void 0!==r.config.minDate&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYearr.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function pt(t){var e=t||(r.config.altInput?r.config.altFormat:r.config.dateFormat);return r.selectedDates.map((function(t){return r.formatDate(t,e)})).filter((function(t,e,n){return"range"!==r.config.mode||r.config.enableTime||n.indexOf(t)===e})).join("range"!==r.config.mode?r.config.conjunction:r.l10n.rangeSeparator)}function wt(t){void 0===t&&(t=!0),void 0!==r.mobileInput&&r.mobileFormatStr&&(r.mobileInput.value=void 0!==r.latestSelectedDateObj?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=pt(r.config.dateFormat),void 0!==r.altInput&&(r.altInput.value=pt(r.config.altFormat)),!1!==t&&Y("onValueUpdate")}function Tt(t){var e=lt(t),n=r.prevMonthNav.contains(e),i=r.nextMonthNav.contains(e);n||i?S(n?-1:1):r.yearElements.indexOf(e)>=0?e.select():e.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):e.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}return function(){r.element=r.input=t,r.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=_t(_t({},JSON.parse(JSON.stringify(t.dataset||{}))),e),o={};r.config.parseDate=a.parseDate,r.config.formatDate=a.formatDate,Object.defineProperty(r.config,"enable",{get:function(){return r.config._enable},set:function(t){r.config._enable=Z(t)}}),Object.defineProperty(r.config,"disable",{get:function(){return r.config._disable},set:function(t){r.config._disable=Z(t)}});var s="time"===a.mode;if(!a.dateFormat&&(a.enableTime||s)){var l=kt.defaultConfig.dateFormat||$.dateFormat;o.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var c=kt.defaultConfig.altFormat||$.altFormat;o.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(r.config,"minDate",{get:function(){return r.config._minDate},set:F("min")}),Object.defineProperty(r.config,"maxDate",{get:function(){return r.config._maxDate},set:F("max")});var u=function(t){return function(e){r.config["min"===t?"_minTime":"_maxTime"]=r.parseDate(e,"H:i:S")}};Object.defineProperty(r.config,"minTime",{get:function(){return r.config._minTime},set:u("min")}),Object.defineProperty(r.config,"maxTime",{get:function(){return r.config._maxTime},set:u("max")}),"time"===a.mode&&(r.config.noCalendar=!0,r.config.enableTime=!0);Object.assign(r.config,o,a);for(var h=0;h-1?r.config[p]=rt(f[p]).map(i).concat(r.config[p]):void 0===a[p]&&(r.config[p]=f[p])}a.altInputClass||(r.config.altInputClass=j().className+" "+r.config.altInputClass);Y("onParseConfig")}(),B(),function(){if(r.input=j(),!r.input)return void r.config.errorHandler(new Error("Invalid input element specified"));r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=it(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling));r.config.allowInput||r._input.setAttribute("readonly","readonly");W()}(),function(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;var t=r.config.defaultDate||("INPUT"!==r.input.nodeName&&"TEXTAREA"!==r.input.nodeName||!r.input.placeholder||r.input.value!==r.input.placeholder?r.input.value:null);t&&G(t,r.config.dateFormat);r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()0&&(r.latestSelectedDateObj=r.selectedDates[0]);void 0!==r.config.minTime&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i"));void 0!==r.config.maxTime&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i"));r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}(),r.utils={getDaysInMonth:function(t,e){return void 0===t&&(t=r.currentMonth),void 0===e&&(e=r.currentYear),1===t&&(e%4==0&&e%100!=0||e%400==0)?29:r.l10n.daysInMonth[t]}},r.isMobile||function(){var t=window.document.createDocumentFragment();if(r.calendarContainer=it("div","flatpickr-calendar"),r.calendarContainer.tabIndex=-1,!r.config.noCalendar){if(t.appendChild((r.monthNav=it("div","flatpickr-months"),r.yearElements=[],r.monthElements=[],r.prevMonthNav=it("span","flatpickr-prev-month"),r.prevMonthNav.innerHTML=r.config.prevArrow,r.nextMonthNav=it("span","flatpickr-next-month"),r.nextMonthNav.innerHTML=r.config.nextArrow,k(),Object.defineProperty(r,"_hidePrevMonthArrow",{get:function(){return r.__hidePrevMonthArrow},set:function(t){r.__hidePrevMonthArrow!==t&&(nt(r.prevMonthNav,"flatpickr-disabled",t),r.__hidePrevMonthArrow=t)}}),Object.defineProperty(r,"_hideNextMonthArrow",{get:function(){return r.__hideNextMonthArrow},set:function(t){r.__hideNextMonthArrow!==t&&(nt(r.nextMonthNav,"flatpickr-disabled",t),r.__hideNextMonthArrow=t)}}),r.currentYearElement=r.yearElements[0],ht(),r.monthNav)),r.innerContainer=it("div","flatpickr-innerContainer"),r.config.weekNumbers){var e=function(){r.calendarContainer.classList.add("hasWeeks");var t=it("div","flatpickr-weekwrapper");t.appendChild(it("span","flatpickr-weekday",r.l10n.weekAbbreviation));var e=it("div","flatpickr-weeks");return t.appendChild(e),{weekWrapper:t,weekNumbers:e}}(),n=e.weekWrapper,i=e.weekNumbers;r.innerContainer.appendChild(n),r.weekNumbers=i,r.weekWrapper=n}r.rContainer=it("div","flatpickr-rContainer"),r.rContainer.appendChild(A()),r.daysContainer||(r.daysContainer=it("div","flatpickr-days"),r.daysContainer.tabIndex=-1),b(),r.rContainer.appendChild(r.daysContainer),r.innerContainer.appendChild(r.rContainer),t.appendChild(r.innerContainer)}r.config.enableTime&&t.appendChild(function(){r.calendarContainer.classList.add("hasTime"),r.config.noCalendar&&r.calendarContainer.classList.add("noCalendar");var t=xt(r.config);r.timeContainer=it("div","flatpickr-time"),r.timeContainer.tabIndex=-1;var e=it("span","flatpickr-time-separator",":"),n=st("flatpickr-hour",{"aria-label":r.l10n.hourAriaLabel});r.hourElement=n.getElementsByTagName("input")[0];var i=st("flatpickr-minute",{"aria-label":r.l10n.minuteAriaLabel});r.minuteElement=i.getElementsByTagName("input")[0],r.hourElement.tabIndex=r.minuteElement.tabIndex=-1,r.hourElement.value=Q(r.latestSelectedDateObj?r.latestSelectedDateObj.getHours():r.config.time_24hr?t.hours:function(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}(t.hours)),r.minuteElement.value=Q(r.latestSelectedDateObj?r.latestSelectedDateObj.getMinutes():t.minutes),r.hourElement.setAttribute("step",r.config.hourIncrement.toString()),r.minuteElement.setAttribute("step",r.config.minuteIncrement.toString()),r.hourElement.setAttribute("min",r.config.time_24hr?"0":"1"),r.hourElement.setAttribute("max",r.config.time_24hr?"23":"12"),r.hourElement.setAttribute("maxlength","2"),r.minuteElement.setAttribute("min","0"),r.minuteElement.setAttribute("max","59"),r.minuteElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(n),r.timeContainer.appendChild(e),r.timeContainer.appendChild(i),r.config.time_24hr&&r.timeContainer.classList.add("time24hr");if(r.config.enableSeconds){r.timeContainer.classList.add("hasSeconds");var a=st("flatpickr-second");r.secondElement=a.getElementsByTagName("input")[0],r.secondElement.value=Q(r.latestSelectedDateObj?r.latestSelectedDateObj.getSeconds():t.seconds),r.secondElement.setAttribute("step",r.minuteElement.getAttribute("step")),r.secondElement.setAttribute("min","0"),r.secondElement.setAttribute("max","59"),r.secondElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(it("span","flatpickr-time-separator",":")),r.timeContainer.appendChild(a)}r.config.time_24hr||(r.amPM=it("span","flatpickr-am-pm",r.l10n.amPM[tt((r.latestSelectedDateObj?r.hourElement.value:r.config.defaultHour)>11)]),r.amPM.title=r.l10n.toggleTitle,r.amPM.tabIndex=-1,r.timeContainer.appendChild(r.amPM));return r.timeContainer}());nt(r.calendarContainer,"rangeMode","range"===r.config.mode),nt(r.calendarContainer,"animate",!0===r.config.animate),nt(r.calendarContainer,"multiMonth",r.config.showMonths>1),r.calendarContainer.appendChild(t);var a=void 0!==r.config.appendTo&&void 0!==r.config.appendTo.nodeType;if((r.config.inline||r.config.static)&&(r.calendarContainer.classList.add(r.config.inline?"inline":"static"),r.config.inline&&(!a&&r.element.parentNode?r.element.parentNode.insertBefore(r.calendarContainer,r._input.nextSibling):void 0!==r.config.appendTo&&r.config.appendTo.appendChild(r.calendarContainer)),r.config.static)){var o=it("div","flatpickr-wrapper");r.element.parentNode&&r.element.parentNode.insertBefore(o,r.element),o.appendChild(r.element),r.altInput&&o.appendChild(r.altInput),o.appendChild(r.calendarContainer)}r.config.static||r.config.inline||(void 0!==r.config.appendTo?r.config.appendTo:window.document.body).appendChild(r.calendarContainer)}(),function(){r.config.wrap&&["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(r.element.querySelectorAll("[data-"+t+"]"),(function(e){return h(e,"click",r[t])}))}));if(r.isMobile)return void function(){var t=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=it("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=t,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr));r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d"));r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d"));r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step")));r.input.type="hidden",void 0!==r.altInput&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch(t){}h(r.mobileInput,"change",(function(t){r.setDate(lt(t).value,!1,r.mobileFormatStr),Y("onChange"),Y("onClose")}))}();var t=et(R,50);r._debouncedChange=et(f,300),r.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(r.daysContainer,"mouseover",(function(t){"range"===r.config.mode&&O(lt(t))}));h(r._input,"keydown",D),void 0!==r.calendarContainer&&h(r.calendarContainer,"keydown",D);r.config.inline||r.config.static||h(window,"resize",t);void 0!==window.ontouchstart?h(window.document,"touchstart",C):h(window.document,"mousedown",C);h(window.document,"focus",C,{capture:!0}),!0===r.config.clickOpens&&(h(r._input,"focus",r.open),h(r._input,"click",r.open));void 0!==r.daysContainer&&(h(r.monthNav,"click",Tt),h(r.monthNav,["keyup","increment"],u),h(r.daysContainer,"click",q));if(void 0!==r.timeContainer&&void 0!==r.minuteElement&&void 0!==r.hourElement){var e=function(t){return lt(t).select()};h(r.timeContainer,["increment"],o),h(r.timeContainer,"blur",o,{capture:!0}),h(r.timeContainer,"click",d),h([r.hourElement,r.minuteElement],["focus","click"],e),void 0!==r.secondElement&&h(r.secondElement,"focus",(function(){return r.secondElement&&r.secondElement.select()})),void 0!==r.amPM&&h(r.amPM,"click",(function(t){o(t)}))}r.config.allowInput&&h(r._input,"blur",z)}(),(r.selectedDates.length||r.config.noCalendar)&&(r.config.enableTime&&l(r.config.noCalendar?r.latestSelectedDateObj:void 0),wt(!1)),a();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!r.isMobile&&n&&N(),Y("onReady")}(),r}function Tt(t,e){for(var r=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement})),n=[],i=0;it}if(null!=this.expression){const t=this.expression;return()=>this.parseExpression(t)}return null}parseExpression(t){const e=new Date;if(e.setMilliseconds(0),"now"===t.toLowerCase())return e;const r=t.match(/^\s*now\s*(-|\+)\s*(\d+)([dhms])\s*$/i);if(r){const[,t,n,i]=r;let a;switch(i.toLowerCase()){case"d":a=60*n*60*24;break;case"h":a=60*n*60;break;case"m":a=60*n;break;case"s":a=n;break;default:return null}return"-"===t&&(a=-a),c(l(e)+a)}return null}}class St{constructor(t,e){this.fromPicker=new Mt(t),this.toPicker=new Mt(e)}setDates(t,e){this.fromPicker.setDate(t),this.toPicker.setDate(e)}getDates(){return[this.fromPicker.getDate(),this.toPicker.getDate()]}getRawDates(){return[this.fromPicker.getRawDate(),this.toPicker.getRawDate()]}getDatesFactory(){const t=this.fromPicker.getDateFactory(),e=this.toPicker.getDateFactory();return()=>[t(),e()]}hasValidDates(){const t=this.fromPicker.getDate(),e=this.toPicker.getDate();return null!=t&&null!=e&&t<=e}}function Et(){function t(t,e,r){e.forEach((e=>{const r=document.createElement("option");Array.isArray(e)&&2===e.length?(r.value=e[0],r.text=e[1]):(r.value=e,r.text=e),t.appendChild(r)})),t.value=r}const e=document.getElementById("range").timeRangePicker;try{e.setDates(...m())}catch{e.setDates(...m(!0))}const r=document.getElementById("refresh-interval");t(r,x,function(){try{let t=localStorage.getItem(v);if(null!=t&&(t=parseInt(t,10),_(t)))return t}catch(t){console.error(`Failed to read '${v}' from local storage!`,t)}return varnishmon.config.scraper.enabled?-1:0}()),r.addEventListener("change",(t=>{!function(t){if(_(t))try{localStorage.setItem(v,t)}catch(t){console.error(`Failed to write '${v}' to local storage!`,t)}else console.error("Invalid refresh interval value!",t)}(parseInt(t.target.value,10))}));const n=document.getElementById("filter");n.value=function(){try{let t=localStorage.getItem(b);if(null!=t)return t}catch(t){console.error(`Failed to read '${b}' from local storage!`,t)}return""}(),n.addEventListener("change",(t=>{!function(t){try{localStorage.setItem(b,t)}catch(t){console.error(`Failed to write '${b}' to local storage!`,t)}}(t.target.value)}));const i=document.getElementById("verbosity");t(i,A,function(){try{let t=localStorage.getItem(k);if(null!=t&&M(t))return t}catch(t){console.error(`Failed to read '${k}' from local storage!`,t)}return"normal"}()),i.addEventListener("change",(t=>{!function(t){if(M(t))try{localStorage.setItem(k,t)}catch(t){console.error(`Failed to write '${k}' to local storage!`,t)}else console.error("Invalid verbosity value!",t)}(t.target.value)}));const a=document.getElementById("columns");t(a,E,function(){try{let t=localStorage.getItem(S);if(null!=t&&(t=parseInt(t,10),C(t)))return t}catch(t){console.error(`Failed to read '${S}' from local storage!`,t)}return 3}()),a.addEventListener("change",(t=>{!function(t){if(C(t))try{localStorage.setItem(S,t)}catch(t){console.error(`Failed to write '${S}' to local storage!`,t)}else console.error("Invalid columns value!",t)}(parseInt(t.target.value,10))}));const o=document.getElementById("aggregator");t(o,L,function(){try{let t=localStorage.getItem(I);if(null!=t&&P(t))return t}catch(t){console.error(`Failed to read '${I}' from local storage!`,t)}return"avg"}()),o.addEventListener("change",(t=>{!function(t){if(P(t))try{localStorage.setItem(I,t)}catch(t){console.error(`Failed to write '${I}' to local storage!`,t)}else console.error("Invalid aggregator value!",t)}(t.target.value)}));const s=document.getElementById("step");s.min=D(),s.value=function(){try{let t=localStorage.getItem(z);if(null!=t&&(t=parseInt(t,10),O(t)))return t}catch(t){console.error(`Failed to read '${z}' from local storage!`,t)}return varnishmon.config.scraper.enabled?varnishmon.config.scraper.period:60}(),s.addEventListener("change",(t=>{const e=parseInt(t.target.value,10),r=D();e>=r?function(t){if(O(t))try{localStorage.setItem(z,t)}catch(t){console.error(`Failed to write '${z}' to local storage!`,t)}else console.error("Invalid columns value!",t)}(e):(t.stopPropagation(),s.value=r,u("error",`Step must be at least ${r} seconds`))}))}function Ct(){let t=parseInt(document.getElementById("refresh-interval").value,10);return t<0&&(t=It()),t}function It(){let t=parseInt(document.getElementById("step").value,10);const e=D();return t{"Enter"===t.key&&document.getElementById("apply-time-range").click()})),document.getElementById("range-to").addEventListener("keydown",(t=>{"Enter"===t.key&&document.getElementById("apply-time-range").click()})),document.getElementById("apply-time-range").addEventListener("click",(t=>{const e=document.getElementById("range");if(!e.timeRangePicker.hasValidDates())return t.stopPropagation(),void u("error","The selected time range is invalid. ISO 8601 and relative expressions like 'now-1h', 'now', 'now-1d', etc. are allowed.");!function(t,e){y(f,t),y(p,e)}(...e.timeRangePicker.getRawDates()),e.initialRange=null,Pt()})),document.getElementById("refresh-interval").addEventListener("change",(()=>{let t=Ct();document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart.setRefreshInterval(t)}))})),document.getElementById("refresh").addEventListener("click",(()=>{document.getElementById("clusters").querySelectorAll(".chart").forEach((t=>{t.chart.refresh()}))})),document.getElementById("filter").addEventListener("input",s(zt,500)),document.getElementById("verbosity").addEventListener("change",zt),document.getElementById("columns").addEventListener("change",zt),document.getElementById("filter").addEventListener("change",(t=>{const e=t.target.value;if(e){const t=T(),r=t.indexOf(e);0!==r&&(-1!==r&&t.splice(r,1),t.unshift(e),t.length>10&&t.pop(),function(t){try{localStorage.setItem(w,JSON.stringify(t))}catch(t){console.error(`Failed to write '${w}' to local storage!`,t)}}(t)),Dt()}})),document.getElementById("aggregator").addEventListener("change",(t=>{document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart.setAggregator(t.target.value)}))})),document.getElementById("step").addEventListener("change",(()=>{const t=It();document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart.setStep(t)}))})),document.getElementById("reset").addEventListener("click",(()=>{!function(){for(let t=localStorage.length-1;t>=0;t--)try{const e=localStorage.key(t);e.startsWith(h)&&localStorage.removeItem(e)}catch(t){console.error("Failed to remove item from local storage!",t)}}(),location.reload()})),document.getElementById("collapse-all").addEventListener("click",(()=>{document.getElementById("clusters").querySelectorAll(".cluster").forEach((t=>{e().getInstance(t.querySelector(".accordion-collapse")).hide(),t.querySelector(".accordion-button").classList.add("collapsed")}))})),document.getElementById("expand-all").addEventListener("click",(()=>{document.getElementById("clusters").querySelectorAll(".cluster").forEach((t=>{e().getInstance(t.querySelector(".accordion-collapse")).show(),t.querySelector(".accordion-button").classList.remove("collapsed")}))}))}async function Pt(){const t=document.getElementById("clusters");t.querySelectorAll(".chart").forEach((t=>{t.chart.destroy()})),t.innerHTML="",t.appendChild(document.getElementById("spinner-template").content.cloneNode(!0).firstElementChild);const r=document.getElementById("range").timeRangePicker.getDatesFactory(),n=Ct(),i=document.getElementById("aggregator").value,a=It();let o;try{const[t,e]=r();o=await async function(t,e,r){const n=new URLSearchParams({from:l(t),to:l(e),step:r}),i=await fetch(`/storage/metrics?${n.toString()}`);if(!i.ok)throw new Error(`Unexpected API response (${i.status}): ${i.statusText}`);const a=await i.json();return{from:c(a.from),to:c(a.to),step:a.step,clusters:B(a.metrics)}}(t,e,a)}catch(e){return t.innerHTML="",t.appendChild(document.getElementById("metrics-meditation-template").content.cloneNode(!0).firstElementChild),void u("error",`Failed to fetch metrics: ${e}`)}const s=o.clusters.length;u("info",`Fetched ${o.clusters.reduce(((t,e)=>t+e.metrics.length),0)} metrics organized in ${s} clusters`);const h=document.getElementById("cluster-template"),f=document.getElementById("chart-template");t.innerHTML="",o.clusters.forEach((o=>{const s=h.content.cloneNode(!0).firstElementChild;s.querySelector(".cluster-name").textContent=o.name,t.appendChild(s);const l=new(e())(s.querySelector(".accordion-collapse"));s.querySelector(".accordion-button").addEventListener("click",(t=>{t.currentTarget.classList.toggle("collapsed"),l.toggle()}));const c=s.querySelector(".charts");o.metrics.forEach((t=>{const e=f.content.cloneNode(!0).firstElementChild,o=new Y(e,t,r,n,i,a);o.addEventListener("zoom",(t=>{document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart!==t.target&&e.chart.setZoomRange(t.range)}));const e=document.getElementById("range");null!=t.range?(null==e.initialRange&&(e.initialRange=e.timeRangePicker.getRawDates()),e.timeRangePicker.setDates(...t.range)):null!=e.initialRange&&(e.timeRangePicker.setDates(...e.initialRange),e.initialRange=null)})),e.chart=o,c.appendChild(e)}))})),zt()}function zt(){const t=document.getElementById("clusters");t.querySelectorAll(".chart").forEach((t=>{t.chart.redraw(document.getElementById("filter").value,document.getElementById("verbosity").value,parseInt(document.getElementById("columns").value,10))})),t.querySelectorAll(".cluster").forEach((t=>{0===t.querySelectorAll(".chart:not(.d-none)").length?t.classList.add("d-none"):t.classList.remove("d-none")}));const e=t.querySelectorAll(".cluster").length,r=t.querySelectorAll(".cluster:not(.d-none)").length,n=t.querySelectorAll(".chart").length,i=t.querySelectorAll(".chart:not(.d-none)").length;document.getElementById("filter-stats").textContent=`${i} metrics found (${n-i} hidden), organized in ${r} clusters (${e-r} hidden)`}function Dt(){const t=document.getElementById("filterHistoryList");t.innerHTML="",T().forEach((e=>{const r=document.createElement("li");r.classList.add("dropdown-item"),r.textContent=e,r.addEventListener("click",(()=>{const t=document.getElementById("filter");t.value=e,t.dispatchEvent(new Event("change")),zt()})),t.appendChild(r)}))}document.addEventListener("DOMContentLoaded",(async()=>{!function(){const t=new MutationObserver(((e,r)=>{for(const r of e)"childList"===r.type&&r.addedNodes.forEach((e=>{if(e.classList&&e.classList.contains("plotly-notifier")){e.style.display="none",t.disconnect(),e.querySelectorAll(".notifier-note").forEach((t=>{u("info",t.querySelector("span").innerText)}));const r=new MutationObserver(((t,e)=>{for(const e of t)"childList"===e.type&&e.addedNodes.forEach((t=>{t.classList&&t.classList.contains("notifier-note")&&u("info",t.querySelector("span").innerText)}))}));r.observe(e,{childList:!0})}}))}));t.observe(document.body,{childList:!0})}(),document.getElementById("range").timeRangePicker=new St(document.getElementById("range-from"),document.getElementById("range-to")),Et(),Lt(),new(i())(document.getElementById("filterHistoryList")),Dt(),Pt()}))})()})(); \ No newline at end of file +*/return window.Plotly=t,t},t.exports?t.exports=r():e.moduleName=r()},812:function(t,e){ +/*! + * Bootstrap sanitizer.js v5.3.3 (https://getbootstrap.com/) + * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +!function(t){"use strict";const e={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),n=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,i=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!r.has(i)||Boolean(n.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))};function a(t,e,r){if(!t.length)return t;if(r&&"function"==typeof r)return r(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),a=[].concat(...n.body.querySelectorAll("*"));for(const t of a){const r=t.nodeName.toLowerCase();if(!Object.keys(e).includes(r)){t.remove();continue}const n=[].concat(...t.attributes),a=[].concat(e["*"]||[],e[r]||[]);for(const e of n)i(e,a)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}t.DefaultAllowlist=e,t.sanitizeHtml=a,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(e)},956:function(t,e,r){ +/*! + * Bootstrap event-handler.js v5.3.3 (https://getbootstrap.com/) + * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +t.exports=function(t){"use strict";const e=/[^.]*(?=\..*)\.|.*/,r=/\..*/,n=/::\d+$/,i={};let a=1;const o={mouseenter:"mouseover",mouseleave:"mouseout"},s=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function l(t,e){return e&&`${e}::${a++}`||t.uidEvent||a++}function c(t){const e=l(t);return t.uidEvent=e,i[e]=i[e]||{},i[e]}function u(t,e){return function r(n){return x(n,{delegateTarget:t}),r.oneOff&&v.off(t,n.type,e),e.apply(t,[n])}}function h(t,e,r){return function n(i){const a=t.querySelectorAll(e);for(let{target:o}=i;o&&o!==this;o=o.parentNode)for(const s of a)if(s===o)return x(i,{delegateTarget:o}),n.oneOff&&v.off(t,i.type,e,r),r.apply(o,[i])}}function f(t,e,r=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===r))}function p(t,e,r){const n="string"==typeof e,i=n?r:e||r;let a=y(t);return s.has(a)||(a=t),[n,i,a]}function d(t,r,n,i,a){if("string"!=typeof r||!t)return;let[s,d,m]=p(r,n,i);if(r in o){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};d=t(d)}const g=c(t),y=g[m]||(g[m]={}),v=f(y,d,s?n:null);if(v)return void(v.oneOff=v.oneOff&&a);const x=l(d,r.replace(e,"")),_=s?h(t,n,d):u(t,d);_.delegationSelector=s?n:null,_.callable=d,_.oneOff=a,_.uidEvent=x,y[x]=_,t.addEventListener(m,_,s)}function m(t,e,r,n,i){const a=f(e[r],n,i);a&&(t.removeEventListener(r,a,Boolean(i)),delete e[r][a.uidEvent])}function g(t,e,r,n){const i=e[r]||{};for(const[a,o]of Object.entries(i))a.includes(n)&&m(t,e,r,o.callable,o.delegationSelector)}function y(t){return t=t.replace(r,""),o[t]||t}const v={on(t,e,r,n){d(t,e,r,n,!1)},one(t,e,r,n){d(t,e,r,n,!0)},off(t,e,r,i){if("string"!=typeof e||!t)return;const[a,o,s]=p(e,r,i),l=s!==e,u=c(t),h=u[s]||{},f=e.startsWith(".");if(void 0===o){if(f)for(const r of Object.keys(u))g(t,u,r,e.slice(1));for(const[r,i]of Object.entries(h)){const a=r.replace(n,"");l&&!e.includes(a)||m(t,u,s,i.callable,i.delegationSelector)}}else{if(!Object.keys(h).length)return;m(t,u,s,o,a?r:null)}},trigger(e,r,n){if("string"!=typeof r||!e)return null;const i=t.getjQuery();let a=null,o=!0,s=!0,l=!1;r!==y(r)&&i&&(a=i.Event(r,n),i(e).trigger(a),o=!a.isPropagationStopped(),s=!a.isImmediatePropagationStopped(),l=a.isDefaultPrevented());const c=x(new Event(r,{bubbles:o,cancelable:!0}),n);return l&&c.preventDefault(),s&&e.dispatchEvent(c),c.defaultPrevented&&a&&a.preventDefault(),c}};function x(t,e={}){for(const[r,n]of Object.entries(e))try{t[r]=n}catch(e){Object.defineProperty(t,r,{configurable:!0,get:()=>n})}return t}return v}(r(35))},982:function(t,e,r){ +/*! + * Bootstrap template-factory.js v5.3.3 (https://getbootstrap.com/) + * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +t.exports=function(t,e,r,n){"use strict";const i="TemplateFactory",a={allowList:r.DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},o={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},s={entry:"(string|element|function|null)",selector:"(string|element)"};class l extends e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return a}static get DefaultType(){return o}static get NAME(){return i}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,r]of Object.entries(this._config.content))this._setContent(t,r,e);const e=t.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&e.classList.add(...r.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,r]of Object.entries(t))super._typeCheckConfig({selector:e,entry:r},s)}_setContent(e,r,i){const a=t.findOne(i,e);a&&((r=this._resolvePossibleFunction(r))?n.isElement(r)?this._putElementInTemplate(n.getElement(r),a):this._config.html?a.innerHTML=this._maybeSanitize(r):a.textContent=r:a.remove())}_maybeSanitize(t){return this._config.sanitize?r.sanitizeHtml(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return n.execute(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}return l}(r(411),r(105),r(812),r(35))},990:()=>{"use strict";"function"!=typeof Object.assign&&(Object.assign=function(t){for(var e=[],r=1;r{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t=r(647),e=r.n(t),n=r(453),i=r.n(n),a=r(653),o=r.n(a);function s(t,e){let r;return function(...n){const i=this;clearTimeout(r),r=setTimeout((()=>t.apply(i,n)),e)}}function l(t){return Math.round(t.getTime()/1e3)}function c(t){return new Date(1e3*t)}function u(t,e){const r=document.getElementById("notifications"),n=document.getElementById("notification-template").content.cloneNode(!0).firstElementChild,i=n.querySelector(".btn-close");let a="";"info"===t?(n.classList.add("bg-primary","text-white"),i.classList.add("btn-close-white"),a="fa-circle-info"):"success"===t?(n.classList.add("bg-success","text-white"),i.classList.add("btn-close-white"),a="fa-circle-check"):"warning"===t?(n.classList.add("bg-warning","text-body"),a="fa-circle-exclamation"):"error"===t?(n.classList.add("bg-danger","text-white"),i.classList.add("btn-close-white"),a="fa-circle-exclamation"):(n.classList.add("bg-secondary","text-white"),i.classList.add("btn-close-white"),a="fa-comment"),n.querySelector(".toast-body").innerHTML=` `+e,r.appendChild(n);new(o())(n,{autohide:!0,delay:1e4}).show(),n.addEventListener("hidden.bs.toast",(()=>{n.remove()}))}const h="varnishmon.",f=`${h}time-range-from`,p=`${h}time-range-to`,d=["now-1h","now"];function m(t=!1){if(!t){const t=g(f),e=g(p);if(null!=t&&null!=e)return[t,e]}return varnishmon.config.scraper.enabled?d:[c(varnishmon.storage.earliest),c(varnishmon.storage.latest)]}function g(t){try{let e=localStorage.getItem(t);if(null!=e)return e}catch(e){console.error(`Failed to read '${t}' from local storage!`,e)}return null}function y(t,e){e instanceof Date&&(e=e.toISOString());try{localStorage.setItem(t,e)}catch(e){console.error(`Failed to write '${t}' to local storage!`,e)}}const v=`${h}refresh-interval`,x=[[-1,"auto"],[0,"disabled"],[1,"1s"],[2,"2s"],[3,"3s"],[4,"4s"],[5,"5s"],[10,"10s"],[15,"15s"],[30,"30s"],[60,"1m"]];function _(t){return Number.isInteger(t)&&x.map((t=>t[0])).includes(t)}const b=`${h}filter`,w=`${h}filter-history`;function T(){try{let t=localStorage.getItem(w);if(null!=t)return JSON.parse(t)}catch(t){console.error(`Failed to read '${w}' from local storage!`,t)}return[]}const k=`${h}verbosity`,A=["normal","debug"];function M(t){return A.includes(t)}const S=`${h}columns`,E=[1,2,3,4,6,12];function C(t){return Number.isInteger(t)&&E.includes(t)}const I=`${h}aggregator`,L=["avg","min","max","first","last","count"];function P(t){return L.includes(t)}const z=`${h}step`;function D(){return varnishmon.config.scraper.enabled?varnishmon.config.scraper.period:1}function O(t){return Number.isInteger(t)&&t>=D()}const R=[/^MGT[.](?!(?:uptime)$)/,new RegExp("MAIN[.](?!(?:"+["backend_busy","backend_conn","backend_fail","backend_recycle","backend_req","backend_retry","backend_reuse","backend_unhealthy","backend_wait_fail","backend_wait","bans_lurker_obj_killed_cutoff","bans_lurker_obj_killed","bans_obj_killed","bans","bgfetch_no_thread","busy_killed","busy_sleep","busy_wakeup","c_ykey_purges","cache_hit_grace","cache_hit","cache_hitmiss","cache_hitpass","cache_miss","client_req_400","client_req_417","client_req","client_resp_500","esi_errors","esi_maxdepth","esi_req","esi_warnings","fetch_1xx","fetch_204","fetch_304","fetch_bad","fetch_chunked","fetch_eof","fetch_failed","fetch_fast304","fetch_head","fetch_length","fetch_none","fetch_stale_deliver","fetch_stale_rearm","g_mem_file","g_mem_private","g_mem_rss","g_mem_swap","goto_dns_cache_hits","goto_dns_lookup_fails","goto_dns_lookups","losthdr","n_backend","n_expired","n_gunzip","n_gzip","n_lru_limited","n_lru_moved","n_lru_nuked","n_obj_purged","n_object_hitmiss","n_object_hitpass","n_object","n_objectcore","n_objecthead","n_purges","n_test_gunzip","n_vcl","req_dropped","req_reset","s_fetch","s_pass","s_pipe_hdrbytes","s_pipe_in","s_pipe_out","s_pipe","s_req_bodybytes","s_req_hdrbytes","s_resp_bodybytes","s_resp_hdrbytes","s_sess","s_synth","sc_bankrupt","sc_rapid_reset","sc_sock_closed","sc_vcl_failure","sess_closed_err","sess_closed","sess_conn","sess_drop","sess_dropped","sess_fail_ebadf","sess_fail_econnaborted","sess_fail_eintr","sess_fail_emfile","sess_fail_enomem","sess_fail_other","sess_fail","sess_herd","sess_queued","sess_readahead","shm_cont","shm_cycles","shm_flushes","shm_records","thread_queue_len","threads_created","threads_destroyed","threads_failed","threads_limited","threads","uptime","vcl_fail","vmods","ws_backend_overflow","ws_client_overflow","ws_session_overflow","ws_thread_overflow"].join("|")+")$)"),new RegExp("MSE[.](?!.*[.](?:"+["c_fail","c_memcache_hit","c_memcache_miss","c_ykey_purged","g_bytes","g_space","g_sparenode","g_ykey_keys","n_lru_moved","n_lru_nuked","n_vary"].join("|")+")$)"),new RegExp("MSE_BOOK[.](?!.*[.](?:"+["c_insert_timeout","c_waterlevel_purge","c_waterlevel_queue","c_waterlevel_runs","g_banlist_bytes","g_banlist_space","g_bytes","g_space","n_vary"].join("|")+")$)"),new RegExp("MSE_STORE[.](?!.*[.](?:"+["c_aio_finished_bytes_read","c_aio_finished_bytes_write","c_aio_finished_read","c_aio_finished_write","c_waterlevel_purge","c_waterlevel_queue","g_alloc_bytes","g_free_bytes","g_objects","g_ykey_keys"].join("|")+")$)"),new RegExp("MSE4[.](?!(?:"+["g_varyspec","g_ykey_keys","c_ykey_purged"].join("|")+")$)"),new RegExp("MSE4_MEM[.](?!(?:"+["c_allocation","c_allocation_buffer","c_allocation_ephemeral","c_allocation_failure","c_allocation_pass","c_allocation_persisted","c_allocation_reqbody","c_allocation_synthetic","c_eviction","c_eviction_failure","c_eviction_reorder","c_free","c_free_buffer","c_free_ephemeral","c_free_pass","c_free_persisted","c_free_reqbody","c_free_synthetic","c_memcache_hit","c_memcache_miss","g_allocations","g_bytes","g_bytes_buffer","g_bytes_ephemeral","g_bytes_pass","g_bytes_persisted","g_bytes_reqbody","g_bytes_synthetic","g_objects","g_objects_ephemeral","g_objects_pass","g_objects_persisted","g_objects_reqbody","g_objects_synthetic","g_space"].join("|")+")$)"),new RegExp("MSE4_BOOK[.](?!.*[.](?:"+["c_freeslot_queued","c_submitslot_queued","c_ykey_purged","g_freeslot_queue","g_objects","g_slots_unused","g_slots_used","g_submitslot_queue","g_unreachable_objects","g_varyspec","g_ykey_keys","online"].join("|")+")$)"),new RegExp("MSE4_STORE[.](?!.*[.](?:"+["online","g_bytes_used","g_bytes_unused","g_objects","g_allocation_queue","c_allocation_queued","g_io_queued","g_io_queued_read","g_io_queued_write","c_io_finished_read","c_io_finished_write","c_io_finished_bytes_read","c_io_finished_bytes_write","g_io_blocked_read","g_io_blocked_write","c_io_limited"].join("|")+")$)"),new RegExp("MSE4_BANJRN[.](?!.*[.](?:"+["g_ban_bytes","g_bans","g_bytes","g_overflow_ban_bytes","g_overflow_bans","g_space"].join("|")+")$)"),new RegExp("MSE4_CAT[.](?!.*[.](?:"+["c_allocation","c_allocation_ephemeral","c_allocation_pass","c_allocation_persisted","c_eviction","c_eviction_failure","c_eviction_reorder","c_free","c_free_ephemeral","c_free_pass","c_free_persisted","c_memcache_hit","c_memcache_miss","g_allocations","g_bytes","g_bytes_ephemeral","g_bytes_pass","g_bytes_persisted","g_objects","g_objects_ephemeral","g_objects_pass","g_objects_persisted"].join("|")+")$)"),new RegExp("SMA[.](?!.*[.](?:"+["c_bytes","c_fail","c_freed","c_req","g_alloc","g_bytes","g_space"].join("|")+")$)"),new RegExp("SMF[.](?!.*[.](?:"+["c_bytes","c_fail","c_freed","c_req","g_alloc","g_bytes","g_smf_frag","g_smf_large","g_smf","g_space"].join("|")+")$)"),new RegExp("SMU[.](?!.*[.](?:"+["c_bytes","c_fail","c_freed","c_req","g_alloc","g_bytes","g_space"].join("|")+")$)"),/^BROTLI[.]/,/^SLICER[.]/,new RegExp("VMOD_HTTP[.](?!(?:"+["handle_abandon","handle_completed","handle_internal_error","handle_limited","handle_requests"].join("|")+")$)"),new RegExp("KVSTORE[.](?!.*[.](?:"+[].join("|")+")$)"),new RegExp("ACCG[.](?!.*[.](?:"+["backend_200_count","backend_2xx_count","backend_304_count","backend_3xx_count","backend_404_count","backend_4xx_count","backend_503_count","backend_5xx_count","backend_req_bodybytes","backend_req_count","backend_req_hdrbytes","backend_resp_bodybytes","backend_resp_hdrbytes","client_200_count","client_2xx_count","client_304_count","client_3xx_count","client_404_count","client_4xx_count","client_503_count","client_5xx_count","client_grace_hit_count","client_hit_count","client_hit_req_bodybytes","client_hit_req_hdrbytes","client_hit_resp_bodybytes","client_hit_resp_hdrbytes","client_miss_count","client_miss_req_bodybytes","client_miss_req_hdrbytes","client_miss_resp_bodybytes","client_miss_resp_hdrbytes","client_pass_count","client_pass_req_bodybytes","client_pass_req_hdrbytes","client_pass_resp_bodybytes","client_pass_resp_hdrbytes","client_pipe_count","client_pipe_req_bodybytes","client_pipe_req_hdrbytes","client_pipe_resp_bodybytes","client_pipe_resp_hdrbytes","client_req_bodybytes","client_req_count","client_req_hdrbytes","client_resp_bodybytes","client_resp_hdrbytes","client_synth_count","client_synth_req_bodybytes","client_synth_req_hdrbytes","client_synth_resp_bodybytes","client_synth_resp_hdrbytes"].join("|")+")$)"),new RegExp("ACCG_DIAG[.](?!.*[.](?:"+["bereq_dropped","create_namespace_failure","key_without_namespace","namespace_already_set","namespace_undefined","out_of_key_slots","req_dropped","set_key_failure"].join("|")+")$)"),new RegExp("VBE[.](?!.*[.](?:"+["bereq_bodybytes","bereq_hdrbytes","beresp_bodybytes","beresp_hdrbytes","busy","conn","fail","happy","is_healthy","pipe_hdrbytes","pipe_in","pipe_out","req","unhealthy"].join("|")+")$)"),/^WAITER[.]/,/^MEMPOOL[.]/,/^LCK[.]/],F=[/^(MAIN[.]backend)/,/^(MAIN[.]bans)_?/,/^(MAIN[.]cache)/,/^(MAIN[.]client)/,/^(MAIN[.]esi_)/,/^(MAIN[.]fetch)/,/^(MAIN[.]g_mem)/,/^(MAIN[.]s_)/,/^(MAIN[.]sc_)/,/^(MAIN[.]sess_)/,/^(MAIN[.]shm_)/,/^(MAIN[.]thread)s?_?/,/^(MAIN[.]vgs_)/,/^(MAIN[.]ws_)/,/^(WAITER[.])/,/^(MEMPOOL[.])/,/^(LCK[.])/],j=[/^MGT[.]/,/^MAIN[.][*]$/,/^MAIN[.]/,/^MSE[.]/,/^MSE_/,/^MSE4[.]/,/^MSE4_/,/^SMA[.]/,/^SMF[.]/,/^SMU[.]/,/^BROTLI[.]/,/^SLICER[.]/,/^VMOD_/,/^KVSTORE[.]/,/^ACCG[.]/,/^ACCG_DIAG[.]/,/^VBE[.]/,/^WAITER[.]/,/^MEMPOOL[.]/,/^LCK[.]/];function B(t){t.sort(((t,e)=>t.name.localeCompare(e.name))),function(t){t.forEach((t=>{t.debug=-1!==R.findIndex((e=>e.test(t.name)))}))}(t);const e=function(t){const e={};return t.forEach((t=>{let r="";for(let e of F){const n=t.name.match(e);if(n&&n[1]){r=n[1]+"*";break}}if(""===r){const e=t.name.split(".");e.length>1&&(r=e.slice(0,-1).join(".")+".*")}e[r]||(e[r]=[]),e[r].push(t)})),Object.keys(e).map((t=>({name:t,metrics:e[t]})))}(t);return e.sort(((t,e)=>{const r=j.findIndex((e=>e.test(t.name))),n=j.findIndex((t=>t.test(e.name)));return-1!==r&&-1!==n?r-n:-1!==r?-1:-1!==n?1:t.name.localeCompare(e.name)})),e}function N(t,e){const r=t.sort(((t,e)=>t[0]-e[0])),n=[];for(let t=0;t{t.forEach((t=>{t.target.chart.handleVisibilityChange(t.isIntersecting)}))}),{threshold:.1}),Z=new ResizeObserver((t=>{t.forEach((t=>{t.target.chart.handleSizeChange()}))})),W={fixedrange:!1,griddash:"dash",autorange:!1,showspikes:!0,spikemode:"across",spikesnap:"cursor",spikedash:"dot",spikethickness:1};const Y=class{constructor(t,e,r,n,i,a){this.container=t,this.metric=e,this.rangeFactory=r,this.refreshInterval=n,this.aggregator=i,this.step=a,this.listeners={},this.initializing=!1,this.refreshing=!1,this.debouncedHandleRefresh=s(this.handleRefresh.bind(this),500),this.visible=!1,this.interval=null,this.lastRefresh=0,this.pendingRefresh=!1,this.error=null,this.graph={element:null,x:null,y:null,step:null,range:null,zoomRange:null},G.observe(this.container),Z.observe(this.container)}async init(){if(!this.initializing){this.initializing=!0;try{this.processMetric(await this.getMetric()),this.graph.element=this.renderGraph(),this.setupInterval(),this.lastRefresh=l(new Date),this.pendingRefresh=!1}catch(t){this.setError(`Failed to fetch samples of a metric: ${t}`)}finally{this.initializing=!1}}}async handleRefresh(){if(!this.refreshing){this.refreshing=!0;try{if(null!=this.graph.element&&(this.pendingRefresh=!0,this.visible))try{this.processMetric(await this.getMetric()),this.updateGraph(!1),this.clearError(),this.lastRefresh=l(new Date),this.pendingRefresh=!1}catch(t){this.setError(`Failed to fetch samples of a metric: ${t}`)}}finally{this.refreshing=!1}}}handleVisibilityChange(t){this.visible=t,this.visible?null==this.graph.element?this.init():(null==this.interval&&this.setupInterval(),(this.pendingRefresh||this.refreshInterval>0&&l(new Date)-this.lastRefresh>this.refreshInterval)&&this.debouncedHandleRefresh()):this.stopInterval()}handleSizeChange(){null!=this.graph.element&&this.debouncedHandleRefresh()}handleGraphRelayout(t){if(t["xaxis.range[0]"]&&t["xaxis.range[1]"]?this.graph.zoomRange=[new Date(t["xaxis.range[0]"]),new Date(t["xaxis.range[1]"])]:(t["xaxis.range"]&&Array.isArray(t["xaxis.range"])&&t["xaxis.range"].length,this.graph.zoomRange=null),null!=this.graph.zoomRange&&(l(this.graph.zoomRange[0])l(this.graph.range[1])&&(this.graph.zoomRange[1]=this.graph.range[1])),null!=this.graph.zoomRange){const t=l(this.graph.zoomRange[1])-l(this.graph.zoomRange[0]);if(tt!==e)))}notifyEventListeners(t,e){this.listeners[t]&&this.listeners[t].forEach((t=>t(e)))}redraw(t,e,r){let n="normal"===e&&this.metric.debug;if(!n){const e=t.split(/\s+/).filter((t=>t.length>0));e.length>0&&(n=!e.some((t=>this.metric.name.includes(t))))}this.container.classList.toggle("d-none",n),this.container.classList.forEach((t=>{t.startsWith("col-")&&this.container.classList.remove(t)})),this.container.classList.add("col-"+12/r)}setRefreshInterval(t){this.refreshInterval=t,this.visible&&null!=this.graph.element&&this.setupInterval()}refresh(){null!=this.graph.element&&(this.visible&&this.setupInterval(),this.handleRefresh())}setAggregator(t){this.aggregator=t,null!=this.graph.element&&(this.visible&&this.setupInterval(),this.handleRefresh())}setStep(t){this.step=t,null!=this.graph.element&&(this.visible&&this.setupInterval(),this.handleRefresh())}setZoomRange(t){this.graph.zoomRange=t,null!=this.graph.element&&this.updateGraph(!0)}destroy(){G.unobserve(this.container),Z.unobserve(this.container),this.stopInterval(),this.clearError(),null!=this.graph.element&&V().purge(this.graph.element)}setupInterval(){this.stopInterval(),this.refreshInterval>0&&(this.interval=setInterval(this.handleRefresh.bind(this),1e3*this.refreshInterval))}stopInterval(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}setError(t){const e=this.container.querySelector(".card"),r=e.querySelector(".error-icon");null==this.error&&(e.classList.add("border-danger"),r.classList.remove("d-none"));const n=`${(new Date).toISOString()}: ${t}`;let i=H().getInstance(r);null==i?i=new(H())(r,{title:n}):i.setContent({".tooltip-inner":n}),this.error=t}clearError(){if(null!=this.error){const t=this.container.querySelector(".card");t.classList.remove("border-danger");const e=t.querySelector(".error-icon");e.classList.add("d-none");H().getInstance(e).dispose(),this.error=null}}async getMetric(){const t=this.container.querySelector(".card .loading-icon");t.classList.remove("d-none");try{const[t,e]=this.rangeFactory(),r=this.estimateOptimalStep(t,e),n="b"===this.metric.flag?"bit_and":this.aggregator;return await async function(t,e,r,n,i){const a=new URLSearchParams({from:l(e),to:l(r),step:n,aggregator:i}),o=await fetch(`/storage/metrics/${t}?${a.toString()}`);if(!o.ok)throw new Error(`Unexpected API response (${o.status}): ${o.statusText}`);const s=await o.json();return{from:c(s.from),to:c(s.to),step:s.step,samples:N(s.samples,s.step)}}(this.metric.id,t,e,r,n)}finally{t.classList.add("d-none")}}estimateOptimalStep(t,e){const r=(l(e)-l(t))/this.step,n=this.container.clientWidth,i=Math.floor(.9*n);if(i<=0)throw new Error("Failed to estimate the optimal step");return r<=i?this.step:Math.ceil(r/i)*this.step}processMetric(t){this.graph.x=[],this.graph.y=[],t.samples.forEach((t=>{this.graph.x.push(t[0]),this.graph.y.push("b"===this.metric.flag?BigInt(`0x${t[1]}`).toString(2).split("").filter((t=>"1"===t)).length:t[1])})),this.graph.step=t.step,this.graph.range=[t.from,new Date(t.to.getTime()-1e3*t.step)];const e=this.container.querySelector(".card .step-factor");if(this.graph.step!==this.step){const t=Math.round(this.graph.step/this.step);e.innerHTML=` ${t}x`}else e.innerHTML=""}renderGraph(){const t=null!=this.graph.zoomRange?this.graph.zoomRange:this.graph.range,e=[{x:this.graph.x,y:this.graph.y,type:"scatter",mode:this.estimatePlotlyDataMode(...t,this.graph.step),marker:{size:4},hovertemplate:"X: %{x|%Y-%m-%d %H:%M:%S}
Y: %{y:,.1f}",connectgaps:!1,line:{shape:"linear",width:2}}],r={autosize:!0,title:{text:this.metric.name,font:{size:14},subtitle:{text:this.metric.description}},margin:{l:60,r:10,b:40,t:40,pad:5},hovermode:"closest",xaxis:{...W,range:Array.from(t)},yaxis:{fixedrange:!0,griddash:"dash",rangemode:"normal",title:(()=>{if("c"===this.metric.flag)return"d"===this.metric.format?"seconds":"B"===this.metric.format?"Bps":"eps";if("g"===this.metric.flag){if("d"===this.metric.format)return"seconds";if("B"===this.metric.format)return"bytes"}return""})()}},n={responsive:!0,displaylogo:!1,modeBarButtons:[["zoomIn2d","zoomOut2d","resetScale2d"],[{name:"download",title:"Download plot",icon:V().Icons.disk,click:t=>{V().downloadImage(t,{filename:`${varnishmon.storage.hostname} - ${this.metric.name}`,format:"png",width:null,height:null,scale:1}).then((()=>{u("info","Plot ready for download")})).catch((t=>{u("error",`Failed to download plot: ${t}`)}))}},{name:"copy-to-clipboard",title:"Copy plot to clipboard",icon:V().Icons.camera,click:t=>{V().toImage(t,{format:"png",width:null,height:null,scale:1}).then((t=>{fetch(t).then((t=>{t.blob().then((t=>{navigator.clipboard.write([new ClipboardItem({"image/png":t})]).then((()=>{u("info","Plot copied to clipboard")})).catch((t=>{u("error",`Failed to copy plot to clipboard: ${t}`)}))}))}))}))}}]],scrollZoom:!1},i=this.container.querySelector(".graph");return V().newPlot(i,e,r,n),i.on("plotly_relayout",this.handleGraphRelayout.bind(this)),i}updateGraph(t){const e=null!=this.graph.zoomRange?this.graph.zoomRange:this.graph.range,r={mode:this.estimatePlotlyDataMode(...e,this.graph.step)};t||(r.x=[this.graph.x],r.y=[this.graph.y]);const n={xaxis:{...W,range:Array.from(e)}};V().update(this.graph.element,r,n)}estimatePlotlyDataMode(t,e,r){const n=(l(e)-l(t))/r,i=this.container.clientWidth;return n>Math.floor(.9*i/6)?"lines":"lines+markers"}};var X=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var r=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},J={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};const K=J;var Q=function(t,e){return void 0===e&&(e=2),("000"+t).slice(-1*e)},tt=function(t){return!0===t?1:0};function et(t,e){var r;return function(){var n=this,i=arguments;clearTimeout(r),r=setTimeout((function(){return t.apply(n,i)}),e)}}var rt=function(t){return t instanceof Array?t:[t]};function nt(t,e,r){if(!0===r)return t.classList.add(e);t.classList.remove(e)}function it(t,e,r){var n=window.document.createElement(t);return e=e||"",r=r||"",n.className=e,void 0!==r&&(n.textContent=r),n}function at(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ot(t,e){return e(t)?t:t.parentNode?ot(t.parentNode,e):void 0}function st(t,e){var r=it("div","numInputWrapper"),n=it("input","numInput "+t),i=it("span","arrowUp"),a=it("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==e)for(var o in e)n.setAttribute(o,e[o]);return r.appendChild(n),r.appendChild(i),r.appendChild(a),r}function lt(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}var ct=function(){},ut=function(t,e,r){return r.months[e?"shorthand":"longhand"][t]},ht={D:ct,F:function(t,e,r){t.setMonth(r.months.longhand.indexOf(e))},G:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},H:function(t,e){t.setHours(parseFloat(e))},J:function(t,e){t.setDate(parseFloat(e))},K:function(t,e,r){t.setHours(t.getHours()%12+12*tt(new RegExp(r.amPM[1],"i").test(e)))},M:function(t,e,r){t.setMonth(r.months.shorthand.indexOf(e))},S:function(t,e){t.setSeconds(parseFloat(e))},U:function(t,e){return new Date(1e3*parseFloat(e))},W:function(t,e,r){var n=parseInt(e),i=new Date(t.getFullYear(),0,2+7*(n-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+r.firstDayOfWeek),i},Y:function(t,e){t.setFullYear(parseFloat(e))},Z:function(t,e){return new Date(e)},d:function(t,e){t.setDate(parseFloat(e))},h:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},i:function(t,e){t.setMinutes(parseFloat(e))},j:function(t,e){t.setDate(parseFloat(e))},l:ct,m:function(t,e){t.setMonth(parseFloat(e)-1)},n:function(t,e){t.setMonth(parseFloat(e)-1)},s:function(t,e){t.setSeconds(parseFloat(e))},u:function(t,e){return new Date(parseFloat(e))},w:ct,y:function(t,e){t.setFullYear(2e3+parseFloat(e))}},ft={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},pt={Z:function(t){return t.toISOString()},D:function(t,e,r){return e.weekdays.shorthand[pt.w(t,e,r)]},F:function(t,e,r){return ut(pt.n(t,e,r)-1,!1,e)},G:function(t,e,r){return Q(pt.h(t,e,r))},H:function(t){return Q(t.getHours())},J:function(t,e){return void 0!==e.ordinal?t.getDate()+e.ordinal(t.getDate()):t.getDate()},K:function(t,e){return e.amPM[tt(t.getHours()>11)]},M:function(t,e){return ut(t.getMonth(),!0,e)},S:function(t){return Q(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,e,r){return r.getWeek(t)},Y:function(t){return Q(t.getFullYear(),4)},d:function(t){return Q(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Q(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,e){return e.weekdays.longhand[t.getDay()]},m:function(t){return Q(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},dt=function(t){var e=t.config,r=void 0===e?$:e,n=t.l10n,i=void 0===n?J:n,a=t.isMobile,o=void 0!==a&&a;return function(t,e,n){var a=n||i;return void 0===r.formatDate||o?e.split("").map((function(e,n,i){return pt[e]&&"\\"!==i[n-1]?pt[e](t,a,r):"\\"!==e?e:""})).join(""):r.formatDate(t,e,a)}},mt=function(t){var e=t.config,r=void 0===e?$:e,n=t.l10n,i=void 0===n?J:n;return function(t,e,n,a){if(0===t||t){var o,s=a||i,l=t;if(t instanceof Date)o=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)o=new Date(t);else if("string"==typeof t){var c=e||(r||$).dateFormat,u=String(t).trim();if("today"===u)o=new Date,n=!0;else if(r&&r.parseDate)o=r.parseDate(t,c);else if(/Z$/.test(u)||/GMT$/.test(u))o=new Date(t);else{for(var h=void 0,f=[],p=0,d=0,m="";p=0?new Date:new Date(r.config.minDate.getTime()),n=xt(r.config);e.setHours(n.hours,n.minutes,n.seconds,e.getMilliseconds()),r.selectedDates=[e],r.latestSelectedDateObj=e}void 0!==t&&"blur"!==t.type&&function(t){t.preventDefault();var e="keydown"===t.type,n=lt(t),i=n;void 0!==r.amPM&&n===r.amPM&&(r.amPM.textContent=r.l10n.amPM[tt(r.amPM.textContent===r.l10n.amPM[0])]);var a=parseFloat(i.getAttribute("min")),o=parseFloat(i.getAttribute("max")),s=parseFloat(i.getAttribute("step")),l=parseInt(i.value,10),c=t.delta||(e?38===t.which?1:-1:0),u=l+s*c;if(void 0!==i.value&&2===i.value.length){var h=i===r.hourElement,f=i===r.minuteElement;uo&&(u=i===r.hourElement?u-o-tt(!r.amPM):a,f&&m(void 0,1,r.hourElement)),r.amPM&&h&&(1===s?u+l===23:Math.abs(u-l)>s)&&(r.amPM.textContent=r.l10n.amPM[tt(r.amPM.textContent===r.l10n.amPM[0])]),i.value=Q(u)}}(t);var i=r._input.value;s(),wt(),r._input.value!==i&&r._debouncedChange()}function s(){if(void 0!==r.hourElement&&void 0!==r.minuteElement){var t,e,n=(parseInt(r.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(r.minuteElement.value,10)||0)%60,a=void 0!==r.secondElement?(parseInt(r.secondElement.value,10)||0)%60:0;void 0!==r.amPM&&(t=n,e=r.amPM.textContent,n=t%12+12*tt(e===r.l10n.amPM[1]));var o=void 0!==r.config.minTime||r.config.minDate&&r.minDateHasTime&&r.latestSelectedDateObj&&0===gt(r.latestSelectedDateObj,r.config.minDate,!0),s=void 0!==r.config.maxTime||r.config.maxDate&&r.maxDateHasTime&&r.latestSelectedDateObj&&0===gt(r.latestSelectedDateObj,r.config.maxDate,!0);if(void 0!==r.config.maxTime&&void 0!==r.config.minTime&&r.config.minTime>r.config.maxTime){var l=yt(r.config.minTime.getHours(),r.config.minTime.getMinutes(),r.config.minTime.getSeconds()),u=yt(r.config.maxTime.getHours(),r.config.maxTime.getMinutes(),r.config.maxTime.getSeconds()),h=yt(n,i,a);if(h>u&&h=12)]),void 0!==r.secondElement&&(r.secondElement.value=Q(n)))}function u(t){var e=lt(t),r=parseInt(e.value)+(t.delta||0);(r/1e3>1||"Enter"===t.key&&!/[^\d]/.test(r.toString()))&&I(r)}function h(t,e,n,i){return e instanceof Array?e.forEach((function(e){return h(t,e,n,i)})):t instanceof Array?t.forEach((function(t){return h(t,e,n,i)})):(t.addEventListener(e,n,i),void r._handlers.push({remove:function(){return t.removeEventListener(e,n,i)}}))}function f(){Y("onChange")}function p(t,e){var n=void 0!==t?r.parseDate(t):r.latestSelectedDateObj||(r.config.minDate&&r.config.minDate>r.now?r.config.minDate:r.config.maxDate&&r.config.maxDate=0&>(t,r.selectedDates[1])<=0)}(e)&&!ct(e)&&o.classList.add("inRange"),r.weekNumbers&&1===r.config.showMonths&&"prevMonthDay"!==t&&i%7==6&&r.weekNumbers.insertAdjacentHTML("beforeend",""+r.config.getWeek(e)+""),Y("onDayCreate",o),o}function y(t){t.focus(),"range"===r.config.mode&&O(t)}function v(t){for(var e=t>0?0:r.config.showMonths-1,n=t>0?r.config.showMonths:-1,i=e;i!=n;i+=t)for(var a=r.daysContainer.children[i],o=t>0?0:a.children.length-1,s=t>0?a.children.length:-1,l=o;l!=s;l+=t){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&L(c.dateObj))return c}}function x(t,e){var i=n(),a=P(i||document.body),o=void 0!==t?t:a?i:void 0!==r.selectedDateElem&&P(r.selectedDateElem)?r.selectedDateElem:void 0!==r.todayDateElem&&P(r.todayDateElem)?r.todayDateElem:v(e>0?1:-1);void 0===o?r._input.focus():a?function(t,e){for(var n=-1===t.className.indexOf("Month")?t.dateObj.getMonth():r.currentMonth,i=e>0?r.config.showMonths:-1,a=e>0?1:-1,o=n-r.currentMonth;o!=i;o+=a)for(var s=r.daysContainer.children[o],l=n-r.currentMonth===o?t.$i+e:e<0?s.children.length-1:0,c=s.children.length,u=l;u>=0&&u0?c:-1);u+=a){var h=s.children[u];if(-1===h.className.indexOf("hidden")&&L(h.dateObj)&&Math.abs(t.$i-u)>=Math.abs(e))return y(h)}r.changeMonth(a),x(v(a),0)}(o,e):y(o)}function _(t,e){for(var n=(new Date(t,e,1).getDay()-r.l10n.firstDayOfWeek+7)%7,i=r.utils.getDaysInMonth((e-1+12)%12,t),a=r.utils.getDaysInMonth(e,t),o=window.document.createDocumentFragment(),s=r.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-n,h=0;u<=i;u++,h++)o.appendChild(g("flatpickr-day "+l,new Date(t,e-1,u),0,h));for(u=1;u<=a;u++,h++)o.appendChild(g("flatpickr-day",new Date(t,e,u),0,h));for(var f=a+1;f<=42-n&&(1===r.config.showMonths||h%7!=0);f++,h++)o.appendChild(g("flatpickr-day "+c,new Date(t,e+1,f%a),0,h));var p=it("div","dayContainer");return p.appendChild(o),p}function b(){if(void 0!==r.daysContainer){at(r.daysContainer),r.weekNumbers&&at(r.weekNumbers);for(var t=document.createDocumentFragment(),e=0;e1||"dropdown"!==r.config.monthSelectorType)){var t=function(t){return!(void 0!==r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&tr.config.maxDate.getMonth())};r.monthsDropdownContainer.tabIndex=-1,r.monthsDropdownContainer.innerHTML="";for(var e=0;e<12;e++)if(t(e)){var n=it("option","flatpickr-monthDropdown-month");n.value=new Date(r.currentYear,e).getMonth().toString(),n.textContent=ut(e,r.config.shorthandCurrentMonth,r.l10n),n.tabIndex=-1,r.currentMonth===e&&(n.selected=!0),r.monthsDropdownContainer.appendChild(n)}}}function T(){var t,e=it("div","flatpickr-month"),n=window.document.createDocumentFragment();r.config.showMonths>1||"static"===r.config.monthSelectorType?t=it("span","cur-month"):(r.monthsDropdownContainer=it("select","flatpickr-monthDropdown-months"),r.monthsDropdownContainer.setAttribute("aria-label",r.l10n.monthAriaLabel),h(r.monthsDropdownContainer,"change",(function(t){var e=lt(t),n=parseInt(e.value,10);r.changeMonth(n-r.currentMonth),Y("onMonthChange")})),w(),t=r.monthsDropdownContainer);var i=st("cur-year",{tabindex:"-1"}),a=i.getElementsByTagName("input")[0];a.setAttribute("aria-label",r.l10n.yearAriaLabel),r.config.minDate&&a.setAttribute("min",r.config.minDate.getFullYear().toString()),r.config.maxDate&&(a.setAttribute("max",r.config.maxDate.getFullYear().toString()),a.disabled=!!r.config.minDate&&r.config.minDate.getFullYear()===r.config.maxDate.getFullYear());var o=it("div","flatpickr-current-month");return o.appendChild(t),o.appendChild(i),n.appendChild(o),e.appendChild(n),{container:e,yearElement:a,monthElement:t}}function k(){at(r.monthNav),r.monthNav.appendChild(r.prevMonthNav),r.config.showMonths&&(r.yearElements=[],r.monthElements=[]);for(var t=r.config.showMonths;t--;){var e=T();r.yearElements.push(e.yearElement),r.monthElements.push(e.monthElement),r.monthNav.appendChild(e.container)}r.monthNav.appendChild(r.nextMonthNav)}function A(){r.weekdayContainer?at(r.weekdayContainer):r.weekdayContainer=it("div","flatpickr-weekdays");for(var t=r.config.showMonths;t--;){var e=it("div","flatpickr-weekdaycontainer");r.weekdayContainer.appendChild(e)}return M(),r.weekdayContainer}function M(){if(r.weekdayContainer){var t=r.l10n.firstDayOfWeek,e=bt(r.l10n.weekdays.shorthand);t>0&&t\n "+e.join("")+"\n \n "}}function S(t,e){void 0===e&&(e=!0);var n=e?t:t-r.currentMonth;n<0&&!0===r._hidePrevMonthArrow||n>0&&!0===r._hideNextMonthArrow||(r.currentMonth+=n,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,Y("onYearChange"),w()),b(),Y("onMonthChange"),ht())}function E(t){return r.calendarContainer.contains(t)}function C(t){if(r.isOpen&&!r.config.inline){var e=lt(t),n=E(e),i=!(e===r.input||e===r.altInput||r.element.contains(e)||t.path&&t.path.indexOf&&(~t.path.indexOf(r.input)||~t.path.indexOf(r.altInput)))&&!n&&!E(t.relatedTarget),a=!r.config.ignoredFocusElements.some((function(t){return t.contains(e)}));i&&a&&(r.config.allowInput&&r.setDate(r._input.value,!1,r.config.altInput?r.config.altFormat:r.config.dateFormat),void 0!==r.timeContainer&&void 0!==r.minuteElement&&void 0!==r.hourElement&&""!==r.input.value&&void 0!==r.input.value&&o(),r.close(),r.config&&"range"===r.config.mode&&1===r.selectedDates.length&&r.clear(!1))}}function I(t){if(!(!t||r.config.minDate&&tr.config.maxDate.getFullYear())){var e=t,n=r.currentYear!==e;r.currentYear=e||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),n&&(r.redraw(),Y("onYearChange"),w())}}function L(t,e){var n;void 0===e&&(e=!0);var i=r.parseDate(t,void 0,e);if(r.config.minDate&&i&>(i,r.config.minDate,void 0!==e?e:!r.minDateHasTime)<0||r.config.maxDate&&i&>(i,r.config.maxDate,void 0!==e?e:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&0===r.config.disable.length)return!0;if(void 0===i)return!1;for(var a=!!r.config.enable,o=null!==(n=r.config.enable)&&void 0!==n?n:r.config.disable,s=0,l=void 0;s=l.from.getTime()&&i.getTime()<=l.to.getTime())return a}return!a}function P(t){return void 0!==r.daysContainer&&(-1===t.className.indexOf("hidden")&&-1===t.className.indexOf("flatpickr-disabled")&&r.daysContainer.contains(t))}function z(t){var e=t.target===r._input,n=r._input.value.trimEnd()!==pt();!e||!n||t.relatedTarget&&E(t.relatedTarget)||r.setDate(r._input.value,!0,t.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function D(e){var i=lt(e),a=r.config.wrap?t.contains(i):i===r._input,l=r.config.allowInput,c=r.isOpen&&(!l||!a),u=r.config.inline&&a&&!l;if(13===e.keyCode&&a){if(l)return r.setDate(r._input.value,!0,i===r.altInput?r.config.altFormat:r.config.dateFormat),r.close(),i.blur();r.open()}else if(E(i)||c||u){var h=!!r.timeContainer&&r.timeContainer.contains(i);switch(e.keyCode){case 13:h?(e.preventDefault(),o(),V()):q(e);break;case 27:e.preventDefault(),V();break;case 8:case 46:a&&!r.config.allowInput&&(e.preventDefault(),r.clear());break;case 37:case 39:if(h||a)r.hourElement&&r.hourElement.focus();else{e.preventDefault();var f=n();if(void 0!==r.daysContainer&&(!1===l||f&&P(f))){var p=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),S(p),x(v(1),0)):x(void 0,p)}}break;case 38:case 40:e.preventDefault();var d=40===e.keyCode?1:-1;r.daysContainer&&void 0!==i.$i||i===r.input||i===r.altInput?e.ctrlKey?(e.stopPropagation(),I(r.currentYear-d),x(v(1),0)):h||x(void 0,7*d):i===r.currentYearElement?I(r.currentYear-d):r.config.enableTime&&(!h&&r.hourElement&&r.hourElement.focus(),o(e),r._debouncedChange());break;case 9:if(h){var m=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter((function(t){return t})),g=m.indexOf(i);if(-1!==g){var y=m[g+(e.shiftKey?-1:1)];e.preventDefault(),(y||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(i)&&e.shiftKey&&(e.preventDefault(),r._input.focus())}}if(void 0!==r.amPM&&i===r.amPM)switch(e.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],s(),wt();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],s(),wt()}(a||E(i))&&Y("onKeyDown",e)}function O(t,e){if(void 0===e&&(e="flatpickr-day"),1===r.selectedDates.length&&(!t||t.classList.contains(e)&&!t.classList.contains("flatpickr-disabled"))){for(var n=t?t.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),i=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),a=Math.min(n,r.selectedDates[0].getTime()),o=Math.max(n,r.selectedDates[0].getTime()),s=!1,l=0,c=0,u=a;ua&&ul)?l=u:u>i&&(!c||u ."+e)).forEach((function(e){var a,o,u,h=e.dateObj.getTime(),f=l>0&&h0&&h>c;if(f)return e.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(t){e.classList.remove(t)}));s&&!f||(["startRange","inRange","endRange","notAllowed"].forEach((function(t){e.classList.remove(t)})),void 0!==t&&(t.classList.add(n<=r.selectedDates[0].getTime()?"startRange":"endRange"),in&&h===i&&e.classList.add("endRange"),h>=l&&(0===c||h<=c)&&(o=i,u=n,(a=h)>Math.min(o,u)&&a0||n.getMinutes()>0||n.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter((function(t){return L(t)})),r.selectedDates.length||"min"!==t||l(n),wt()),r.daysContainer&&(U(),void 0!==n?r.currentYearElement[t]=n.getFullYear().toString():r.currentYearElement.removeAttribute(t),r.currentYearElement.disabled=!!i&&void 0!==n&&i.getFullYear()===n.getFullYear())}}function j(){return r.config.wrap?t.querySelector("[data-input]"):t}function B(){"object"!=typeof r.config.locale&&void 0===kt.l10ns[r.config.locale]&&r.config.errorHandler(new Error("flatpickr: invalid locale "+r.config.locale)),r.l10n=_t(_t({},kt.l10ns.default),"object"==typeof r.config.locale?r.config.locale:"default"!==r.config.locale?kt.l10ns[r.config.locale]:void 0),ft.D="("+r.l10n.weekdays.shorthand.join("|")+")",ft.l="("+r.l10n.weekdays.longhand.join("|")+")",ft.M="("+r.l10n.months.shorthand.join("|")+")",ft.F="("+r.l10n.months.longhand.join("|")+")",ft.K="("+r.l10n.amPM[0]+"|"+r.l10n.amPM[1]+"|"+r.l10n.amPM[0].toLowerCase()+"|"+r.l10n.amPM[1].toLowerCase()+")",void 0===_t(_t({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr&&void 0===kt.defaultConfig.time_24hr&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=dt(r),r.parseDate=mt({config:r.config,l10n:r.l10n})}function N(t){if("function"!=typeof r.config.position){if(void 0!==r.calendarContainer){Y("onPreCalendarPosition");var e=t||r._positionElement,n=Array.prototype.reduce.call(r.calendarContainer.children,(function(t,e){return t+e.offsetHeight}),0),i=r.calendarContainer.offsetWidth,a=r.config.position.split(" "),o=a[0],s=a.length>1?a[1]:null,l=e.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===o||"below"!==o&&cn,h=window.pageYOffset+l.top+(u?-n-2:e.offsetHeight+2);if(nt(r.calendarContainer,"arrowTop",!u),nt(r.calendarContainer,"arrowBottom",u),!r.config.inline){var f=window.pageXOffset+l.left,p=!1,d=!1;"center"===s?(f-=(i-l.width)/2,p=!0):"right"===s&&(f-=i-l.width,d=!0),nt(r.calendarContainer,"arrowLeft",!p&&!d),nt(r.calendarContainer,"arrowCenter",p),nt(r.calendarContainer,"arrowRight",d);var m=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+i>window.document.body.offsetWidth,y=m+i>window.document.body.offsetWidth;if(nt(r.calendarContainer,"rightMost",g),!r.config.static)if(r.calendarContainer.style.top=h+"px",g)if(y){var v=function(){for(var t=null,e=0;er.currentMonth+r.config.showMonths-1)&&"range"!==r.config.mode;if(r.selectedDateElem=n,"single"===r.config.mode)r.selectedDates=[i];else if("multiple"===r.config.mode){var o=ct(i);o?r.selectedDates.splice(parseInt(o),1):r.selectedDates.push(i)}else"range"===r.config.mode&&(2===r.selectedDates.length&&r.clear(!1,!1),r.latestSelectedDateObj=i,r.selectedDates.push(i),0!==gt(i,r.selectedDates[0],!0)&&r.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()})));if(s(),a){var l=r.currentYear!==i.getFullYear();r.currentYear=i.getFullYear(),r.currentMonth=i.getMonth(),l&&(Y("onYearChange"),w()),Y("onMonthChange")}if(ht(),b(),wt(),a||"range"===r.config.mode||1!==r.config.showMonths?void 0!==r.selectedDateElem&&void 0===r.hourElement&&r.selectedDateElem&&r.selectedDateElem.focus():y(n),void 0!==r.hourElement&&void 0!==r.hourElement&&r.hourElement.focus(),r.config.closeOnSelect){var c="single"===r.config.mode&&!r.config.enableTime,u="range"===r.config.mode&&2===r.selectedDates.length&&!r.config.enableTime;(c||u)&&V()}f()}}r.parseDate=mt({config:r.config,l10n:r.l10n}),r._handlers=[],r.pluginElements=[],r.loadedPlugins=[],r._bind=h,r._setHoursFromDate=l,r._positionCalendar=N,r.changeMonth=S,r.changeYear=I,r.clear=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);r.input.value="",void 0!==r.altInput&&(r.altInput.value="");void 0!==r.mobileInput&&(r.mobileInput.value="");r.selectedDates=[],r.latestSelectedDateObj=void 0,!0===e&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth());if(!0===r.config.enableTime){var n=xt(r.config);c(n.hours,n.minutes,n.seconds)}r.redraw(),t&&Y("onChange")},r.close=function(){r.isOpen=!1,r.isMobile||(void 0!==r.calendarContainer&&r.calendarContainer.classList.remove("open"),void 0!==r._input&&r._input.classList.remove("active"));Y("onClose")},r.onMouseOver=O,r._createElement=it,r.createDay=g,r.destroy=function(){void 0!==r.config&&Y("onDestroy");for(var t=r._handlers.length;t--;)r._handlers[t].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var e=r.calendarContainer.parentNode;if(e.lastChild&&e.removeChild(e.lastChild),e.parentNode){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.parentNode.removeChild(e)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput);r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete r[t]}catch(t){}}))},r.isEnabled=L,r.jumpToDate=p,r.updateValue=wt,r.open=function(t,e){void 0===e&&(e=r._positionElement);if(!0===r.isMobile){if(t){t.preventDefault();var n=lt(t);n&&n.blur()}return void 0!==r.mobileInput&&(r.mobileInput.focus(),r.mobileInput.click()),void Y("onOpen")}if(r._input.disabled||r.config.inline)return;var i=r.isOpen;r.isOpen=!0,i||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),Y("onOpen"),N(e));!0===r.config.enableTime&&!0===r.config.noCalendar&&(!1!==r.config.allowInput||void 0!==t&&r.timeContainer.contains(t.relatedTarget)||setTimeout((function(){return r.hourElement.select()}),50))},r.redraw=U,r.set=function(t,e){if(null!==t&&"object"==typeof t)for(var n in Object.assign(r.config,t),t)void 0!==H[n]&&H[n].forEach((function(t){return t()}));else r.config[t]=e,void 0!==H[t]?H[t].forEach((function(t){return t()})):X.indexOf(t)>-1&&(r.config[t]=rt(e));r.redraw(),wt(!0)},r.setDate=function(t,e,n){void 0===e&&(e=!1);void 0===n&&(n=r.config.dateFormat);if(0!==t&&!t||t instanceof Array&&0===t.length)return r.clear(e);G(t,n),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),p(void 0,e),l(),0===r.selectedDates.length&&r.clear(!1);wt(e),e&&Y("onChange")},r.toggle=function(t){if(!0===r.isOpen)return r.close();r.open(t)};var H={locale:[B,M],showMonths:[k,a,A],minDate:[p],maxDate:[p],positionElement:[W],clickOpens:[function(){!0===r.config.clickOpens?(h(r._input,"focus",r.open),h(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function G(t,e){var n=[];if(t instanceof Array)n=t.map((function(t){return r.parseDate(t,e)}));else if(t instanceof Date||"number"==typeof t)n=[r.parseDate(t,e)];else if("string"==typeof t)switch(r.config.mode){case"single":case"time":n=[r.parseDate(t,e)];break;case"multiple":n=t.split(r.config.conjunction).map((function(t){return r.parseDate(t,e)}));break;case"range":n=t.split(r.l10n.rangeSeparator).map((function(t){return r.parseDate(t,e)}))}else r.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));r.selectedDates=r.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&L(t,!1)})),"range"===r.config.mode&&r.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()}))}function Z(t){return t.slice().map((function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?r.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:r.parseDate(t.from,void 0),to:r.parseDate(t.to,void 0)}:t})).filter((function(t){return t}))}function W(){r._positionElement=r.config.positionElement||r._input}function Y(t,e){if(void 0!==r.config){var n=r.config[t];if(void 0!==n&&n.length>0)for(var i=0;n[i]&&i1||"static"===r.config.monthSelectorType?r.monthElements[e].textContent=ut(n.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=n.getMonth().toString(),t.value=n.getFullYear().toString()})),r._hidePrevMonthArrow=void 0!==r.config.minDate&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYearr.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function pt(t){var e=t||(r.config.altInput?r.config.altFormat:r.config.dateFormat);return r.selectedDates.map((function(t){return r.formatDate(t,e)})).filter((function(t,e,n){return"range"!==r.config.mode||r.config.enableTime||n.indexOf(t)===e})).join("range"!==r.config.mode?r.config.conjunction:r.l10n.rangeSeparator)}function wt(t){void 0===t&&(t=!0),void 0!==r.mobileInput&&r.mobileFormatStr&&(r.mobileInput.value=void 0!==r.latestSelectedDateObj?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=pt(r.config.dateFormat),void 0!==r.altInput&&(r.altInput.value=pt(r.config.altFormat)),!1!==t&&Y("onValueUpdate")}function Tt(t){var e=lt(t),n=r.prevMonthNav.contains(e),i=r.nextMonthNav.contains(e);n||i?S(n?-1:1):r.yearElements.indexOf(e)>=0?e.select():e.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):e.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}return function(){r.element=r.input=t,r.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=_t(_t({},JSON.parse(JSON.stringify(t.dataset||{}))),e),o={};r.config.parseDate=a.parseDate,r.config.formatDate=a.formatDate,Object.defineProperty(r.config,"enable",{get:function(){return r.config._enable},set:function(t){r.config._enable=Z(t)}}),Object.defineProperty(r.config,"disable",{get:function(){return r.config._disable},set:function(t){r.config._disable=Z(t)}});var s="time"===a.mode;if(!a.dateFormat&&(a.enableTime||s)){var l=kt.defaultConfig.dateFormat||$.dateFormat;o.dateFormat=a.noCalendar||s?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||s)&&!a.altFormat){var c=kt.defaultConfig.altFormat||$.altFormat;o.altFormat=a.noCalendar||s?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(r.config,"minDate",{get:function(){return r.config._minDate},set:F("min")}),Object.defineProperty(r.config,"maxDate",{get:function(){return r.config._maxDate},set:F("max")});var u=function(t){return function(e){r.config["min"===t?"_minTime":"_maxTime"]=r.parseDate(e,"H:i:S")}};Object.defineProperty(r.config,"minTime",{get:function(){return r.config._minTime},set:u("min")}),Object.defineProperty(r.config,"maxTime",{get:function(){return r.config._maxTime},set:u("max")}),"time"===a.mode&&(r.config.noCalendar=!0,r.config.enableTime=!0);Object.assign(r.config,o,a);for(var h=0;h-1?r.config[p]=rt(f[p]).map(i).concat(r.config[p]):void 0===a[p]&&(r.config[p]=f[p])}a.altInputClass||(r.config.altInputClass=j().className+" "+r.config.altInputClass);Y("onParseConfig")}(),B(),function(){if(r.input=j(),!r.input)return void r.config.errorHandler(new Error("Invalid input element specified"));r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=it(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling));r.config.allowInput||r._input.setAttribute("readonly","readonly");W()}(),function(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;var t=r.config.defaultDate||("INPUT"!==r.input.nodeName&&"TEXTAREA"!==r.input.nodeName||!r.input.placeholder||r.input.value!==r.input.placeholder?r.input.value:null);t&&G(t,r.config.dateFormat);r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()0&&(r.latestSelectedDateObj=r.selectedDates[0]);void 0!==r.config.minTime&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i"));void 0!==r.config.maxTime&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i"));r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}(),r.utils={getDaysInMonth:function(t,e){return void 0===t&&(t=r.currentMonth),void 0===e&&(e=r.currentYear),1===t&&(e%4==0&&e%100!=0||e%400==0)?29:r.l10n.daysInMonth[t]}},r.isMobile||function(){var t=window.document.createDocumentFragment();if(r.calendarContainer=it("div","flatpickr-calendar"),r.calendarContainer.tabIndex=-1,!r.config.noCalendar){if(t.appendChild((r.monthNav=it("div","flatpickr-months"),r.yearElements=[],r.monthElements=[],r.prevMonthNav=it("span","flatpickr-prev-month"),r.prevMonthNav.innerHTML=r.config.prevArrow,r.nextMonthNav=it("span","flatpickr-next-month"),r.nextMonthNav.innerHTML=r.config.nextArrow,k(),Object.defineProperty(r,"_hidePrevMonthArrow",{get:function(){return r.__hidePrevMonthArrow},set:function(t){r.__hidePrevMonthArrow!==t&&(nt(r.prevMonthNav,"flatpickr-disabled",t),r.__hidePrevMonthArrow=t)}}),Object.defineProperty(r,"_hideNextMonthArrow",{get:function(){return r.__hideNextMonthArrow},set:function(t){r.__hideNextMonthArrow!==t&&(nt(r.nextMonthNav,"flatpickr-disabled",t),r.__hideNextMonthArrow=t)}}),r.currentYearElement=r.yearElements[0],ht(),r.monthNav)),r.innerContainer=it("div","flatpickr-innerContainer"),r.config.weekNumbers){var e=function(){r.calendarContainer.classList.add("hasWeeks");var t=it("div","flatpickr-weekwrapper");t.appendChild(it("span","flatpickr-weekday",r.l10n.weekAbbreviation));var e=it("div","flatpickr-weeks");return t.appendChild(e),{weekWrapper:t,weekNumbers:e}}(),n=e.weekWrapper,i=e.weekNumbers;r.innerContainer.appendChild(n),r.weekNumbers=i,r.weekWrapper=n}r.rContainer=it("div","flatpickr-rContainer"),r.rContainer.appendChild(A()),r.daysContainer||(r.daysContainer=it("div","flatpickr-days"),r.daysContainer.tabIndex=-1),b(),r.rContainer.appendChild(r.daysContainer),r.innerContainer.appendChild(r.rContainer),t.appendChild(r.innerContainer)}r.config.enableTime&&t.appendChild(function(){r.calendarContainer.classList.add("hasTime"),r.config.noCalendar&&r.calendarContainer.classList.add("noCalendar");var t=xt(r.config);r.timeContainer=it("div","flatpickr-time"),r.timeContainer.tabIndex=-1;var e=it("span","flatpickr-time-separator",":"),n=st("flatpickr-hour",{"aria-label":r.l10n.hourAriaLabel});r.hourElement=n.getElementsByTagName("input")[0];var i=st("flatpickr-minute",{"aria-label":r.l10n.minuteAriaLabel});r.minuteElement=i.getElementsByTagName("input")[0],r.hourElement.tabIndex=r.minuteElement.tabIndex=-1,r.hourElement.value=Q(r.latestSelectedDateObj?r.latestSelectedDateObj.getHours():r.config.time_24hr?t.hours:function(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}(t.hours)),r.minuteElement.value=Q(r.latestSelectedDateObj?r.latestSelectedDateObj.getMinutes():t.minutes),r.hourElement.setAttribute("step",r.config.hourIncrement.toString()),r.minuteElement.setAttribute("step",r.config.minuteIncrement.toString()),r.hourElement.setAttribute("min",r.config.time_24hr?"0":"1"),r.hourElement.setAttribute("max",r.config.time_24hr?"23":"12"),r.hourElement.setAttribute("maxlength","2"),r.minuteElement.setAttribute("min","0"),r.minuteElement.setAttribute("max","59"),r.minuteElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(n),r.timeContainer.appendChild(e),r.timeContainer.appendChild(i),r.config.time_24hr&&r.timeContainer.classList.add("time24hr");if(r.config.enableSeconds){r.timeContainer.classList.add("hasSeconds");var a=st("flatpickr-second");r.secondElement=a.getElementsByTagName("input")[0],r.secondElement.value=Q(r.latestSelectedDateObj?r.latestSelectedDateObj.getSeconds():t.seconds),r.secondElement.setAttribute("step",r.minuteElement.getAttribute("step")),r.secondElement.setAttribute("min","0"),r.secondElement.setAttribute("max","59"),r.secondElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(it("span","flatpickr-time-separator",":")),r.timeContainer.appendChild(a)}r.config.time_24hr||(r.amPM=it("span","flatpickr-am-pm",r.l10n.amPM[tt((r.latestSelectedDateObj?r.hourElement.value:r.config.defaultHour)>11)]),r.amPM.title=r.l10n.toggleTitle,r.amPM.tabIndex=-1,r.timeContainer.appendChild(r.amPM));return r.timeContainer}());nt(r.calendarContainer,"rangeMode","range"===r.config.mode),nt(r.calendarContainer,"animate",!0===r.config.animate),nt(r.calendarContainer,"multiMonth",r.config.showMonths>1),r.calendarContainer.appendChild(t);var a=void 0!==r.config.appendTo&&void 0!==r.config.appendTo.nodeType;if((r.config.inline||r.config.static)&&(r.calendarContainer.classList.add(r.config.inline?"inline":"static"),r.config.inline&&(!a&&r.element.parentNode?r.element.parentNode.insertBefore(r.calendarContainer,r._input.nextSibling):void 0!==r.config.appendTo&&r.config.appendTo.appendChild(r.calendarContainer)),r.config.static)){var o=it("div","flatpickr-wrapper");r.element.parentNode&&r.element.parentNode.insertBefore(o,r.element),o.appendChild(r.element),r.altInput&&o.appendChild(r.altInput),o.appendChild(r.calendarContainer)}r.config.static||r.config.inline||(void 0!==r.config.appendTo?r.config.appendTo:window.document.body).appendChild(r.calendarContainer)}(),function(){r.config.wrap&&["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(r.element.querySelectorAll("[data-"+t+"]"),(function(e){return h(e,"click",r[t])}))}));if(r.isMobile)return void function(){var t=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=it("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=t,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr));r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d"));r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d"));r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step")));r.input.type="hidden",void 0!==r.altInput&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch(t){}h(r.mobileInput,"change",(function(t){r.setDate(lt(t).value,!1,r.mobileFormatStr),Y("onChange"),Y("onClose")}))}();var t=et(R,50);r._debouncedChange=et(f,300),r.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(r.daysContainer,"mouseover",(function(t){"range"===r.config.mode&&O(lt(t))}));h(r._input,"keydown",D),void 0!==r.calendarContainer&&h(r.calendarContainer,"keydown",D);r.config.inline||r.config.static||h(window,"resize",t);void 0!==window.ontouchstart?h(window.document,"touchstart",C):h(window.document,"mousedown",C);h(window.document,"focus",C,{capture:!0}),!0===r.config.clickOpens&&(h(r._input,"focus",r.open),h(r._input,"click",r.open));void 0!==r.daysContainer&&(h(r.monthNav,"click",Tt),h(r.monthNav,["keyup","increment"],u),h(r.daysContainer,"click",q));if(void 0!==r.timeContainer&&void 0!==r.minuteElement&&void 0!==r.hourElement){var e=function(t){return lt(t).select()};h(r.timeContainer,["increment"],o),h(r.timeContainer,"blur",o,{capture:!0}),h(r.timeContainer,"click",d),h([r.hourElement,r.minuteElement],["focus","click"],e),void 0!==r.secondElement&&h(r.secondElement,"focus",(function(){return r.secondElement&&r.secondElement.select()})),void 0!==r.amPM&&h(r.amPM,"click",(function(t){o(t)}))}r.config.allowInput&&h(r._input,"blur",z)}(),(r.selectedDates.length||r.config.noCalendar)&&(r.config.enableTime&&l(r.config.noCalendar?r.latestSelectedDateObj:void 0),wt(!1)),a();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!r.isMobile&&n&&N(),Y("onReady")}(),r}function Tt(t,e){for(var r=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement})),n=[],i=0;it}if(null!=this.expression){const t=this.expression;return()=>this.parseExpression(t)}return null}parseExpression(t){const e=new Date;if(e.setMilliseconds(0),"now"===t.toLowerCase())return e;const r=t.match(/^\s*now\s*(-|\+)\s*(\d+)([dhms])\s*$/i);if(r){const[,t,n,i]=r;let a;switch(i.toLowerCase()){case"d":a=60*n*60*24;break;case"h":a=60*n*60;break;case"m":a=60*n;break;case"s":a=n;break;default:return null}return"-"===t&&(a=-a),c(l(e)+a)}return null}}class St{constructor(t,e){this.fromPicker=new Mt(t),this.toPicker=new Mt(e)}setDates(t,e){this.fromPicker.setDate(t),this.toPicker.setDate(e)}getDates(){return[this.fromPicker.getDate(),this.toPicker.getDate()]}getRawDates(){return[this.fromPicker.getRawDate(),this.toPicker.getRawDate()]}getDatesFactory(){const t=this.fromPicker.getDateFactory(),e=this.toPicker.getDateFactory();return()=>[t(),e()]}hasValidDates(){const t=this.fromPicker.getDate(),e=this.toPicker.getDate();return null!=t&&null!=e&&t<=e}}function Et(){function t(t,e,r){e.forEach((e=>{const r=document.createElement("option");Array.isArray(e)&&2===e.length?(r.value=e[0],r.text=e[1]):(r.value=e,r.text=e),t.appendChild(r)})),t.value=r}const e=document.getElementById("range").timeRangePicker;try{e.setDates(...m())}catch{e.setDates(...m(!0))}const r=document.getElementById("refresh-interval");t(r,x,function(){try{let t=localStorage.getItem(v);if(null!=t&&(t=parseInt(t,10),_(t)))return t}catch(t){console.error(`Failed to read '${v}' from local storage!`,t)}return varnishmon.config.scraper.enabled?-1:0}()),r.addEventListener("change",(t=>{!function(t){if(_(t))try{localStorage.setItem(v,t)}catch(t){console.error(`Failed to write '${v}' to local storage!`,t)}else console.error("Invalid refresh interval value!",t)}(parseInt(t.target.value,10))}));const n=document.getElementById("filter");n.value=function(){try{let t=localStorage.getItem(b);if(null!=t)return t}catch(t){console.error(`Failed to read '${b}' from local storage!`,t)}return""}(),n.addEventListener("change",(t=>{!function(t){try{localStorage.setItem(b,t)}catch(t){console.error(`Failed to write '${b}' to local storage!`,t)}}(t.target.value)}));const i=document.getElementById("verbosity");t(i,A,function(){try{let t=localStorage.getItem(k);if(null!=t&&M(t))return t}catch(t){console.error(`Failed to read '${k}' from local storage!`,t)}return"normal"}()),i.addEventListener("change",(t=>{!function(t){if(M(t))try{localStorage.setItem(k,t)}catch(t){console.error(`Failed to write '${k}' to local storage!`,t)}else console.error("Invalid verbosity value!",t)}(t.target.value)}));const a=document.getElementById("columns");t(a,E,function(){try{let t=localStorage.getItem(S);if(null!=t&&(t=parseInt(t,10),C(t)))return t}catch(t){console.error(`Failed to read '${S}' from local storage!`,t)}return 3}()),a.addEventListener("change",(t=>{!function(t){if(C(t))try{localStorage.setItem(S,t)}catch(t){console.error(`Failed to write '${S}' to local storage!`,t)}else console.error("Invalid columns value!",t)}(parseInt(t.target.value,10))}));const o=document.getElementById("aggregator");t(o,L,function(){try{let t=localStorage.getItem(I);if(null!=t&&P(t))return t}catch(t){console.error(`Failed to read '${I}' from local storage!`,t)}return"avg"}()),o.addEventListener("change",(t=>{!function(t){if(P(t))try{localStorage.setItem(I,t)}catch(t){console.error(`Failed to write '${I}' to local storage!`,t)}else console.error("Invalid aggregator value!",t)}(t.target.value)}));const s=document.getElementById("step");s.min=D(),s.value=function(){try{let t=localStorage.getItem(z);if(null!=t&&(t=parseInt(t,10),O(t)))return t}catch(t){console.error(`Failed to read '${z}' from local storage!`,t)}return varnishmon.config.scraper.enabled?varnishmon.config.scraper.period:60}(),s.addEventListener("change",(t=>{const e=parseInt(t.target.value,10),r=D();e>=r?function(t){if(O(t))try{localStorage.setItem(z,t)}catch(t){console.error(`Failed to write '${z}' to local storage!`,t)}else console.error("Invalid columns value!",t)}(e):(t.stopPropagation(),s.value=r,u("error",`Step must be at least ${r} seconds`))}))}function Ct(){let t=parseInt(document.getElementById("refresh-interval").value,10);return t<0&&(t=It()),t}function It(){let t=parseInt(document.getElementById("step").value,10);const e=D();return t{"Enter"===t.key&&document.getElementById("apply-time-range").click()})),document.getElementById("range-to").addEventListener("keydown",(t=>{"Enter"===t.key&&document.getElementById("apply-time-range").click()})),document.getElementById("apply-time-range").addEventListener("click",(t=>{const e=document.getElementById("range");if(!e.timeRangePicker.hasValidDates())return t.stopPropagation(),void u("error","The selected time range is invalid. ISO 8601 and relative expressions like 'now-1h', 'now', 'now-1d', etc. are allowed.");!function(t,e){y(f,t),y(p,e)}(...e.timeRangePicker.getRawDates()),e.initialRange=null,Pt()})),document.getElementById("refresh-interval").addEventListener("change",(()=>{let t=Ct();document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart.setRefreshInterval(t)}))})),document.getElementById("refresh").addEventListener("click",(()=>{document.getElementById("clusters").querySelectorAll(".chart").forEach((t=>{t.chart.refresh()}))})),document.getElementById("filter").addEventListener("input",s(zt,500)),document.getElementById("verbosity").addEventListener("change",zt),document.getElementById("columns").addEventListener("change",zt),document.getElementById("filter").addEventListener("change",(t=>{const e=t.target.value;if(e){const t=T(),r=t.indexOf(e);0!==r&&(-1!==r&&t.splice(r,1),t.unshift(e),t.length>10&&t.pop(),function(t){try{localStorage.setItem(w,JSON.stringify(t))}catch(t){console.error(`Failed to write '${w}' to local storage!`,t)}}(t)),Dt()}})),document.getElementById("aggregator").addEventListener("change",(t=>{document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart.setAggregator(t.target.value)}))})),document.getElementById("step").addEventListener("change",(()=>{const t=It();document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart.setStep(t)}))})),document.getElementById("reset").addEventListener("click",(()=>{!function(){for(let t=localStorage.length-1;t>=0;t--)try{const e=localStorage.key(t);e.startsWith(h)&&localStorage.removeItem(e)}catch(t){console.error("Failed to remove item from local storage!",t)}}(),location.reload()})),document.getElementById("collapse-all").addEventListener("click",(()=>{document.getElementById("clusters").querySelectorAll(".cluster").forEach((t=>{e().getInstance(t.querySelector(".accordion-collapse")).hide(),t.querySelector(".accordion-button").classList.add("collapsed")}))})),document.getElementById("expand-all").addEventListener("click",(()=>{document.getElementById("clusters").querySelectorAll(".cluster").forEach((t=>{e().getInstance(t.querySelector(".accordion-collapse")).show(),t.querySelector(".accordion-button").classList.remove("collapsed")}))}))}async function Pt(){const t=document.getElementById("clusters");t.querySelectorAll(".chart").forEach((t=>{t.chart.destroy()})),t.innerHTML="",t.appendChild(document.getElementById("spinner-template").content.cloneNode(!0).firstElementChild);const r=document.getElementById("range").timeRangePicker.getDatesFactory(),n=Ct(),i=document.getElementById("aggregator").value,a=It();let o;try{const[t,e]=r();o=await async function(t,e,r){const n=new URLSearchParams({from:l(t),to:l(e),step:r}),i=await fetch(`/storage/metrics?${n.toString()}`);if(!i.ok)throw new Error(`Unexpected API response (${i.status}): ${i.statusText}`);const a=await i.json();return{from:c(a.from),to:c(a.to),step:a.step,clusters:B(a.metrics)}}(t,e,a)}catch(e){return t.innerHTML="",t.appendChild(document.getElementById("metrics-meditation-template").content.cloneNode(!0).firstElementChild),void u("error",`Failed to fetch metrics: ${e}`)}const s=o.clusters.length;u("info",`Fetched ${o.clusters.reduce(((t,e)=>t+e.metrics.length),0)} metrics organized in ${s} clusters`);const h=document.getElementById("cluster-template"),f=document.getElementById("chart-template");t.innerHTML="",o.clusters.forEach((o=>{const s=h.content.cloneNode(!0).firstElementChild;s.querySelector(".cluster-name").textContent=o.name,t.appendChild(s);const l=new(e())(s.querySelector(".accordion-collapse"));s.querySelector(".accordion-button").addEventListener("click",(t=>{t.currentTarget.classList.toggle("collapsed"),l.toggle()}));const c=s.querySelector(".charts");o.metrics.forEach((t=>{const e=f.content.cloneNode(!0).firstElementChild,o=new Y(e,t,r,n,i,a);o.addEventListener("zoom",(t=>{document.getElementById("clusters").querySelectorAll(".chart").forEach((e=>{e.chart!==t.target&&e.chart.setZoomRange(t.range)}));const e=document.getElementById("range");null!=t.range?(null==e.initialRange&&(e.initialRange=e.timeRangePicker.getRawDates()),e.timeRangePicker.setDates(...t.range)):null!=e.initialRange&&(e.timeRangePicker.setDates(...e.initialRange),e.initialRange=null)})),e.chart=o,c.appendChild(e)}))})),zt()}function zt(){const t=document.getElementById("clusters");t.querySelectorAll(".chart").forEach((t=>{t.chart.redraw(document.getElementById("filter").value,document.getElementById("verbosity").value,parseInt(document.getElementById("columns").value,10))})),t.querySelectorAll(".cluster").forEach((t=>{0===t.querySelectorAll(".chart:not(.d-none)").length?t.classList.add("d-none"):t.classList.remove("d-none")}));const e=t.querySelectorAll(".cluster").length,r=t.querySelectorAll(".cluster:not(.d-none)").length,n=t.querySelectorAll(".chart").length,i=t.querySelectorAll(".chart:not(.d-none)").length;document.getElementById("filter-stats").textContent=`${i} metrics found (${n-i} hidden), organized in ${r} clusters (${e-r} hidden)`}function Dt(){const t=document.getElementById("filterHistoryList");t.innerHTML="",T().forEach((e=>{const r=document.createElement("li");r.classList.add("dropdown-item"),r.textContent=e,r.addEventListener("click",(()=>{const t=document.getElementById("filter");t.value=e,t.dispatchEvent(new Event("change")),zt()})),t.appendChild(r)}))}document.addEventListener("DOMContentLoaded",(async()=>{!function(){const t=new MutationObserver(((e,r)=>{for(const r of e)"childList"===r.type&&r.addedNodes.forEach((e=>{if(e.classList&&e.classList.contains("plotly-notifier")){e.style.display="none",t.disconnect(),e.querySelectorAll(".notifier-note").forEach((t=>{u("info",t.querySelector("span").innerText)}));const r=new MutationObserver(((t,e)=>{for(const e of t)"childList"===e.type&&e.addedNodes.forEach((t=>{t.classList&&t.classList.contains("notifier-note")&&u("info",t.querySelector("span").innerText)}))}));r.observe(e,{childList:!0})}}))}));t.observe(document.body,{childList:!0})}(),document.getElementById("range").timeRangePicker=new St(document.getElementById("range-from"),document.getElementById("range-to")),Et(),Lt(),new(i())(document.getElementById("filterHistoryList")),Dt(),Pt()}))})()})(); \ No newline at end of file