From e20b1b805885bf9e2b3ec97aa569ebca6e8272d6 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 10 Jul 2024 16:20:42 +0200 Subject: [PATCH] Upgrade to @biigle/ol:v9.2.4 --- .npmrc | 1 + package-lock.json | 297 ++++++++++++++---- package.json | 2 +- src/public/assets/scripts/main.js | 2 +- src/public/mix-manifest.json | 2 +- .../annotationsSettingsTabPlugin.vue | 71 +++-- 6 files changed, 281 insertions(+), 94 deletions(-) diff --git a/.npmrc b/.npmrc index 51d14a7b..bae4c341 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ +@biigle:registry=https://npm.pkg.github.com @mzur:registry=https://npm.pkg.github.com diff --git a/package-lock.json b/package-lock.json index 55845d0a..7d62b7ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "GPL-3.0-only", "dependencies": { - "ol": "^5.3.3" + "@biigle/ol": "^9.2.4" }, "devDependencies": { "@mzur/laravel-mix-artisan-publish": "^1.0.0", @@ -1918,6 +1918,20 @@ "node": ">=6.9.0" } }, + "node_modules/@biigle/ol": { + "version": "9.2.4", + "resolved": "https://npm.pkg.github.com/download/@biigle/ol/9.2.4/1c025faf01d9f35d5cc036d4c6bc48538a3ba7d1", + "integrity": "sha512-scfuI2HDw6p666koJv7vGSzihCWZY+Ld6zGsLKTBddMufIeKE6XbUrQXxLWmPWiNYUQ11OJoVUo3NIXsQnxo0w==", + "license": "BSD-2-Clause", + "dependencies": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "pbf": "3.2.1", + "rbush": "^3.0.1" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -2079,6 +2093,11 @@ "node": ">= 8" } }, + "node_modules/@petamoriken/float16": { + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.7.tgz", + "integrity": "sha512-/Ri4xDDpe12NT6Ex/DRgHzLlobiQXEW/hmG08w1wj/YU7hLemk97c+zHQFp0iZQ9r7YqgLEXZR2sls4HxBf9NA==" + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -3570,6 +3589,36 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/color-parse": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.2.tgz", + "integrity": "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw==", + "dependencies": { + "color-name": "^2.0.0" + } + }, + "node_modules/color-parse/node_modules/color-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz", + "integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==", + "engines": { + "node": ">=12.20" + } + }, + "node_modules/color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "dependencies": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "node_modules/color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, "node_modules/colord": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.2.tgz", @@ -4454,6 +4503,11 @@ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "dev": true }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -5554,6 +5608,29 @@ "node": ">=6.9.0" } }, + "node_modules/geotiff": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", + "integrity": "sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==", + "dependencies": { + "@petamoriken/float16": "^3.4.7", + "lerc": "^3.0.0", + "pako": "^2.0.4", + "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", + "web-worker": "^1.2.0", + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" + }, + "engines": { + "node": ">=10.19" + } + }, + "node_modules/geotiff/node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -6750,6 +6827,11 @@ "shell-quote": "^1.8.1" } }, + "node_modules/lerc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz", + "integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww==" + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -7460,16 +7542,6 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, - "node_modules/ol": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/ol/-/ol-5.3.3.tgz", - "integrity": "sha512-7eU4x8YMduNcED1D5wI+AMWDRe7/1HmGfsbV+kFFROI9RNABU/6n4osj6Q3trZbxxKnK2DSRIjIRGwRHT/Z+Ww==", - "dependencies": { - "pbf": "3.1.0", - "pixelworks": "1.1.0", - "rbush": "2.0.2" - } - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -7657,6 +7729,11 @@ "safe-buffer": "^5.1.1" } }, + "node_modules/parse-headers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==" + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -7749,12 +7826,12 @@ } }, "node_modules/pbf": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.1.0.tgz", - "integrity": "sha512-/hYJmIsTmh7fMkHAWWXJ5b8IKLWdjdlAFb3IHkRBn1XUhIYBChVGfVwmHEAV3UfXTxsP/AKfYTXTS/dCPxJd5w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", + "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", "dependencies": { - "ieee754": "^1.1.6", - "resolve-protobuf-schema": "^2.0.0" + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" }, "bin": { "pbf": "bin/pbf" @@ -7794,11 +7871,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pixelworks": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pixelworks/-/pixelworks-1.1.0.tgz", - "integrity": "sha1-Hwla1I3Ki/ihyCWOAJIDGkTyLKU=" - }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -8569,10 +8641,21 @@ } ] }, + "node_modules/quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/quickselect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.1.1.tgz", - "integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" }, "node_modules/randombytes": { "version": "2.1.0", @@ -8627,11 +8710,11 @@ } }, "node_modules/rbush": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz", - "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", "dependencies": { - "quickselect": "^1.0.1" + "quickselect": "^2.0.0" } }, "node_modules/readable-stream": { @@ -10239,6 +10322,11 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/web-worker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz", + "integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==" + }, "node_modules/webpack": { "version": "5.76.1", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", @@ -10727,6 +10815,11 @@ } } }, + "node_modules/xml-utils": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.10.1.tgz", + "integrity": "sha512-Dn6vJ1Z9v1tepSjvnCpwk5QqwIPcEFKdgnjqfYOABv1ngSofuAhtlugcUC3ehS1OHdgDWSG6C5mvj+Qm15udTQ==" + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -10786,6 +10879,11 @@ "engines": { "node": ">=12" } + }, + "node_modules/zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" } }, "dependencies": { @@ -12145,6 +12243,19 @@ "to-fast-properties": "^2.0.0" } }, + "@biigle/ol": { + "version": "9.2.4", + "resolved": "https://npm.pkg.github.com/download/@biigle/ol/9.2.4/1c025faf01d9f35d5cc036d4c6bc48538a3ba7d1", + "integrity": "sha512-scfuI2HDw6p666koJv7vGSzihCWZY+Ld6zGsLKTBddMufIeKE6XbUrQXxLWmPWiNYUQ11OJoVUo3NIXsQnxo0w==", + "requires": { + "color-rgba": "^3.0.0", + "color-space": "^2.0.1", + "earcut": "^2.2.3", + "geotiff": "^2.0.7", + "pbf": "3.2.1", + "rbush": "^3.0.1" + } + }, "@discoveryjs/json-ext": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -12275,6 +12386,11 @@ "fastq": "^1.6.0" } }, + "@petamoriken/float16": { + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.7.tgz", + "integrity": "sha512-/Ri4xDDpe12NT6Ex/DRgHzLlobiQXEW/hmG08w1wj/YU7hLemk97c+zHQFp0iZQ9r7YqgLEXZR2sls4HxBf9NA==" + }, "@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -13522,6 +13638,35 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-parse": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.2.tgz", + "integrity": "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw==", + "requires": { + "color-name": "^2.0.0" + }, + "dependencies": { + "color-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz", + "integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==" + } + } + }, + "color-rgba": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz", + "integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==", + "requires": { + "color-parse": "^2.0.0", + "color-space": "^2.0.0" + } + }, + "color-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz", + "integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==" + }, "colord": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.2.tgz", @@ -14204,6 +14349,11 @@ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "dev": true }, + "earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -15035,6 +15185,28 @@ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, + "geotiff": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz", + "integrity": "sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==", + "requires": { + "@petamoriken/float16": "^3.4.7", + "lerc": "^3.0.0", + "pako": "^2.0.4", + "parse-headers": "^2.0.2", + "quick-lru": "^6.1.1", + "web-worker": "^1.2.0", + "xml-utils": "^1.0.2", + "zstddec": "^0.1.0" + }, + "dependencies": { + "pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==" + } + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -15907,6 +16079,11 @@ "shell-quote": "^1.8.1" } }, + "lerc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz", + "integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww==" + }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -16473,16 +16650,6 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, - "ol": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/ol/-/ol-5.3.3.tgz", - "integrity": "sha512-7eU4x8YMduNcED1D5wI+AMWDRe7/1HmGfsbV+kFFROI9RNABU/6n4osj6Q3trZbxxKnK2DSRIjIRGwRHT/Z+Ww==", - "requires": { - "pbf": "3.1.0", - "pixelworks": "1.1.0", - "rbush": "2.0.2" - } - }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -16625,6 +16792,11 @@ "safe-buffer": "^5.1.1" } }, + "parse-headers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==" + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -16696,12 +16868,12 @@ "dev": true }, "pbf": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.1.0.tgz", - "integrity": "sha512-/hYJmIsTmh7fMkHAWWXJ5b8IKLWdjdlAFb3IHkRBn1XUhIYBChVGfVwmHEAV3UfXTxsP/AKfYTXTS/dCPxJd5w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", + "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", "requires": { - "ieee754": "^1.1.6", - "resolve-protobuf-schema": "^2.0.0" + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" } }, "pbkdf2": { @@ -16729,11 +16901,6 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, - "pixelworks": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pixelworks/-/pixelworks-1.1.0.tgz", - "integrity": "sha1-Hwla1I3Ki/ihyCWOAJIDGkTyLKU=" - }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -17224,10 +17391,15 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "quick-lru": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==" + }, "quickselect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.1.1.tgz", - "integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" }, "randombytes": { "version": "2.1.0", @@ -17275,11 +17447,11 @@ } }, "rbush": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz", - "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", "requires": { - "quickselect": "^1.0.1" + "quickselect": "^2.0.0" } }, "readable-stream": { @@ -18509,6 +18681,11 @@ "minimalistic-assert": "^1.0.0" } }, + "web-worker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz", + "integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==" + }, "webpack": { "version": "5.76.1", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.1.tgz", @@ -18838,6 +19015,11 @@ "dev": true, "requires": {} }, + "xml-utils": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.10.1.tgz", + "integrity": "sha512-Dn6vJ1Z9v1tepSjvnCpwk5QqwIPcEFKdgnjqfYOABv1ngSofuAhtlugcUC3ehS1OHdgDWSG6C5mvj+Qm15udTQ==" + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -18882,6 +19064,11 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", "dev": true + }, + "zstddec": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz", + "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" } } } diff --git a/package.json b/package.json index 9b0e6e80..9798ecd6 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,6 @@ "vue-template-compiler": "^2.6.11" }, "dependencies": { - "ol": "^5.3.3" + "@biigle/ol": "^9.2.4" } } diff --git a/src/public/assets/scripts/main.js b/src/public/assets/scripts/main.js index 5c1c3386..d1cfb71a 100644 --- a/src/public/assets/scripts/main.js +++ b/src/public/assets/scripts/main.js @@ -1 +1 @@ -(()=>{var t={166:function(t){t.exports=function(){"use strict";function t(t,i,r,o,s){e(t,i,r||0,o||t.length-1,s||n)}function e(t,n,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,h=n-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(h-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-h*c/a+l)),Math.min(o,Math.floor(n+(a-h)*c/a+l)),s)}var p=t[n],f=r,d=o;for(i(t,r,n),s(t[o],p)>0&&i(t,r,o);f0;)d--}0===s(t[r],p)?i(t,r,d):i(t,++d,o),d<=n&&(r=d+1),n<=d&&(o=d-1)}}function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}return t}()},510:(t,e,i)=>{"use strict";t.exports=r,t.exports.default=r;var n=i(166);function r(t,e){if(!(this instanceof r))return new r(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,r,o){for(var s,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=r||(s=e+Math.ceil((i-e)/r/2)*r,n(t,s,e,i,o),a.push(e,s,s,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!d(t,e))return i;for(var r,o,s,a,h=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),a=_(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,o,s,h,u,c,p,f,d,_,g,y,m;for(u=c=1/0,n=e;n<=i-e;n++)r=a(t,0,n,this.toBBox),o=a(t,n,i,this.toBBox),f=r,d=o,_=void 0,g=void 0,y=void 0,m=void 0,_=Math.max(f.minX,d.minX),g=Math.max(f.minY,d.minY),y=Math.min(f.maxX,d.maxX),m=Math.min(f.maxY,d.maxY),s=Math.max(0,y-_)*Math.max(0,m-g),h=l(r)+l(o),s=e;r--)o=t.children[r],h(c,t.leaf?s(o):o),l+=p(c);return l},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():s(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";function t(){return function(){throw new Error("Unimplemented abstract method.")}()}var e=0;function n(t){return t.ol_uid||(t.ol_uid=String(++e))}var r="5.3.3";const o=function(t){function e(e){var i="Assertion failed. See https://openlayers.org/en/"+("v"+r.split("-")[0])+"/doc/errors/#"+e+" for details.";t.call(this,i),this.code=e,this.name="AssertionError",this.message=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);function s(t,e){if(!t)throw new o(e)}function a(t,e,i){return Math.min(Math.max(t,e),i)}var h="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function u(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}var c=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,l=/^([a-z]*)$/i;function p(t){return"string"==typeof t?t:d(t)}!function(){var t={},e=0}();function f(t){return t[0]=a(t[0]+.5|0,0,255),t[1]=a(t[1]+.5|0,0,255),t[2]=a(t[2]+.5|0,0,255),t[3]=a(t[3],0,1),t}function d(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function _(t){return Array.isArray(t)?d(t):t}function g(t,e){var i=document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}var y="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",m=(y.indexOf("firefox"),-1!==y.indexOf("safari")&&y.indexOf("chrom"),-1!==y.indexOf("webkit")&&y.indexOf("edge"),y.indexOf("macintosh"),window.devicePixelRatio,function(){var t=!1;try{t=!!document.createElement("canvas").getContext("2d").setLineDash}catch(t){}return t}());navigator,window,window,navigator.msPointerEnabled;const v=2;var x=function(){var t,e={};return function(i){if(t||(t=document.createElement("div").style),!(i in e)){t.font=i;var n=t.fontFamily;if(t.font="",!n)return null;e[i]=n.split(/,\s?/)}return e[i]}}(),w="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,o=arguments.length;r0},e.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var n=i.indexOf(e);t in this.pendingRemovals_?(i[n]=A,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t])}},e}(E);const Y=T,W="change",j="clear";const z=function(t){function e(e){t.call(this),this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(j)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},e.prototype.get=function(t){var e=this.entries_[t];return s(void 0!==e,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},e.prototype.remove=function(t){var e=this.entries_[t];return s(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){s(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(Y);new Array(6);var B=[0,0,0,1],q=[0,0,0,1],K=new z,V={},N=null,$={};!function(){var t,e,i=V,n="32px ",r=["monospace","serif"],o=r.length,s="wmytzilWMYTZIL@#/&?$%10";function a(t){for(var i=U(),a=100;a<=700;a+=300){for(var h=a+" ",u=!0,c=0;c1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=St,a=0;as?h=s:h<-s&&(h=-s),o[a+1]=h}return o}function Ot(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e=200&&a.status<300){var r,o=e.getType();o==Ye||o==We?r=a.responseText:o==je?(r=a.responseXML)||(r=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==Te&&(r=a.response),r?i.call(this,e.readFeatures(r,{featureProjection:s}),e.readProjection(r),e.getLastExtent()):n.call(this)}else n.call(this)}.bind(this),a.onerror=function(){n.call(this)}.bind(this),a.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),A)}function Be(t,e){return[[-1/0,-1/0,1/0,1/0]]}var qe=function(e){function i(t){e.call(this),this.projection_=Vt(t.projection),this.attributions_=Ke(t.attributions),this.attributionsCollapsible_=void 0===t.attributionsCollapsible||t.attributionsCollapsible,this.loading=!1,this.state_=void 0!==t.state?t.state:Se,this.wrapX_=void 0!==t.wrapX&&t.wrapX}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.getAttributions=function(){return this.attributions_},i.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},i.prototype.getProjection=function(){return this.projection_},i.prototype.getResolutions=function(){return t()},i.prototype.getState=function(){return this.state_},i.prototype.getWrapX=function(){return this.wrapX_},i.prototype.refresh=function(){this.changed()},i.prototype.setAttributions=function(t){this.attributions_=Ke(t),this.changed()},i.prototype.setState=function(t){this.state_=t,this.changed()},i}(ht);function Ke(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Ve=qe,Ne="addfeature",$e="changefeature",Ue="clear",Je="removefeature";var Ze=i(510),He=i.n(Ze),Qe=function(t){this.rbush_=He()(t,void 0),this.items_={}};Qe.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[n(e)]=i},Qe.prototype.load=function(t,e){for(var i=new Array(e.length),r=0,o=e.length;r0},layer:function(){return new ke({source:new ni,style:[new de({image:new et({radius:6,stroke:new ae({color:"white",width:4})})}),new de({image:new et({radius:6,stroke:new ae({color:"#ff0000",width:2,lineDash:[1]})})})],zIndex:3,updateWhileAnimating:!0,updateWhileInteracting:!0})}},methods:{maybeFetchLaserpoints:function(t){return this.shown&&!this.cache.hasOwnProperty(t)&&(this.cache[t]=lt.get({image_id:t}).then((function(t){return t.data}))),this.cache[t]},updateCurrentImage:function(t,e){this.layer.getSource().clear(),this.currentImageId=t,this.currentImage=e},maybeDrawLaserpoints:function(t){if(t&&"manual"!==t.method&&t.points&&t.points.length>0){var e=this.currentImage.height;this.layer.getSource().addFeatures(t.points.map((function(t){return new ct({geometry:new oe([t[0],e-t[1]])})})))}},extendMap:function(t){t.addLayer(this.layer)}},watch:{opacity:function(t,e){t<1?this.settings.set("laserpointOpacity",t):this.settings.delete("laserpointOpacity"),0===e&&this.maybeFetchLaserpoints(this.currentImageId).then(this.maybeDrawLaserpoints),0===t&&this.layer.getSource().clear(),this.layer.setOpacity(t)},currentImageId:function(t){this.shown&&this.maybeFetchLaserpoints(t).then(this.maybeDrawLaserpoints)}},created:function(){this.settings.has("laserpointOpacity")&&(this.opacityValue=this.settings.get("laserpointOpacity")),ri.$on("images.fetching",this.maybeFetchLaserpoints),ri.$on("images.change",this.updateCurrentImage),ri.$on("annotations.map.init",this.extendMap)}},undefined,undefined,!1,null,null,null).exports;ui&&(ui.laserPoints=fi);const di=Vue.resource("api/v1/volumes{/id}/images/filter/laserpoints");Array.isArray(ci)&&ci.push({id:"laserpoints",types:["image"],label:"detected laser points",help:"All images that (don't) contain detected laser points.",listComponent:{mixins:[oi],data:function(){return{name:"detected laser points"}}},getSequence:function(t){return di.query({id:t})}});const _i=pi({mixins:[hi],components:{typeahead:ai},data:function(){return{volumeId:null,distance:1,processing:!1,error:!1,labels:[],label:null}},computed:{submitDisabled:function(){return this.loading||this.processing||!this.distance||!this.label}},methods:{handleError:function(t){422===t.status&&t.body.errors&&t.body.errors.id?(this.error=t.body.errors.id.join("\n"),this.processing=!1):si(t)},setProcessing:function(){this.processing=!0,this.error=!1},setLabels:function(t){this.labels=t.body},handleSelectLabel:function(t){this.label=t},loadLabels:function(){this.loading||0!==this.labels.length||(this.startLoading(),li.queryAnnotationLabels({id:this.volumeId}).then(this.setLabels).then(this.finishLoading).catch(si))},submit:function(){this.startLoading(),lt.processVolume({volume_id:this.volumeId},{distance:this.distance,label_id:this.label.id}).then(this.setProcessing).catch(this.handleError).finally(this.finishLoading)}},created:function(){this.volumeId=biigle.$require("volumes.volumeId")}},undefined,undefined,!1,null,null,null).exports;const gi=pi({mixins:[hi],components:{typeahead:ai},data:function(){return{image:null,distance:null,processing:!1,error:!1,labels:[],label:null}},computed:{submitDisabled:function(){return this.loading||this.processing||!this.distance||!this.label},volumeId:function(){return this.image.volume_id}},methods:{handleError:function(t){422===t.status&&t.body.errors&&t.body.errors.id?(this.error=t.body.errors.id.join("\n"),this.processing=!1):si(t)},setProcessing:function(){this.processing=!0,this.error=!1},setLabels:function(t){this.labels=t.body},handleSelectLabel:function(t){this.label=t},loadLabels:function(){this.loading||0!==this.labels.length||(this.startLoading(),li.queryAnnotationLabels({id:this.volumeId}).then(this.setLabels).then(this.finishLoading).catch(si))},submit:function(){this.loading||(this.startLoading(),lt.processImage({image_id:this.image.id},{distance:this.distance,label_id:this.label.id}).then(this.setProcessing).catch(this.handleError).finally(this.finishLoading))}},created:function(){this.image=biigle.$require("laserpoints.image"),this.distance=biigle.$require("laserpoints.distance")}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("laserpoints-panel",gi),Vue.component("laserpoints-form",_i)})()})(); \ No newline at end of file +(()=>{var t={582:function(t){t.exports=function(){"use strict";function t(t,n,s,r,o){!function t(i,n,s,r,o){for(;r>s;){if(r-s>600){var a=r-s+1,h=n-s+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(h-a/2<0?-1:1);t(i,n,Math.max(s,Math.floor(n-h*c/a+u)),Math.min(r,Math.floor(n+(a-h)*c/a+u)),o)}var d=i[n],g=s,f=r;for(e(i,s,n),o(i[r],d)>0&&e(i,s,r);g0;)f--}0===o(i[s],d)?e(i,s,f):e(i,++f,r),f<=n&&(s=f+1),n<=f&&(r=f-1)}}(t,n,s||0,r||t.length-1,o||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(e,i,n,s,r){for(var o=[i,n];o.length;)if(!((n=o.pop())-(i=o.pop())<=s)){var a=i+Math.ceil((n-i)/s/2)*s;t(e,a,i,n,r),o.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!g(t,e))return i;for(var n=this.toBBox,s=[];e;){for(var r=0;r=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var o=this._chooseSplitIndex(i,s,n),a=f(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,s,r,a,h,l,u,d=1/0,g=1/0,f=e;f<=i-e;f++){var _=o(t,0,f,this.toBBox),p=o(t,f,i,this.toBBox),m=(s=_,r=p,a=void 0,h=void 0,l=void 0,u=void 0,a=Math.max(s.minX,r.minX),h=Math.max(s.minY,r.minY),l=Math.min(s.maxX,r.maxX),u=Math.min(s.maxY,r.maxY),Math.max(0,l-a)*Math.max(0,u-h)),y=c(_)+c(p);m=e;g--){var f=t.children[g];a(h,t.leaf?s(f):f),l+=u(h)}return l},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}(()=>{"use strict";const t=0,e=1,n=2,s=3;function r(){throw new Error("Unimplemented abstract method.")}let o=0;function a(t){return t.ol_uid||(t.ol_uid=String(++o))}function h(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}class l{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=h(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new l({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return r()}getImage(t){return r()}getHitDetectionImage(){return r()}getPixelRatio(t){return 1}getImageState(){return r()}getImageSize(){return r()}getOrigin(){return r()}getSize(){return r()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=h(t)}listenImageChange(t){r()}load(){r()}unlistenImageChange(t){r()}ready(){return Promise.resolve()}}const c=l,u={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var d={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"],whitepoint:{2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}}};d.max=d.whitepoint[2].D65,d.rgb=function(t,e){e=e||d.whitepoint[2].E;var i,n,s,r=t[0]/e[0],o=t[1]/e[1],a=t[2]/e[2];return n=-.96924363628087*r+1.87596750150772*o+.041555057407175*a,s=.055630079696993*r+-.20397695888897*o+1.056971514242878*a,i=(i=3.240969941904521*r+-1.537383177570093*o+-.498610760293*a)>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*=12.92,[255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1)),255*(s=Math.min(Math.max(0,s),1))]},u.xyz=function(t,e){var i=t[0]/255,n=t[1]/255,s=t[2]/255,r=.21263900587151*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.71516867876775*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.072192315360733*(s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92),o=.019330818715591*i+.11919477979462*n+.95053215224966*s;return[(.41239079926595*i+.35758433938387*n+.18048078840183*s)*(e=e||d.whitepoint[2].E)[0],r*e[1],o*e[2]]};const g=d,f={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,i){var n,s,r,o,a,h,l,c,u;if(r=t[0],o=t[1],a=t[2],0===r)return[0,0,0];return e=e||"D65",i=i||2,n=o/(13*r)+4*(l=g.whitepoint[i][e][0])/(l+15*(c=g.whitepoint[i][e][1])+3*(u=g.whitepoint[i][e][2]))||0,s=a/(13*r)+9*c/(l+15*c+3*u)||0,[9*(h=r>8?c*Math.pow((r+16)/116,3):c*r*.0011070564598794539)*n/(4*s)||0,h,h*(12-3*n-20*s)/(4*s)||0]}};g.luv=function(t,e,i){var n,s,r,o,a,h,l,c,u,d,f;e=e||"D65",i=i||2,d=4*(l=g.whitepoint[i][e][0])/(l+15*(c=g.whitepoint[i][e][1])+3*(u=g.whitepoint[i][e][2])),f=9*c/(l+15*c+3*u),n=4*(o=t[0])/(o+15*(a=t[1])+3*(h=t[2]))||0,s=9*a/(o+15*a+3*h)||0;var _=a/c;return[r=_<=.008856451679035631?903.2962962962961*_:116*Math.pow(_,1/3)-16,13*r*(n-d),13*r*(s-f)]};var _={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]},xyz:function(t){return f.xyz(_.luv(t))}};const p=_;f.lchuv=function(t){var e=t[0],i=t[1],n=t[2],s=Math.sqrt(i*i+n*n),r=360*Math.atan2(n,i)/2/Math.PI;return r<0&&(r+=360),[e,s,r]},g.lchuv=function(t){return f.lchuv(g.luv(t))};const m={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]},y=function(t){var e,i,n=[],s=1;if("number"==typeof t)return{space:"rgb",values:[t>>>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(),m[t])n=m[t].slice(),i="rgb";else if("transparent"===t)s=0,i="rgb",n=[0,0,0];else if("#"===t[0]){var r=t.slice(1),o=r.length;s=1,o<=4?(n=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],4===o&&(s=parseInt(r[3]+r[3],16)/255)):(n=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],8===o&&(s=parseInt(r[6]+r[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var a=e[1],h="cmyk"===(i=a.replace(/a$/,""))?4:"gray"===i?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=n.shift()),n=n.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!==x[t])return x[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)})),s=n.length>h?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb");return{space:i,values:n,alpha:s}};var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};const v={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,i,n,s,r,o=t[0]/360,a=t[1]/100,h=t[2]/100,l=0;if(0===a)return[r=255*h,r,r];for(e=2*h-(i=h<.5?h*(1+a):h+a-h*a),s=[0,0,0];l<3;)(n=o+1/3*-(l-1))<0?n++:n>1&&n--,r=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,s[l++]=255*r;return s}};function S(t,e,i){return Math.min(Math.max(t,e),i)}function w(t,e,i,n,s,r){const o=s-i,a=r-n;if(0!==o||0!==a){const h=((t-i)*o+(e-n)*a)/(o*o+a*a);h>1?(i=s,n=r):h>0&&(i+=o*h,n+=a*h)}return C(t,e,i,n)}function C(t,e,i,n){const s=i-t,r=n-e;return s*s+r*r}function I(t,e){const i=t%e;return i*e<0?i+e:i}function R(t,e,i){return t+i*(e-t)}function b(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}u.hsl=function(t){var e,i,n=t[0]/255,s=t[1]/255,r=t[2]/255,o=Math.min(n,s,r),a=Math.max(n,s,r),h=a-o;return a===o?e=0:n===a?e=(s-r)/h:s===a?e=2+(r-n)/h:r===a&&(e=4+(n-s)/h),(e=Math.min(60*e,360))<0&&(e+=360),i=(o+a)/2,[e,100*(a===o?0:i<=.5?h/(a+o):h/(2-a-o)),100*i]};const E={};let M=0;function k(t){if(4===t.length)return t;const e=t.slice();return e[3]=1,e}function T(t){const e=g.lchuv(u.xyz(t));return e[3]=t[3],e}function F(t){if(E.hasOwnProperty(t))return E[t];if(M>=1024){let t=0;for(const e in E)0==(3&t++)&&(delete E[e],--M)}const e=function(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var i=y(t);if(!i.space)return[];const n="h"===i.space[0]?v.min:u.min,s="h"===i.space[0]?v.max:u.max;return(e=Array(3))[0]=Math.min(Math.max(i.values[0],n[0]),s[0]),e[1]=Math.min(Math.max(i.values[1],n[1]),s[1]),e[2]=Math.min(Math.max(i.values[2],n[2]),s[2]),"h"===i.space[0]&&(e=v.rgb(e)),e.push(Math.min(Math.max(i.alpha,0),1)),e}(t);if(4!==e.length)throw new Error('Failed to parse "'+t+'" as color');for(const i of e)if(isNaN(i))throw new Error('Failed to parse "'+t+'" as color');return A(e),E[t]=e,++M,e}function L(t){return Array.isArray(t)?t:F(t)}function A(t){return t[0]=S(t[0]+.5|0,0,255),t[1]=S(t[1]+.5|0,0,255),t[2]=S(t[2]+.5|0,0,255),t[3]=S(t[3],0,1),t}function O(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let i=t[1];i!=(0|i)&&(i=i+.5|0);let n=t[2];n!=(0|n)&&(n=n+.5|0);return"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(1e3*t[3])/1e3)+")"}const D="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",P=(D.includes("firefox"),D.includes("safari")&&!D.includes("chrom")&&(D.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(D)),D.includes("webkit")&&D.includes("edge"),D.includes("macintosh"),"undefined"!=typeof devicePixelRatio&&devicePixelRatio,"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope),G="undefined"!=typeof Image&&Image.prototype.decode;!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}}();function W(t,e,i,n){let s;return s=i&&i.length?i.shift():P?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(s.width=t),e&&(s.height=e),s.getContext("2d",n)}let z;function X(){return z||(z=W(1,1)),z}const Y=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};const B=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}};function N(t,e){return t>e?1:t0?s-1:s}return n-1}if(i>0){for(let i=1;i0)}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=U,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},tt="change";function et(t,e){return e&&(t.src=e),t.src&&G?new Promise(((e,i)=>t.decode().then((()=>e(t))).catch((n=>t.complete&&t.width?e(t):i(n))))):function(t,e){return new Promise(((i,n)=>{function s(){o(),i(t)}function r(){o(),n(new Error("Image load error"))}function o(){t.removeEventListener("load",s),t.removeEventListener("error",r)}t.addEventListener("load",s),t.addEventListener("error",r),e&&(t.src=e)}))}(t)}class it{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const n=nt(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){const n=nt(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(i,n,s,r,o){const a=nt(i,n,s),h=a in this.cache_;this.cache_[a]=r,o&&(r.getImageState()===t&&r.load(),r.getImageState()===e?r.ready().then((()=>{this.patternCache_[a]=X().createPattern(r.getImage(1),"repeat")})):this.patternCache_[a]=X().createPattern(r.getImage(1),"repeat")),h||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function nt(t,e,i){return e+":"+t+":"+(i?L(i):"null")}const st=new it;let rt=null;class ot extends Q{constructor(e,i,n,s,r){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=void 0===s?t:s,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=i,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===n){rt||(rt=W(1,1,void 0,{willReadFrequently:!0})),rt.drawImage(this.image_,0,0);try{rt.getImageData(0,0,1,1),this.tainted_=!1}catch(t){rt=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(tt)}handleImageError_(){this.imageState_=s,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=n,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=W(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===t){this.image_||this.initializeImage_(),this.imageState_=e;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch(t){this.handleImageError_()}this.image_ instanceof HTMLImageElement&&et(this.image_,this.src_).then((t=>{this.image_=t,this.handleImageLoad_()})).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==n)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const s=i.getContext("2d");var r;s.scale(t,t),s.drawImage(e,0,0),s.globalCompositeOperation="multiply",s.fillStyle="string"==typeof(r=this.color_)?r:O(r),s.fillRect(0,0,i.width/t,i.height/t),s.globalCompositeOperation="destination-in",s.drawImage(e,0,0),this.canvas_[t]=i}ready(){return this.ready_||(this.ready_=new Promise((t=>{this.imageState_===n||this.imageState_===s?t():this.addEventListener(tt,(function e(){this.imageState_!==n&&this.imageState_!==s||(this.removeEventListener(tt,e),t())}))}))),this.ready_}}function at(t,e,i,n,s,r){let o=void 0===e?void 0:st.get(e,i,s);return o||(o=new ot(t,t&&"src"in t?t.src||void 0:e,i,n,s),st.set(e,i,s,o,r)),r&&o&&!st.getPattern(e,i,s)&&st.set(e,i,s,o,r),o}function ht(t){return t?Array.isArray(t)?O(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return st.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,i=st.getPattern(e,void 0,t.color);if(i)return i;const s=st.get(t.src,"anonymous",null);if(s.getImageState()!==n)return null;const r=W(t.size[0],t.size[1]);return r.drawImage(s.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),at(r.canvas,e,void 0,n,t.color,!0),st.getPattern(e,void 0,t.color)}(t):t:null}const lt="propertychange";function ct(t,e,i,n,s){if(n&&n!==t&&(i=i.bind(n)),s){const n=i;i=function(){t.removeEventListener(e,i),n.apply(this,arguments)}}const r={target:t,type:e,listener:i};return t.addEventListener(e,i),r}function ut(t,e,i,n){return ct(t,e,i,n,!0)}function dt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),H(t))}class gt extends Q{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(tt)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let s=0;sMath.max(e,Pt(t,i))),0);return i[e]=n,n}function Wt(t,e,i,n,s,r,o,a,h,l,c){t.save(),1!==i&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=i:t.globalAlpha*=i),e&&t.transform.apply(t,e),n.contextInstructions?(t.translate(h,l),t.scale(c[0],c[1]),function(t,e){const i=t.contextInstructions;for(let t=0,n=i.length;tthis.imageState_=n)),this.render()}clone(){const t=this.getScale(),e=new zt({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,n=W(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let n=this.radius_,s=void 0===this.radius2_?n:this.radius2_;if(nMath.round(t*Jt[e])/Jt[e])).join(", ")+")"}const Kt=0,Qt=1,te=2,ee=4,ie=8,ne=16;function se(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function re(t,e,i){let n,s;return n=es&&(h|=ee),ar&&(h|=te),h===Kt&&(h=Qt),h}function ce(t,e,i,n,s){return s?(s[0]=t,s[1]=e,s[2]=i,s[3]=n,s):[t,e,i,n]}function ue(t){return ce(1/0,1/0,-1/0,-1/0,t)}function de(t,e){const i=t[0],n=t[1];return ce(i,n,i,n,e)}function ge(t,e,i,n,s){return pe(ue(s),t,e,i,n)}function fe(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function _e(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function pe(t,e,i,n,s){for(;i=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ee(t){return t[2]1){const e=t[2]-t[0],i=t[3]-t[1];for(let r=0;r=i[2])){const e=Re(i),s=Math.floor((n[0]-i[0])/e)*e;t[0]-=s,t[2]-=s}return t}const Te={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};const Fe=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Te[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},Le=6378137,Ae=Math.PI*Le,Oe=[-Ae,-Ae,Ae,Ae],De=[-180,-85,180,85],Pe=Le*Math.log(Math.tan(Math.PI/2));class Ge extends Fe{constructor(t){super({code:t,units:"m",extent:Oe,global:!0,worldExtent:De,getPointResolution:function(t,e){return t/Math.cosh(e[1]/Le)}})}}const We=[new Ge("EPSG:3857"),new Ge("EPSG:102100"),new Ge("EPSG:102113"),new Ge("EPSG:900913"),new Ge("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ge("http://www.opengis.net/gml/srs/epsg.xml#3857")];function ze(t,e,i){const n=t.length;i=i>1?i:2,void 0===e&&(e=i>2?t.slice():new Array(n));for(let s=0;sPe?i=Pe:i<-Pe&&(i=-Pe),e[s+1]=i}return e}function Xe(t,e,i){const n=t.length;i=i>1?i:2,void 0===e&&(e=i>2?t.slice():new Array(n));for(let s=0;s=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Ue(t,e){if(e.canWrapX()){const i=Re(e.getExtent()),n=function(t,e,i){const n=e.getExtent();let s=0;e.canWrapX()&&(t[0]n[2])&&(i=i||Re(n),s=Math.floor((t[0]-n[0])/i));return s}(t,e,i);n&&(t[0]-=n*i)}return t}const Je={info:1,warn:2,error:3,none:4};let He=Je.info;let Ke=!0;function Qe(t){Ke=!(void 0===t||t)}function ti(t,e){if(void 0!==e)for(let i=0,n=t.length;i=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Ke=!1,function(...t){He>Je.warn||console.warn(...t)}("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function fi(t,e){return ci?li(t,e,ci):t}function _i(t,e){return ci?li(t,ci,e):t}function pi(t,e){if(!ci)return t;const i=ni(e).getMetersPerUnit(),n=ci.getMetersPerUnit();return i&&n?t*i/n:t}var mi,yi,xi;function vi(t,e,i,n,s,r){r=r||[];let o=0;for(let a=e;a{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return r()}closestPointXY(t,e,i,n){return r()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return r()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&ue(t),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)}rotate(t,e){r()}scale(t,e,i){r()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return r()}getType(){return r()}applyTransform(t){r()}intersectsExtent(t){return r()}translate(t,e){r()}transform(t,e){const i=ni(t),n="tile-pixels"==i.getUnits()?function(t,n,s){const r=i.getExtent(),o=i.getWorldExtent(),a=we(o)/we(r);return qt(wi,o[0],o[3],a,-a,0,0,0),vi(t,0,t.length,s,wi,n),ai(i,e)(t,n,s)}:ai(i,e);return this.applyTransform(n),this}};function Ii(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}const Ri=class extends Ci{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return ge(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return r()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length{this.patternImage_=null})),n.getImageState()===t&&n.load(),n.getImageState()===e&&(this.patternImage_=n)}this.color_=i}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const Ai=Li;class Oi{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Gi,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new Oi({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Gi,this.geometry_=t}setZIndex(t){this.zIndex_=t}}let Di=null;function Pi(t,e){if(!Di){const t=new Ai({color:"rgba(255,255,255,0.4)"}),e=new Fi({color:"#3399CC",width:1.25});Di=[new Oi({image:new Bt({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return Di}function Gi(t){return t.getGeometry()}const Wi=Oi,zi="opacity",Xi="visible",Yi="extent",Bi="zIndex",Ni="maxResolution",Zi="minResolution",ji="maxZoom",Vi="minZoom",$i="source",qi="map";const Ui=class extends pt{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[zi]=void 0!==t.opacity?t.opacity:1,Nt("number"==typeof e[zi],"Layer opacity must be a number"),e[Xi]=void 0===t.visible||t.visible,e[Bi]=t.zIndex,e[Ni]=void 0!==t.maxResolution?t.maxResolution:1/0,e[Zi]=void 0!==t.minResolution?t.minResolution:0,e[Vi]=void 0!==t.minZoom?t.minZoom:-1/0,e[ji]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=S(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return r()}getLayerStatesArray(t){return r()}getExtent(){return this.get(Yi)}getMaxResolution(){return this.get(Ni)}getMinResolution(){return this.get(Zi)}getMinZoom(){return this.get(Vi)}getMaxZoom(){return this.get(ji)}getOpacity(){return this.get(zi)}getSourceState(){return r()}getVisible(){return this.get(Xi)}getZIndex(){return this.get(Bi)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(Yi,t)}setMaxResolution(t){this.set(Ni,t)}setMinResolution(t){this.set(Zi,t)}setMaxZoom(t){this.set(ji,t)}setMinZoom(t){this.set(Vi,t)}setOpacity(t){Nt("number"==typeof t,"Layer opacity must be a number"),this.set(zi,t)}setVisible(t){this.set(Xi,t)}setZIndex(t){this.set(Bi,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}},Ji="prerender",Hi="postrender",Ki="precompose",Qi=0,tn=1,en={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function nn(t,e,i){return function(n,s,r,o,a){if(!n)return;if(!s&&!e)return n;const h=e?0:r[0]*s,l=e?0:r[1]*s,c=a?a[0]:0,u=a?a[1]:0;let d=t[0]+h/2+c,g=t[2]-h/2+c,f=t[1]+l/2+u,_=t[3]-l/2+u;d>g&&(d=(g+d)/2,g=d),f>_&&(f=(_+f)/2,_=f);let p=S(n[0],d,g),m=S(n[1],f,_);if(o&&i&&s){const t=30*s;p+=-t*Math.log(1+Math.max(0,d-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-g)/t),m+=-t*Math.log(1+Math.max(0,f-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-_)/t)}return[p,m]}}function sn(t){return t}function rn(t,e,i,n){const s=Re(e)/i[0],r=we(e)/i[1];return n?Math.min(t,Math.max(s,r)):Math.min(t,Math.min(s,r))}function on(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),S(n,i/2,2*e)}function an(t,e,i,n,s){return i=void 0===i||i,function(r,o,a,h){if(void 0!==r){const o=n?rn(t,n,a,s):t;return i&&h?on(r,o,e):S(r,e,o)}}}function hn(t){if(void 0!==t)return 0}function ln(t){if(void 0!==t)return t}function cn(t){const e=void 0===t?5*Math.PI/180:t;return function(t,i){return i||void 0===t?t:Math.abs(t)<=e?0:t}}function un(t){return 1-function(t){return Math.pow(t,3)}(1-t)}function dn(t){return 3*t*t-2*t*t*t}function gn(t,e,i,n,s,r,o){const a=t[e],h=t[e+1],l=t[i]-a,c=t[i+1]-h;let u;if(0===l&&0===c)u=e;else{const d=((s-a)*l+(r-h)*c)/(l*l+c*c);if(d>1)u=i;else{if(d>0){for(let s=0;ss&&(s=a),r=i,o=n}return s}function _n(t,e,i,n,s){for(let r=0,o=i.length;r0;){const i=l.pop(),r=l.pop();let o=0;const a=t[r],u=t[r+1],d=t[i],g=t[i+1];for(let e=r+n;eo&&(c=e,o=i)}o>s&&(h[(c-e)/n]=1,r+n0&&f>d)&&(g<0&&_0&&_>g)?(a=i,h=u):(r[o++]=a,r[o++]=h,l=a,c=h,a=i,h=u)}return r[o++]=a,r[o++]=h,o}function wn(t,e,i,n,s,r,o,a){for(let h=0,l=i.length;hr&&(i-a)*(r-h)-(s-a)*(n-h)>0&&o++:n<=r&&(i-a)*(r-h)-(s-a)*(n-h)<0&&o--,a=i,h=n}return 0!==o}function Ln(t,e,i,n,s,r){if(0===i.length)return!1;if(!Fn(t,e,i[0],n,s,r))return!1;for(let e=1,o=i.length;em&&(l=(c+u)/2,Ln(t,e,i,n,l,f)&&(p=l,m=s)),c=u}return isNaN(p)&&(p=s[r]),o?(o.push(p,f,m),o):[p,f,m]}function On(t,e,i,n,s){const r=pe([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!be(s,r)&&(!!ae(s,r)||(r[0]>=s[0]&&r[2]<=s[2]||(r[1]>=s[1]&&r[3]<=s[3]||function(t,e,i,n,s){let r;for(e+=n;e=o&&_<=h),n||!(r&ee)||s&ee||(p=g-(d-h)*f,n=p>=a&&p<=l),n||!(r&ie)||s&ie||(_=d-(g-a)/f,n=_>=o&&_<=h),n||!(r&ne)||s&ne||(p=g-(d-o)*f,n=p>=a&&p<=l)}return n}(s,t,e)})))))}function Dn(t,e,i,n,s){if(!function(t,e,i,n,s){return!!(On(t,e,i,n,s)||Fn(t,e,i,n,s[0],s[1])||Fn(t,e,i,n,s[0],s[3])||Fn(t,e,i,n,s[2],s[1])||Fn(t,e,i,n,s[2],s[3]))}(t,e,i[0],n,s))return!1;if(1===i.length)return!0;for(let e=1,r=i.length;e0}function Wn(t,e,i,n,s){s=void 0!==s&&s;for(let r=0,o=i.length;rc&&d1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);let n=0;for(;n0}getInteracting(){return this.hints_[tn]>0}cancelAnimations(){let t;this.setHint(Qi,-this.hints_[Qi]);for(let e=0,i=this.animations_.length;e=0;--i){const n=this.animations_[i];let s=!0;for(let i=0,r=n.length;i0?o/r.duration:1;a>=1?(r.complete=!0,a=1):s=!1;const h=r.easing(a);if(r.sourceCenter){const t=r.sourceCenter[0],e=r.sourceCenter[1],i=r.targetCenter[0],n=r.targetCenter[1];this.nextCenter_=r.targetCenter;const s=t+h*(i-t),o=e+h*(n-e);this.targetCenter_=[s,o]}if(r.sourceResolution&&r.targetResolution){const t=1===h?r.targetResolution:r.sourceResolution+h*(r.targetResolution-r.sourceResolution);if(r.anchor){const e=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(i,r.anchor)}this.nextResolution_=r.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==r.sourceRotation&&void 0!==r.targetRotation){const t=1===h?I(r.targetRotation+Math.PI,2*Math.PI)-Math.PI:r.sourceRotation+h*(r.targetRotation-r.sourceRotation);if(r.anchor){const e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,r.anchor)}this.nextRotation_=r.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!r.complete)break}if(s){this.animations_[i]=null,this.setHint(Qi,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const t=n[0].callback;t&&Bn(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();var s,r;return void 0!==n&&(i=[n[0]-e[0],n[1]-e[1]],function(t,e){const i=Math.cos(e),n=Math.sin(e),s=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;t[0]=s,t[1]=r}(i,t-this.getRotation()),r=e,(s=i)[0]+=+r[0],s[1]+=+r[1]),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),s=this.getResolution();if(void 0!==n&&void 0!==s){i=[e[0]-t*(e[0]-n[0])/s,e[1]-t*(e[1]-n[1])/s]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t?di(t,this.getProjection()):t}getCenterInternal(){return this.get(en.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){return fi(this.calculateExtentInternal(t),this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Nt(e,"The view center is not defined");const i=this.getResolution();Nt(void 0!==i,"The view resolution is not defined");const n=this.getRotation();return Nt(void 0!==n,"The view rotation is not defined"),Se(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(en.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(_i(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Re(t)/e[0],n=we(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(i){return e/Math.pow(t,i*n)}}getRotation(){return this.get(en.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const s=this.padding_;if(s){const t=this.getViewportSizeMinusPadding_();n=Zn(n,this.getViewportSize_(),[t[0]/2+s[3],t[1]/2+s[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,i,n=this.minZoom_||0;if(this.resolutions_){const s=Z(this.resolutions_,t,1);n=s,e=this.resolutions_[s],i=s==this.resolutions_.length-1?2:e/this.resolutions_[s+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=S(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,S(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(Nt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Nt(!Ee(t),"Cannot fit empty extent provided as `geometry`");i=Yn(_i(t,this.getProjection()))}else if("Circle"===t.getType()){const e=_i(t.getExtent(),this.getProjection());i=Yn(e),i.rotate(this.getRotation(),ve(e))}else{const e=ui();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),s=t.getFlatCoordinates(),r=t.getStride();let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let t=0,e=s.length;t{this.dispatchEvent("sourceready")}),0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e;const i=this.getMapInternal();let n;!t&&i&&(t=i.getView()),e=t instanceof jn?{viewState:t.getState(),extent:t.calculateExtent()}:t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray()),n=e.layerStatesArray?e.layerStatesArray.find((t=>t.layer===this)):this.getLayerState();const s=this.getExtent();return function(t,e){if(!t.visible)return!1;const i=e.resolution;if(i=t.maxResolution)return!1;const n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}(n,e.viewState)&&(!s||be(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];let n=e(t instanceof jn?t.getViewStateAndExtent():t);return Array.isArray(n)||(n=[n]),n}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(qi,t)}getMapInternal(){return this.get(qi)}setMap(t){this.mapPrecomposeKey_&&(dt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(dt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ct(t,Ki,(function(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Nt(!e.some((function(t){return t.layer===i.layer})),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}),this),this.mapRenderKey_=ct(this,tt,t.render,t),this.changed())}setSource(t){this.set($i,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}};var $n=i(582);function qn(t,e,i,n){return void 0!==i&&void 0!==n?[i/t,n/e]:void 0!==i?i/t:void 0!==n?n/e:1}class Un extends c{constructor(i){const s=void 0!==(i=i||{}).opacity?i.opacity:1,r=void 0!==i.rotation?i.rotation:0,o=void 0!==i.scale?i.scale:1,h=void 0!==i.rotateWithView&&i.rotateWithView;super({opacity:s,rotation:r,scale:o,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:h,declutterMode:i.declutterMode}),this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:"fraction",this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;const l=void 0!==i.img?i.img:null;let c,u=i.src;if(Nt(!(void 0!==u&&l),"`image` and `src` cannot be provided at the same time"),void 0!==u&&0!==u.length||!l||(u=l.src||a(l)),Nt(void 0!==u&&u.length>0,"A defined and non-empty `src` or `image` must be provided"),Nt(!((void 0!==i.width||void 0!==i.height)&&void 0!==i.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==i.src?c=t:void 0!==l&&(c="complete"in l?l.complete?l.src?n:t:e:n),this.color_=void 0!==i.color?L(i.color):null,this.iconImage_=at(l,u,this.crossOrigin_,c,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==i.size?i.size:null,void 0!==i.width||void 0!==i.height){let t,e;if(i.size)[t,e]=i.size;else{const n=this.getImage(1);if(n.width&&n.height)t=n.width,e=n.height;else if(n instanceof HTMLImageElement){this.initialOptions_=i;const t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;const e=this.iconImage_.getSize();this.setScale(qn(e[0],e[1],i.width,i.height))};return void this.listenImageChange(t)}}void 0!==t&&this.setScale(qn(t,e,i.width,i.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Un({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),"top-right"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[0]=-t[0]+e[0]),"bottom-left"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),"top-right"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[0]=i[0]-e[0]-t[0]),"bottom-left"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:this.iconImage_.getImageState()==n?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){const t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:this.iconImage_.getImageState()==n?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(tt,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(tt,t)}ready(){return this.iconImage_.ready()}}const Jn=Un;class Hn{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=h(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new Ai({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Hn({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=h(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const Kn=Hn;let Qn=0;const ts=1<void 0!==e?function(t){switch(t){case"string":return is;case"color":return ns;case"number":return es;case"boolean":return ts;case"number[]":return ss;default:throw new Error(`Unrecognized type hint: ${t}`)}}(e.value):os),lr(1,2),(function(t,e){const i=_s(t[1],e);if(!(i instanceof ds))throw new Error("Expected a literal argument for get operation");if("string"!=typeof i.value)throw new Error("Expected a string argument for get operation");if(e.properties.add(i.value),3===t.length){const n=_s(t[2],e);return[i,n]}return[i]})),[ms]:gr((([t])=>t.type),lr(1,1),(function(t,e,i,n){const s=t[1];if("string"!=typeof s)throw new Error("Expected a string argument for var operation");if(e.variables.add(s),!("variables"in e.style)||void 0===e.style.variables[s])return[new ds(os,s)];const r=_s(e.style.variables[s],e);if(r.value=s,n&&!cs(n,r.type))throw new Error(`The variable ${s} has type ${ls(r.type)} but the following type was expected: ${ls(n)}`);return[r]})),[nr]:gr(es|is,hr,(function(t,e){e.featureId=!0})),[ys]:gr(is,lr(2,1/0),cr(os)),[xs]:gr(is,hr,(function(t,e){e.geometryType=!0})),[Cs]:gr(es,hr),[Is]:gr(es,hr),[Rs]:gr(es,hr),[vs]:gr(ts,lr(2,1/0),cr(ts)),[Ss]:gr(ts,lr(2,1/0),cr(ts)),[ws]:gr(ts,lr(1,1),cr(ts)),[bs]:gr(ts,lr(2,2),cr(os),ur),[Es]:gr(ts,lr(2,2),cr(os),ur),[Ms]:gr(ts,lr(2,2),cr(os),ur),[ks]:gr(ts,lr(2,2),cr(os),ur),[Ts]:gr(ts,lr(2,2),cr(os),ur),[Fs]:gr(ts,lr(2,2),cr(os),ur),[Ls]:gr((t=>{let e=es|ns;for(let i=0;i{let e=os;for(let i=1;i{let e=os;for(let i=2;i{let e=ns|es;for(let i=3;i{let e=os;for(let i=1;i2===t.length?ss|rs:3===t.length||4===t.length?ss|ns:ss),lr(1,1/0),cr(es)),[ir]:gr(ns,lr(1,4),cr(es)),[sr]:gr(es,lr(1,3),cr(es)),[rr]:gr(ns,lr(2,2),(function(t,e){const i=_s(t[1],e,es);if(i.type!==es)throw new Error(`The first argument of palette must be an number, got ${ls(i.type)} instead`);const n=t[2];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");const s=new Array(n.length);for(let t=0;te){throw new Error(`Expected ${e===1/0?`${t} or more`:`${t} to ${e}`} arguments for ${s}, got ${r}`)}}}function cr(t){return function(e,i){const n=e[0],s=e.length-1,r=new Array(s);for(let o=0;o{for(let e=0;e{for(let e=0;et.properties[i];case ms:return t=>t.variables[i];default:throw new Error(`Unsupported accessor operator ${t.operator}`)}}(t);case nr:return t=>t.featureId;case xs:return t=>t.geometryType;case ys:{const i=t.args.map((t=>pr(t,e)));return t=>"".concat(...i.map((e=>e(t).toString())))}case Cs:return t=>t.resolution;case vs:case Ss:case qs:case Ks:case ws:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{for(let e=0;e{for(let e=0;e{const e=s[0](t),i=s[1](t),n=s[2](t);return e>=i&&e<=n};case Ks:return t=>{const e=s[0](t);for(let i=1;i!s[0](t);default:throw new Error(`Unsupported logical operator ${i}`)}}(t,e);case bs:case Es:case Ts:case Fs:case Ms:case ks:return function(t,e){const i=t.operator,n=pr(t.args[0],e),s=pr(t.args[1],e);switch(i){case bs:return t=>n(t)===s(t);case Es:return t=>n(t)!==s(t);case Ts:return t=>n(t)n(t)<=s(t);case Ms:return t=>n(t)>s(t);case ks:return t=>n(t)>=s(t);default:throw new Error(`Unsupported comparison operator ${i}`)}}(t,e);case Ls:case As:case Os:case Ds:case Ps:case Gs:case Ws:case zs:case Xs:case Ys:case Bs:case Ns:case Zs:case js:case Vs:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{let e=1;for(let i=0;is[0](t)/s[1](t);case Os:return t=>{let e=0;for(let i=0;is[0](t)-s[1](t);case Ps:return t=>{const e=s[0](t),i=s[1](t);if(en?n:e};case Gs:return t=>s[0](t)%s[1](t);case Ws:return t=>Math.pow(s[0](t),s[1](t));case zs:return t=>Math.abs(s[0](t));case Xs:return t=>Math.floor(s[0](t));case Ys:return t=>Math.ceil(s[0](t));case Bs:return t=>Math.round(s[0](t));case Ns:return t=>Math.sin(s[0](t));case Zs:return t=>Math.cos(s[0](t));case js:return 2===n?t=>Math.atan2(s[0](t),s[1](t)):t=>Math.atan(s[0](t));case Vs:return t=>Math.sqrt(s[0](t));default:throw new Error(`Unsupported numeric operator ${i}`)}}(t,e);case Hs:return function(t,e){const i=t.args.length,n=new Array(i);for(let s=0;s{for(let e=0;e{const e=n[0](t);for(let s=1;s{const e=n[0](t),s=n[1](t);let r,o;for(let a=2;a=s)return 2===a?h:l?yr(e,s,r,o,i,h):mr(e,s,r,o,i,h);r=i,o=h}return o}}(t,e);case or:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{const i=s[0](e);return t.args[0].type===ns?O(i):i.toString()};throw new Error(`Unsupported convert operator ${i}`)}(t,e);default:throw new Error(`Unsupported operator ${i}`)}}function mr(t,e,i,n,s,r){const o=s-i;if(0===o)return n;const a=e-i;return n+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(r-n)}function yr(t,e,i,n,s,r){if(0===s-i)return n;const o=T(n),a=T(r);let h=a[2]-o[2];h>180?h-=360:h<-180&&(h+=360);return A(function(t){const e=g.rgb(p.xyz(t));return e[3]=t[3],e}([mr(t,e,i,o[0],s,a[0]),mr(t,e,i,o[1],s,a[1]),o[2]+mr(t,e,i,0,s,h),mr(t,e,i,n[3],s,r[3])]))}function xr(t){return!0}function vr(t){const e=fs(),i=function(t,e){const i=t.length,n=new Array(i);for(let s=0;s4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return i}function Yr(t,e){const i=Gr(t,e);if(2!==i.length)throw new Error(`Expected an array of two numbers for ${e}`);return i}const Br="renderOrder";const Nr=class extends Vn{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Br)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter==!1&&(t.declutter[i]=new $n(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Br,t)}setStyle(t){this.style_=void 0===t?Pi:t;const e=function(t){if(void 0===t)return Pi;if(!t)return null;if("function"==typeof t)return t;if(t instanceof Wi)return t;if(!Array.isArray(t))return Sr([t]);if(0===t.length)return[];const e=t.length,i=t[0];if(i instanceof Wi){const i=new Array(e);for(let n=0;na&&(this.instructions.push([Ur.CUSTOM,a,l,t,i,Cn,s]),this.hitDetectionInstructions.push([Ur.CUSTOM,a,l,t,n||i,Cn,s]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),l=this.coordinates.length,this.instructions.push([Ur.CUSTOM,a,l,t,i,void 0,s]),this.hitDetectionInstructions.push([Ur.CUSTOM,a,l,t,n||i,void 0,s])}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[Ur.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Ur.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const i=t.length;let n,s,r=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[Ur.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[Ur.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,s=t.lineDash,r=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||s!=t.currentLineDash&&!$(t.currentLineDash,s)||t.currentLineDashOffset!=r||t.currentLineJoin!=o||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=s,t.currentLineDashOffset=r,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[Ur.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(t=this.maxExtent,e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;se(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}var t,e;return this.bufferedMaxExtent_}};const Kr=class extends Hr{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!oe(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),s=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(n,s);this.instructions.push([Ur.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Ur.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),s=[];for(let e=0,i=n.length;e=t){const e=(t-a+u)/u,d=R(i,l,e),g=R(n,c,e);h.push(d,g),r.push(h),h=[d,g],a==t&&(o+=s),a=0}else if(a0&&r.push(h),r}function io(t,e,i,n,s){let r,o,a,h,l,c,u,d,g,f,_=i,p=i,m=0,y=0,x=i;for(o=i;ot&&(y>m&&(m=y,_=x,p=o),y=0,x=o-s)),a=h,u=g,d=f),l=i,c=n}return y+=h,y>m?[x,o]:[_,p]}const no={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};const so=class extends Hr{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates["#000"]={fillStyle:St},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const n=this.textFillState_,s=this.textStrokeState_,r=this.textState_;if(""===this.text_||!r||!n&&!s)return;const o=this.coordinates;let a=o.length;const h=t.getType();let l=null,c=t.getStride();if("line"!==r.placement||"LineString"!=h&&"MultiLineString"!=h&&"Polygon"!=h&&"MultiPolygon"!=h){let n=r.overflow?null:[];switch(h){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),c=2;break;case"Polygon":l=t.getFlatInteriorPoint(),r.overflow||n.push(l[2]/this.resolution),c=3;break;case"MultiPolygon":const e=t.getFlatInteriorPoints();l=[];for(let t=0,i=e.length;t{const n=o[2*(t+i)]===l[i*c]&&o[2*(t+i)+1]===l[i*c+1];return n||--t,n}))}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&this.updateFillStyle(this.state,this.createFill),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let u=r.padding;if(u!=Mt&&(r.scale[0]<0||r.scale[1]<0)){let t=r.padding[0],e=r.padding[1],i=r.padding[2],n=r.padding[3];r.scale[0]<0&&(e=-e,n=-n),r.scale[1]<0&&(t=-t,i=-i),u=[t,e,i,n]}const d=this.pixelRatio;this.instructions.push([Ur.DRAW_IMAGE,a,s,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,u==Mt?Mt:u.map((function(t){return t*d})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);const g=1/d,f=this.state.fillStyle;r.backgroundFill&&(this.state.fillStyle=St,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([Ur.DRAW_IMAGE,a,s,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[g,g],NaN,this.declutterMode_,this.declutterImageWithText_,u,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?St:this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),r.backgroundFill&&(this.state.fillStyle=f,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}else{if(!be(this.maxExtent,t.getExtent()))return;let n;if(l=t.getFlatCoordinates(),"LineString"==h)n=[l.length];else if("MultiLineString"==h)n=t.getEnds();else if("Polygon"==h)n=t.getEnds().slice(0,1);else if("MultiPolygon"==h){const e=t.getEndss();n=[];for(let t=0,i=e.length;t{const r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,s,r)}}forEachFeatureAtCoordinate(t,e,i,n,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;e.getState()!==n&&e.getState()!==s||this.renderIfReadyAndVisible()}loadImage(e){let i=e.getState();return i!=n&&i!=s&&e.addEventListener(tt,this.boundHandleImageChange_),i==t&&(e.load(),i=e.getState()),i==n}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}};const ho=class extends B{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}};const lo=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(X(),{get:(t,e)=>{if("function"==typeof X()[e])return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,i),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach((e=>{for(let i=0,n=e.length;it[2]}else M=v>b;const k=Math.PI,T=[],F=w+n===e;let L;if(p=0,m=C,d=t[e=w],g=t[e+1],F){y(),L=Math.atan2(g-_,d-f),M&&(L+=L>0?-k:k);const t=(b+v)/2,e=(E+S)/2;return T[0]=[t,e,(I-r)/2,L,s],T}for(let t=0,u=(s=s.replace(/\n/g," ")).length;t0?-k:k),void 0!==L){let t=v-L;if(t+=t>k?-2*k:t<-k?2*k:0,Math.abs(t)>o)return null}L=v;const S=t;let w=0;for(;t0&&t.push("\n",""),t.push(e,""),t}const Ro=class{constructor(t,e,i,n,s){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new lo:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,n){const s=t+e+i+n;if(this.labels_[s])return this.labels_[s];const r=n?this.strokeStates[n]:null,o=i?this.fillStates[i]:null,a=this.textStates[e],h=this.pixelRatio,l=[a.scale[0]*h,a.scale[1]*h],c=Array.isArray(t),u=a.justify?no[a.justify]:Co(Array.isArray(t)?t[0]:t,a.textAlign||bt),d=n&&r.lineWidth?r.lineWidth:0,g=c?t:t.split("\n").reduce(Io,[]),{width:f,height:_,widths:p,heights:m,lineWidths:y}=function(t,e){const i=[],n=[],s=[];let r=0,o=0,a=0,h=0;for(let l=0,c=e.length;l<=c;l+=2){const u=e[l];if("\n"===u||l===c){r=Math.max(r,o),s.push(o),o=0,a+=h,h=0;continue}const d=e[l+1]||t.font,g=Pt(d,u);i.push(g),o+=g;const f=Ot(d);n.push(f),h=Math.max(h,f)}return{width:r,height:a,widths:i,heights:n,lineWidths:s}}(a,g),x=f+d,v=[],S=(x+2)*l[0],w=(_+d)*l[1],C={width:S<0?Math.floor(S):Math.ceil(S),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:v};1==l[0]&&1==l[1]||v.push("scale",l),n&&(v.push("strokeStyle",r.strokeStyle),v.push("lineWidth",d),v.push("lineCap",r.lineCap),v.push("lineJoin",r.lineJoin),v.push("miterLimit",r.miterLimit),v.push("setLineDash",[r.lineDash]),v.push("lineDashOffset",r.lineDashOffset)),i&&v.push("fillStyle",o.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");const I=.5-u;let R=u*x+I*d;const b=[],E=[];let M,k=0,T=0,F=0,L=0;for(let t=0,e=g.length;tt?t-h:s,x=r+l>e?e-l:r,v=g[3]+y*u[0]+g[1],S=g[0]+x*u[1]+g[2],w=p-g[3],C=m-g[0];let I;return(f||0!==c)&&(mo[0]=w,vo[0]=w,mo[1]=C,yo[1]=C,yo[0]=w+v,xo[0]=yo[0],xo[1]=C+S,vo[1]=xo[1]),0!==c?(I=qt([1,0,0,1,0,0],i,n,1,1,c,-i,-n),$t(I,mo),$t(I,yo),$t(I,xo),$t(I,vo),ce(Math.min(mo[0],yo[0],xo[0],vo[0]),Math.min(mo[1],yo[1],xo[1],vo[1]),Math.max(mo[0],yo[0],xo[0],vo[0]),Math.max(mo[1],yo[1],xo[1],vo[1]),po)):ce(Math.min(w,w+v),Math.min(C,C+S),Math.max(w,w+v),Math.max(C,C+S),po),d&&(p=Math.round(p),m=Math.round(m)),{drawImageX:p,drawImageY:m,drawImageW:y,drawImageH:x,originX:h,originY:l,declutterBox:{minX:po[0],minY:po[1],maxX:po[2],maxY:po[3],value:_},canvasTransform:I,scale:u}}replayImageOrLabel_(t,e,i,n,s,r,o){const a=!(!r&&!o),h=n.declutterBox,l=o?o[2]*n.scale[0]/2:0;return h.minX-l<=e[0]&&h.maxX+l>=0&&h.minY-l<=e[1]&&h.maxY+l>=0&&(a&&this.replayTextBackground_(t,mo,yo,xo,vo,r,o),Wt(t,n.canvasTransform,s,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=$t(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(i[0]%n,i[1]%n),1!==e&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,n){const s=this.textStates[e],r=this.createLabel(t,e,n,i),o=this.strokeStates[i],a=this.pixelRatio,h=Co(Array.isArray(t)?t[0]:t,s.textAlign||bt),l=no[s.textBaseline||Et],c=o&&o.lineWidth?o.lineWidth:0;return{label:r,anchorX:h*(r.width/a-2*s.scale[0])+2*(.5-h)*c,anchorY:l*r.height/a+2*(.5-l)*c}}execute_(t,e,i,n,s,r,o,a){const h=this.zIndexContext_;let l;var c,u;this.pixelCoordinates_&&$(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=vi(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),c=this.renderedTransform_,u=i,c[0]=u[0],c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5]);let d=0;const g=n.length;let f,_,p,m,y,x,v,S,w,C,I,R,b,E=0,M=0,k=0,T=null,F=null;const L=this.coordinateCache_,A=this.viewRotation_,O=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},P=this.instructions!=n||this.overlaps?0:200;let G,W,z,X;for(;dP&&(this.fill_(t),M=0),k>P&&(t.stroke(),k=0),M||k||(t.beginPath(),y=NaN,x=NaN),++d;break;case Ur.CIRCLE:E=i[1];const n=l[E],c=l[E+1],u=l[E+2]-n,g=l[E+3]-c,Y=Math.sqrt(u*u+g*g);t.moveTo(n+Y,c),t.arc(n,c,Y,0,2*Math.PI,!0),++d;break;case Ur.ELLIPSE:E=i[1],f=i[2];const B=l[E],N=l[E+1],Z=l[E+2],j=l[E+3],V=l[E+4],$=l[E+5],q=l[E+6],U=l[E+7];if(f-E==8){const e=.2761424*(V-B),i=.2761424*($-N),n=.2761424*(q-Z),s=.2761424*(U-j);t.moveTo(B,N),t.bezierCurveTo(B-n,N-s,Z-e,j-i,Z,j),t.bezierCurveTo(Z+e,j+i,V-n,$-s,V,$),t.bezierCurveTo(V+n,$+s,q+e,U+i,q,U),t.bezierCurveTo(q-e,U-i,B+n,N+s,B,N)}++d;break;case Ur.CLOSE_PATH:t.closePath(),++d;break;case Ur.CUSTOM:E=i[1],f=i[2];const J=i[3],H=i[4],K=i[5];D.geometry=J,D.feature=G,d in L||(L[d]=[]);const Q=L[d];K?K(l,E,f,2,Q):(Q[0]=l[E],Q[1]=l[E+1],Q.length=2),h&&(h.zIndex=i[6]),H(Q,D),++d;break;case Ur.DRAW_IMAGE:E=i[1],f=i[2],w=i[3],_=i[4],p=i[5];let tt=i[6];const et=i[7],it=i[8],nt=i[9],st=i[10];let rt=i[11];const ot=i[12];let at=i[13];m=i[14]||"declutter";const ht=i[15];if(!w&&i.length>=20){C=i[19],I=i[20],R=i[21],b=i[22];const t=this.drawLabelWithPointPlacement_(C,I,R,b);w=t.label,i[3]=w;const e=i[23];_=(t.anchorX-e)*this.pixelRatio,i[4]=_;const n=i[24];p=(t.anchorY-n)*this.pixelRatio,i[5]=p,tt=w.height,i[6]=tt,at=w.width,i[13]=at}let lt,ct,ut,dt;i.length>25&&(lt=i[25]),i.length>17?(ct=i[16],ut=i[17],dt=i[18]):(ct=Mt,ut=!1,dt=!1),st&&O?rt+=A:st||O||(rt-=A);let gt=0;for(;E!Eo.includes(t)));const ko={};const To=class{constructor(t,e,i,n,s,r,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,o)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let n=this.executorsByZIndex_[i];void 0===n&&(n={},this.executorsByZIndex_[i]=n);const s=t[i];for(const t in s){const i=s[t];n[t]=new Ro(this.resolution_,this.pixelRatio_,this.overlaps_,i,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let e=0,n=t.length;ei)break;let a=n[o];a||(a=[],n[o]=a),a.push(4*((t+s)*e+(t+r))+3),s>0&&a.push(4*((t-s)*e+(t+r))+3),r>0&&(a.push(4*((t+s)*e+(t-r))+3),s>0&&a.push(4*((t-s)*e+(t-r))+3))}const s=[];for(let t=0,e=n.length;t0){if(!r||"none"===i||"Image"!==d&&"Text"!==d||r.includes(t)){const i=(u[h]-3)/4,r=n-i%o,a=n-(i/o|0),l=s(t,e,r*r+a*a);if(l)return l}l.clearRect(0,0,o,o);break}}const f=Object.keys(this.executorsByZIndex_).map(Number);let _,p,m,y,x;for(f.sort(N),_=f.length-1;_>=0;--_){const t=f[_].toString();for(m=this.executorsByZIndex_[t],p=bo.length-1;p>=0;--p)if(d=bo[p],y=m[d],void 0!==y&&(x=y.executeHitDetection(l,a,i,g,c),x))return x}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],s=e[2],r=e[3],o=[i,n,i,r,s,r,s,n];return vi(o,0,8,2,t,o),o}isEmpty(){return K(this.executorsByZIndex_)}execute(t,e,i,n,s,r,o){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(N),r=r||bo;const h=bo.length;let l,c,u,d,g;for(o&&a.reverse(),l=0,c=a.length;ld.execute(t,e,i,n,s,o))):d.execute(g,e,i,n,s,o),f&&g.restore(),r){r.offset();const t=a[l]*h+u;this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(r)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(N);for(let i=0,n=e.length;i{t.draw(this.renderedContext_),t.clear()})),t[e[i]].length=0}};const Fo=class extends Jr{constructor(t,e,i,n,s,r,o){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?b(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=r,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}drawImages_(t,e,i,n){if(!this.image_)return;const s=vi(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,o=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);let h=this.imageRotation_;0===this.transformRotation_&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let t=0,e=s.length;tt*this.pixelRatio_)),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==r?r:It,lineWidth:(void 0!==o?o:1)*this.pixelRatio_,miterLimit:void 0!==a?a:10,strokeStyle:ht(t||Rt)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const r=t.getScaleArray();this.imageScale_=[r[0]*this.pixelRatio_/i,r[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:ht(t||St)}}else this.textFillState_=null;const i=t.getStroke();if(i){const t=i.getColor(),e=i.getLineCap(),n=i.getLineDash(),s=i.getLineDashOffset(),r=i.getLineJoin(),o=i.getWidth(),a=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:wt,lineDash:n||Ct,lineDashOffset:s||0,lineJoin:void 0!==r?r:It,lineWidth:void 0!==o?o:1,miterLimit:void 0!==a?a:10,strokeStyle:ht(t||Rt)}}else this.textStrokeState_=null;const n=t.getFont(),s=t.getOffsetX(),r=t.getOffsetY(),o=t.getRotateWithView(),a=t.getRotation(),h=t.getScaleArray(),l=t.getText(),c=t.getTextAlign(),u=t.getTextBaseline();this.textState_={font:void 0!==n?n:vt,textAlign:void 0!==c?c:bt,textBaseline:void 0!==u?u:Et},this.text_=void 0!==l?Array.isArray(l)?l.reduce(((t,e,i)=>t+(i%2?" ":e)),""):l:"",this.textOffsetX_=void 0!==s?this.pixelRatio_*s:0,this.textOffsetY_=void 0!==r?this.pixelRatio_*r:0,this.textRotateWithView_=void 0!==o&&o,this.textRotation_=void 0!==a?a:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}else this.text_=""}},Lo=.5;const Ao={Point:function(t,e,i,s,r,o){const a=i.getImage(),h=i.getText(),l=h&&h.getText(),c=o&&a&&l?{}:void 0;if(a){if(a.getImageState()!=n)return;const o=t.getBuilder(i.getZIndex(),"Image");o.setImageStyle(a,c),o.drawPoint(e,s,r)}if(l){const n=t.getBuilder(i.getZIndex(),"Text");n.setTextStyle(h,c),n.drawText(e,s,r)}},LineString:function(t,e,i,n,s){const r=i.getStroke();if(r){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,r),o.drawLineString(e,n,s)}const o=i.getText();if(o&&o.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(o),r.drawText(e,n,s)}},Polygon:zo,MultiPoint:function(t,e,i,s,r,o){const a=i.getImage(),h=a&&0!==a.getOpacity(),l=i.getText(),c=l&&l.getText(),u=o&&h&&c?{}:void 0;if(h){if(a.getImageState()!=n)return;const o=t.getBuilder(i.getZIndex(),"Image");o.setImageStyle(a,u),o.drawMultiPoint(e,s,r)}if(c){const n=t.getBuilder(i.getZIndex(),"Text");n.setTextStyle(l,u),n.drawText(e,s,r)}},MultiLineString:function(t,e,i,n,s){const r=i.getStroke();if(r){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,r),o.drawMultiLineString(e,n,s)}const o=i.getText();if(o&&o.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(o),r.drawText(e,n,s)}},MultiPolygon:function(t,e,i,n,s){const r=i.getFill(),o=i.getStroke();if(o||r){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,o),a.drawMultiPolygon(e,n,s)}const a=i.getText();if(a&&a.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n,s)}},GeometryCollection:function(t,e,i,n,s,r){const o=e.getGeometriesArray();let a,h;for(a=0,h=o.length;a0;return f&&Promise.all(u).then((()=>a(null))),function(t,e,i,n,s,r,o){const a=i.getGeometryFunction()(e);if(!a)return;const h=a.simplifyTransformed(n,s);if(i.getRenderer())Wo(t,h,i,e,o);else{(0,Ao[h.getType()])(t,h,i,e,o,r)}}(e,i,r,o,h,l,c),f}function Wo(t,e,i,n,s){if("GeometryCollection"==e.getType()){const r=e.getGeometries();for(let e=0,o=r.length;e{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=this.frameState.size.slice(),e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,s=this.renderedProjection_,r=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],h=t[0]*Lo,l=t[1]*Lo;a.push(this.getRenderTransform(e,i,n,Lo,h,l,0).slice());const c=o.getSource(),u=s.getExtent();if(c.getWrapX()&&s.canWrapX()&&!ae(u,r)){let t=r[0];const s=Re(u);let o,c=0;for(;tu[2];)++c,o=s*c,a.push(this.getRenderTransform(e,i,n,Lo,h,l,o).slice()),t-=s}const d=ui();this.hitDetectionImageData_=function(t,e,i,n,s,r,o,a,h){const l=h?fi(s,h):s,c=W(t[0]*Lo,t[1]*Lo);c.imageSmoothingEnabled=!1;const u=c.canvas,d=new Fo(c,Lo,s,null,o,a,h?oi(ui(),h):null),g=i.length,f=Math.floor(16777215/g),_={};for(let t=1;t<=g;++t){const e=i[t-1],s=e.getStyleFunction()||n;if(!s)continue;let o=s(e,r);if(!o)continue;Array.isArray(o)||(o=[o]);const a=(t*f).toString(16).padStart(7,"#00000");for(let t=0,i=o.length;tu=n.forEachFeatureAtCoordinate(t,r,o,i,c,g&&e.declutter[g]?e.declutter[g].all().map((t=>t.value)):null))),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[Qi],s=t.viewHints[tn],r=e.getUpdateWhileAnimating(),o=e.getUpdateWhileInteracting();if(this.ready&&!r&&n||!o&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,h=t.viewState,l=h.projection,c=h.resolution,u=t.pixelRatio,d=e.getRevision(),g=e.getRenderBuffer();let f=e.getRenderOrder();void 0===f&&(f=Oo);const _=h.center.slice(),p=se(a,g*c),m=p.slice(),y=[p.slice()],x=l.getExtent();if(i.getWrapX()&&l.canWrapX()&&!ae(x,t.extent)){const t=Re(x),e=Math.max(Re(p)/2,t);p[0]=x[0]-e,p[2]=x[2]+e,Ue(_,l);const i=ke(y[0],l);i[0]x[0]&&i[2]>x[2]&&y.push([i[0]-t,i[1],i[2]-t,i[3]])}if(this.ready&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==f&&this.renderedFrameDeclutter_===!!t.declutter&&ae(this.wrappedRenderedExtent_,p))return $(this.renderedExtent_,m)||(this.hitDetectionImageData_=null,this.renderedExtent_=m),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const v=new oo(Po(c,u),p,c,u),S=ui();let w;if(S){for(let t=0,e=y.length;t{let n;const s=t.getStyleFunction()||e.getStyleFunction();if(s&&(n=s(t,c)),n){const e=this.renderFeature(t,C,n,v,w,this.getLayer().getDeclutter(),i);I=I&&!e}},b=fi(p,l),E=i.getFeaturesInExtent(b);f&&E.sort(f);for(let t=0,e=E.length;t0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new jo(Bo,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new jo(No,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new jo(No,i,t)),this.dispatchEvent(new jo(Bo,e,t))}updateLength_(){this.set(Zo,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i>1),s=+i(t[n],e),s<0?r=n+1:(o=n,a=!s);return a?r:~r}(c,u);d<0?(h=(u-c[-d-2])/(c[-d-1]-c[-d-2]),a=e+(-d-2)*n):a=e+d*n}o=o>1?o:2,r=r||new Array(o);for(let e=0;e{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=yn(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=xn(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=wn(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n)}return n&&(this.simplifiedGeometry_=new Jo(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_})),this}}Jo.prototype.getFlatCoordinates=Jo.prototype.getOrientedFlatCoordinates;const Ho=Jo;function Ko(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Qo=class extends pt{constructor(t){super(),this.projection=ni(t.projection),this.attributions_=Ko(t.attributions),this.attributionsCollapsible_=void 0===t.attributionsCollapsible||t.attributionsCollapsible,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise((function(t,i){e.viewResolver=t,e.viewRejector=i}))}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Ko(t),this.changed()}setState(t){this.state_=t,this.changed()}},ta="addfeature",ea="changefeature",ia="clear",na="removefeature",sa="featuresloadstart",ra="featuresloadend",oa="featuresloaderror";function aa(t,e){return[[-1/0,-1/0,1/0,1/0]]}let ha=!1;function la(t,e){return function(i,n,s,r,o){const a=this;!function(t,e,i,n,s,r,o){const a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,n,s):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=ha,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){const t=e.getType();try{let n;"text"==t||"json"==t?n=a.responseText:"xml"==t?n=a.responseXML||a.responseText:"arraybuffer"==t&&(n=a.response),n?r(e.readFeatures(n,{extent:i,featureProjection:s}),e.readProjection(n)):o()}catch{o()}}else o()},a.onerror=o,a.send()}(t,e,i,n,s,(function(t,e){a.addFeatures(t),void 0!==r&&r(t)}),o||U)}}class ca extends B{constructor(t,e,i){super(t),this.feature=e,this.features=i}}const ua=class extends Qo{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.on,this.once,this.un,this.loader_=U,this.format_=t.format,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&(Nt(this.format_,"`format` must be set when `url` is set"),this.loader_=la(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:aa;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let i,n;this.featuresRtree_=e?new $o:null,this.loadedExtentsRtree_=new $o,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),e||void 0!==i||(i=new Vo(n)),void 0!==n&&this.addFeaturesInternal(n),void 0!==i&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=a(t);if(!this.addToIndex_(e,t))return void(this.featuresCollection_&&this.featuresCollection_.remove(t));this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const e=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(e,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new ca(ta,t))}setupChangeEvents_(t,e){e instanceof Ho||(this.featureChangeKeys_[t]=[ct(e,tt,this.handleFeatureChange_,this),ct(e,lt,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(void 0!==e.getId()){const t=String(e.getId());if(t in this.idIndex_)if(e instanceof Ho){const n=this.idIndex_[t];n instanceof Ho?Array.isArray(n)?n.push(e):this.idIndex_[t]=[n,e]:i=!1}else i=!1;else this.idIndex_[t]=e}return i&&(Nt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let e=0,n=t.length;e{e||(e=!0,this.addFeature(t.element),e=!1)})),t.addEventListener(No,(t=>{e||(e=!0,this.removeFeature(t.element),e=!1)})),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_){this.featureChangeKeys_[t].forEach(dt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const t=t=>{this.removeFeatureInternal(t)};this.featuresRtree_.forEach(t);for(const t in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new ca(ia);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){const n=i.getGeometry();if(n instanceof Ho||n.intersectsCoordinate(t))return e(i)}))}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,(function(i){const n=i.getGeometry();if(n instanceof Ho||n.intersectsExtent(t)){const t=e(i);if(t)return t}}))}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),K(this.nullGeometryFeatures_)||V(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const i=function(t,e,i){if(e.canWrapX()){const n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];ke(t,e);const s=Re(n);if(Re(t)>s&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-s,t[3]]]}return[t]}(t,e);return[].concat(...i.map((t=>this.featuresRtree_.getInExtent(t))))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let s=null;const r=[NaN,NaN];let o=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||q,this.featuresRtree_.forEachInExtent(a,(function(t){if(e(t)){const e=t.getGeometry(),h=o;if(o=e instanceof Ho?0:e.closestPointXY(i,n,r,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new ca(ra,void 0,t))}),(()=>{--this.loadingExtentsCount_,this.dispatchEvent(new ca(oa))})),n.insert(r,{extent:r.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,(function(e){if(fe(e.extent,t))return i=e,!0})),i&&e.remove(i)}removeFeatures(t){const e=[];for(let i=0,n=t.length;i0&&this.changed()}removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=a(t);if(!(e in this.uidIndex_))return;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);this.featureChangeKeys_[e]?.forEach(dt),delete this.featureChangeKeys_[e];const i=t.getId();if(void 0!==i){const e=i.toString(),n=this.idIndex_[e];n===t?delete this.idIndex_[e]:Array.isArray(n)&&(n.splice(n.indexOf(t),1),1===n.length&&(this.idIndex_[e]=n[0]))}return delete this.uidIndex_[e],this.hasListener(na)&&this.dispatchEvent(new ca(na,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_){const n=this.idIndex_[i];if(t instanceof Ho&&Array.isArray(n)&&n.includes(t))n.splice(n.indexOf(t),1);else if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){Nt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(la(t,this.format_))}};var da=biigle.$require("events"),ga=biigle.$require("volumes.components.filterListComponent"),fa=biigle.$require("messages").handleErrorResponse,_a=biigle.$require("labelTrees.components.labelTypeahead"),pa=biigle.$require("core.mixins.loader"),ma=biigle.$require("annotations.components.settingsTabPlugins"),ya=biigle.$require("volumes.stores.filters"),xa=biigle.$require("annotations.api.volumes");function va(t,e,i,n,s,r,o,a){var h,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=i,l._compiled=!0),n&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=h):s&&(h=a?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),h)if(l.functional){l._injectStyles=h;var c=l.render;l.render=function(t,e){return h.call(e),c(t,e)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,h):[h]}return{exports:t,options:l}}const Sa=va({props:{settings:{type:Object,required:!0}},data:function(){return{opacityValue:"1",currentImageId:null,currentImage:null,cache:{}}},computed:{opacity:function(){return parseFloat(this.opacityValue)},shown:function(){return this.opacity>0}},methods:{maybeFetchLaserpoints:function(t){return this.shown&&!this.cache.hasOwnProperty(t)&&(this.cache[t]=Vt.get({image_id:t}).then((function(t){return t.data}))),this.cache[t]},updateCurrentImage:function(t,e){this.layer.getSource().clear(),this.currentImageId=t,this.currentImage=e},maybeDrawLaserpoints:function(t){if(t&&"manual"!==t.method&&t.points&&t.points.length>0){var e=this.currentImage.height;this.layer.getSource().addFeatures(t.points.map((function(t){return new jt({geometry:new ki([t[0],e-t[1]])})})))}},extendMap:function(t){t.addLayer(this.layer)}},watch:{opacity:function(t,e){t<1?this.settings.set("laserpointOpacity",t):this.settings.delete("laserpointOpacity"),0===e&&this.maybeFetchLaserpoints(this.currentImageId).then(this.maybeDrawLaserpoints),0===t&&this.layer.getSource().clear(),this.layer.setOpacity(t)},currentImageId:function(t){this.shown&&this.maybeFetchLaserpoints(t).then(this.maybeDrawLaserpoints)}},created:function(){this.layer=new Yo({source:new ua,style:[new Wi({image:new Bt({radius:6,stroke:new Fi({color:"white",width:4})})}),new Wi({image:new Bt({radius:6,stroke:new Fi({color:"#ff0000",width:2,lineDash:[1]})})})],zIndex:3,updateWhileAnimating:!0,updateWhileInteracting:!0}),this.settings.has("laserpointOpacity")&&(this.opacityValue=this.settings.get("laserpointOpacity")),da.$on("images.fetching",this.maybeFetchLaserpoints),da.$on("images.change",this.updateCurrentImage),da.$on("annotations.map.init",this.extendMap)}},undefined,undefined,!1,null,null,null).exports;ma&&(ma.laserPoints=Sa);const wa=Vue.resource("api/v1/volumes{/id}/images/filter/laserpoints");Array.isArray(ya)&&ya.push({id:"laserpoints",types:["image"],label:"detected laser points",help:"All images that (don't) contain detected laser points.",listComponent:{mixins:[ga],data:function(){return{name:"detected laser points"}}},getSequence:function(t){return wa.query({id:t})}});const Ca=va({mixins:[pa],components:{typeahead:_a},data:function(){return{volumeId:null,distance:1,processing:!1,error:!1,labels:[],label:null}},computed:{submitDisabled:function(){return this.loading||this.processing||!this.distance||!this.label}},methods:{handleError:function(t){422===t.status&&t.body.errors&&t.body.errors.id?(this.error=t.body.errors.id.join("\n"),this.processing=!1):fa(t)},setProcessing:function(){this.processing=!0,this.error=!1},setLabels:function(t){this.labels=t.body},handleSelectLabel:function(t){this.label=t},loadLabels:function(){this.loading||0!==this.labels.length||(this.startLoading(),xa.queryAnnotationLabels({id:this.volumeId}).then(this.setLabels).then(this.finishLoading).catch(fa))},submit:function(){this.startLoading(),Vt.processVolume({volume_id:this.volumeId},{distance:this.distance,label_id:this.label.id}).then(this.setProcessing).catch(this.handleError).finally(this.finishLoading)}},created:function(){this.volumeId=biigle.$require("volumes.volumeId")}},undefined,undefined,!1,null,null,null).exports;const Ia=va({mixins:[pa],components:{typeahead:_a},data:function(){return{image:null,distance:null,processing:!1,error:!1,labels:[],label:null}},computed:{submitDisabled:function(){return this.loading||this.processing||!this.distance||!this.label},volumeId:function(){return this.image.volume_id}},methods:{handleError:function(t){422===t.status&&t.body.errors&&t.body.errors.id?(this.error=t.body.errors.id.join("\n"),this.processing=!1):fa(t)},setProcessing:function(){this.processing=!0,this.error=!1},setLabels:function(t){this.labels=t.body},handleSelectLabel:function(t){this.label=t},loadLabels:function(){this.loading||0!==this.labels.length||(this.startLoading(),xa.queryAnnotationLabels({id:this.volumeId}).then(this.setLabels).then(this.finishLoading).catch(fa))},submit:function(){this.loading||(this.startLoading(),Vt.processImage({image_id:this.image.id},{distance:this.distance,label_id:this.label.id}).then(this.setProcessing).catch(this.handleError).finally(this.finishLoading))}},created:function(){this.image=biigle.$require("laserpoints.image"),this.distance=biigle.$require("laserpoints.distance")}},undefined,undefined,!1,null,null,null).exports;biigle.$mount("laserpoints-panel",Ia),Vue.component("laserpoints-form",Ca)})()})(); \ No newline at end of file diff --git a/src/public/mix-manifest.json b/src/public/mix-manifest.json index 05ea40b6..e0306b4d 100644 --- a/src/public/mix-manifest.json +++ b/src/public/mix-manifest.json @@ -1,3 +1,3 @@ { - "/assets/scripts/main.js": "/assets/scripts/main.js?id=d528b7a8571a5729e62ee032daaf396b" + "/assets/scripts/main.js": "/assets/scripts/main.js?id=a640465109964bd9395946ea8ac51c42" } diff --git a/src/resources/assets/js/components/annotationsSettingsTabPlugin.vue b/src/resources/assets/js/components/annotationsSettingsTabPlugin.vue index 4e48fb73..e81d593c 100644 --- a/src/resources/assets/js/components/annotationsSettingsTabPlugin.vue +++ b/src/resources/assets/js/components/annotationsSettingsTabPlugin.vue @@ -1,12 +1,12 @@